Skip to content

Commit af211da

Browse files
committed
add akash
1 parent fb691fb commit af211da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3070
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ Note:
4545
## Other Cosmos based coins
4646
Currently following coins are supported by this library:
4747
* Akash
48+
* Cosmos
4849
* Osmosis
4950
* Umee
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
syntax = "proto3";
2+
package akash.audit.v1beta1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "akash/base/v1beta1/attribute.proto";
6+
7+
option go_package = "github.com/ovrclk/akash/x/audit/types/v1beta1";
8+
9+
// Msg defines the provider Msg service
10+
service Msg {
11+
// SignProviderAttributes defines a method that signs provider attributes
12+
rpc SignProviderAttributes(MsgSignProviderAttributes) returns (MsgSignProviderAttributesResponse);
13+
14+
// DeleteProviderAttributes defines a method that deletes provider attributes
15+
rpc DeleteProviderAttributes(MsgDeleteProviderAttributes) returns (MsgDeleteProviderAttributesResponse);
16+
}
17+
18+
// Provider stores owner auditor and attributes details
19+
message Provider {
20+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
21+
22+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
23+
24+
repeated akash.base.v1beta1.Attribute attributes = 4 [
25+
(gogoproto.castrepeated) = "github.com/ovrclk/akash/types/v1beta1.Attributes",
26+
(gogoproto.nullable) = false,
27+
(gogoproto.jsontag) = "attributes",
28+
(gogoproto.moretags) = "yaml:\"attributes\""
29+
];
30+
}
31+
32+
// Attributes
33+
message AuditedAttributes {
34+
option (gogoproto.equal) = false;
35+
option (gogoproto.goproto_stringer) = true;
36+
37+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
38+
39+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
40+
41+
repeated akash.base.v1beta1.Attribute attributes = 3 [
42+
(gogoproto.castrepeated) = "github.com/ovrclk/akash/types/v1beta1.Attributes",
43+
(gogoproto.nullable) = false,
44+
(gogoproto.jsontag) = "attributes",
45+
(gogoproto.moretags) = "yaml:\"attributes\""
46+
];
47+
}
48+
49+
// AttributesResponse represents details of deployment along with group details
50+
message AttributesResponse {
51+
option (gogoproto.equal) = false;
52+
option (gogoproto.goproto_stringer) = true;
53+
54+
repeated AuditedAttributes attributes = 1
55+
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes", (gogoproto.moretags) = "yaml:\"attributes\""];
56+
}
57+
58+
// AttributesFilters defines filters used to filter deployments
59+
message AttributesFilters {
60+
option (gogoproto.equal) = false;
61+
option (gogoproto.goproto_stringer) = true;
62+
63+
repeated string auditors = 1 [(gogoproto.jsontag) = "auditors", (gogoproto.moretags) = "yaml:\"auditors\""];
64+
65+
repeated string owners = 2 [(gogoproto.jsontag) = "owners", (gogoproto.moretags) = "yaml:\"owners\""];
66+
}
67+
68+
// MsgSignProviderAttributes defines an SDK message for signing a provider attributes
69+
message MsgSignProviderAttributes {
70+
option (gogoproto.equal) = false;
71+
72+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
73+
74+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
75+
76+
repeated akash.base.v1beta1.Attribute attributes = 3 [
77+
(gogoproto.castrepeated) = "github.com/ovrclk/akash/types/v1beta1.Attributes",
78+
(gogoproto.nullable) = false,
79+
(gogoproto.jsontag) = "attributes",
80+
(gogoproto.moretags) = "yaml:\"attributes\""
81+
];
82+
}
83+
84+
// MsgSignProviderAttributesResponse defines the Msg/CreateProvider response type.
85+
message MsgSignProviderAttributesResponse {}
86+
87+
// MsgDeleteProviderAttributes defined the Msg/DeleteProviderAttributes
88+
message MsgDeleteProviderAttributes {
89+
option (gogoproto.equal) = false;
90+
91+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
92+
93+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
94+
95+
repeated string keys = 3 [(gogoproto.jsontag) = "keys", (gogoproto.moretags) = "yaml:\"keys\""];
96+
}
97+
98+
// MsgDeleteProviderAttributesResponse defines the Msg/ProviderAttributes response type.
99+
message MsgDeleteProviderAttributesResponse {}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
syntax = "proto3";
2+
package akash.audit.v1beta2;
3+
4+
import "gogoproto/gogo.proto";
5+
import "akash/base/v1beta2/attribute.proto";
6+
7+
option go_package = "github.com/ovrclk/akash/x/audit/types/v1beta2";
8+
9+
// Msg defines the provider Msg service
10+
service Msg {
11+
// SignProviderAttributes defines a method that signs provider attributes
12+
rpc SignProviderAttributes(MsgSignProviderAttributes) returns (MsgSignProviderAttributesResponse);
13+
14+
// DeleteProviderAttributes defines a method that deletes provider attributes
15+
rpc DeleteProviderAttributes(MsgDeleteProviderAttributes) returns (MsgDeleteProviderAttributesResponse);
16+
}
17+
18+
// Provider stores owner auditor and attributes details
19+
message Provider {
20+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
21+
22+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
23+
24+
repeated akash.base.v1beta2.Attribute attributes = 4 [
25+
(gogoproto.castrepeated) = "github.com/ovrclk/akash/types/v1beta2.Attributes",
26+
(gogoproto.nullable) = false,
27+
(gogoproto.jsontag) = "attributes",
28+
(gogoproto.moretags) = "yaml:\"attributes\""
29+
];
30+
}
31+
32+
// Attributes
33+
message AuditedAttributes {
34+
option (gogoproto.equal) = false;
35+
option (gogoproto.goproto_stringer) = true;
36+
37+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
38+
39+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
40+
41+
repeated akash.base.v1beta2.Attribute attributes = 3 [
42+
(gogoproto.castrepeated) = "github.com/ovrclk/akash/types/v1beta2.Attributes",
43+
(gogoproto.nullable) = false,
44+
(gogoproto.jsontag) = "attributes",
45+
(gogoproto.moretags) = "yaml:\"attributes\""
46+
];
47+
}
48+
49+
// AttributesResponse represents details of deployment along with group details
50+
message AttributesResponse {
51+
option (gogoproto.equal) = false;
52+
option (gogoproto.goproto_stringer) = true;
53+
54+
repeated AuditedAttributes attributes = 1
55+
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes", (gogoproto.moretags) = "yaml:\"attributes\""];
56+
}
57+
58+
// AttributesFilters defines filters used to filter deployments
59+
message AttributesFilters {
60+
option (gogoproto.equal) = false;
61+
option (gogoproto.goproto_stringer) = true;
62+
63+
repeated string auditors = 1 [(gogoproto.jsontag) = "auditors", (gogoproto.moretags) = "yaml:\"auditors\""];
64+
65+
repeated string owners = 2 [(gogoproto.jsontag) = "owners", (gogoproto.moretags) = "yaml:\"owners\""];
66+
}
67+
68+
// MsgSignProviderAttributes defines an SDK message for signing a provider attributes
69+
message MsgSignProviderAttributes {
70+
option (gogoproto.equal) = false;
71+
72+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
73+
74+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
75+
76+
repeated akash.base.v1beta2.Attribute attributes = 3 [
77+
(gogoproto.castrepeated) = "github.com/ovrclk/akash/types/v1beta2.Attributes",
78+
(gogoproto.nullable) = false,
79+
(gogoproto.jsontag) = "attributes",
80+
(gogoproto.moretags) = "yaml:\"attributes\""
81+
];
82+
}
83+
84+
// MsgSignProviderAttributesResponse defines the Msg/CreateProvider response type.
85+
message MsgSignProviderAttributesResponse {}
86+
87+
// MsgDeleteProviderAttributes defined the Msg/DeleteProviderAttributes
88+
message MsgDeleteProviderAttributes {
89+
option (gogoproto.equal) = false;
90+
91+
string owner = 1 [(gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\""];
92+
93+
string auditor = 2 [(gogoproto.jsontag) = "auditor", (gogoproto.moretags) = "yaml:\"auditor\""];
94+
95+
repeated string keys = 3 [(gogoproto.jsontag) = "keys", (gogoproto.moretags) = "yaml:\"keys\""];
96+
}
97+
98+
// MsgDeleteProviderAttributesResponse defines the Msg/ProviderAttributes response type.
99+
message MsgDeleteProviderAttributesResponse {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
syntax = "proto3";
2+
package akash.audit.v1beta2;
3+
4+
import "gogoproto/gogo.proto";
5+
import "akash/audit/v1beta2/audit.proto";
6+
7+
option go_package = "github.com/ovrclk/akash/x/audit/types/v1beta2";
8+
9+
// GenesisState defines the basic genesis state used by audit module
10+
message GenesisState {
11+
repeated AuditedAttributes attributes = 1
12+
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes", (gogoproto.moretags) = "yaml:\"attributes\""];
13+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
syntax = "proto3";
2+
3+
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
4+
5+
package akash.audit.v1beta2;
6+
7+
import "gogoproto/gogo.proto";
8+
import "google/api/annotations.proto";
9+
import "cosmos/base/query/v1beta1/pagination.proto";
10+
import "akash/audit/v1beta2/audit.proto";
11+
12+
option go_package = "github.com/ovrclk/akash/x/audit/types/v1beta2";
13+
14+
// Query defines the gRPC querier service
15+
service Query {
16+
// AllProvidersAttributes queries all providers
17+
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
18+
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
19+
rpc AllProvidersAttributes(QueryAllProvidersAttributesRequest) returns (QueryProvidersResponse) {
20+
option (google.api.http).get = "/akash/audit/v1beta2/audit/attributes/list";
21+
}
22+
23+
// ProviderAttributes queries all provider signed attributes
24+
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
25+
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
26+
rpc ProviderAttributes(QueryProviderAttributesRequest) returns (QueryProvidersResponse) {
27+
option (google.api.http).get = "/akash/audit/v1beta2/audit/attributes/{owner}/list";
28+
}
29+
30+
// ProviderAuditorAttributes queries provider signed attributes by specific auditor
31+
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
32+
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
33+
rpc ProviderAuditorAttributes(QueryProviderAuditorRequest) returns (QueryProvidersResponse) {
34+
option (google.api.http).get = "/akash/audit/v1beta2/audit/attributes/{auditor}/{owner}";
35+
}
36+
37+
// AuditorAttributes queries all providers signed by this auditor
38+
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
39+
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
40+
rpc AuditorAttributes(QueryAuditorAttributesRequest) returns (QueryProvidersResponse) {
41+
option (google.api.http).get = "/akash/provider/v1beta2/auditor/{auditor}/list";
42+
}
43+
}
44+
45+
// QueryProvidersResponse is response type for the Query/Providers RPC method
46+
message QueryProvidersResponse {
47+
repeated Provider providers = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "Providers"];
48+
49+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
50+
}
51+
52+
// QueryProviderRequest is request type for the Query/Provider RPC method
53+
message QueryProviderRequest {
54+
string auditor = 1;
55+
string owner = 2;
56+
}
57+
58+
// QueryAllProvidersAttributesRequest is request type for the Query/All Providers RPC method
59+
message QueryAllProvidersAttributesRequest {
60+
cosmos.base.query.v1beta1.PageRequest pagination = 1;
61+
}
62+
63+
// QueryProviderAttributesRequest is request type for the Query/Provider RPC method
64+
message QueryProviderAttributesRequest {
65+
string owner = 1;
66+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
67+
}
68+
69+
// QueryProviderAuditorRequest is request type for the Query/Providers RPC method
70+
message QueryProviderAuditorRequest {
71+
string auditor = 1;
72+
string owner = 2;
73+
}
74+
75+
// QueryAuditorAttributesRequest is request type for the Query/Providers RPC method
76+
message QueryAuditorAttributesRequest {
77+
string auditor = 1;
78+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
79+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
syntax = "proto3";
2+
3+
package akash.base.v1beta1;
4+
5+
import "gogoproto/gogo.proto";
6+
7+
option (gogoproto.goproto_stringer_all) = false;
8+
option (gogoproto.stringer_all) = false;
9+
option go_package = "github.com/ovrclk/akash/types/v1beta1";
10+
11+
// Attribute represents key value pair
12+
message Attribute {
13+
option (gogoproto.goproto_getters) = false;
14+
string key = 1 [(gogoproto.moretags) = "yaml:\"key\""];
15+
string value = 2 [(gogoproto.moretags) = "yaml:\"value\""];
16+
}
17+
18+
// SignedBy represents validation accounts that tenant expects signatures for provider attributes
19+
// AllOf has precedence i.e. if there is at least one entry AnyOf is ignored regardless to how many
20+
// entries there
21+
// this behaviour to be discussed
22+
message SignedBy {
23+
option (gogoproto.goproto_getters) = false;
24+
// all_of all keys in this list must have signed attributes
25+
repeated string all_of = 1 [(gogoproto.jsontag) = "all_of", (gogoproto.moretags) = "yaml:\"allOf\""];
26+
// any_of at least of of the keys from the list must have signed attributes
27+
repeated string any_of = 2 [(gogoproto.jsontag) = "any_of", (gogoproto.moretags) = "yaml:\"anyOf\""];
28+
}
29+
30+
// PlacementRequirements
31+
message PlacementRequirements {
32+
option (gogoproto.goproto_getters) = false;
33+
34+
// SignedBy list of keys that tenants expect to have signatures from
35+
SignedBy signed_by = 1
36+
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "signed_by", (gogoproto.moretags) = "yaml:\"signed_by\""];
37+
38+
// Attribute list of attributes tenant expects from the provider
39+
repeated Attribute attributes = 2
40+
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes", (gogoproto.moretags) = "yaml:\"attributes\""];
41+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
syntax = "proto3";
2+
package akash.base.v1beta1;
3+
4+
import "gogoproto/gogo.proto";
5+
6+
option go_package = "github.com/ovrclk/akash/types/v1beta1";
7+
8+
// Endpoint describes a publicly accessible IP service
9+
message Endpoint {
10+
option (gogoproto.equal) = true;
11+
// This describes how the endpoint is implemented when the lease is deployed
12+
enum Kind {
13+
// Describes an endpoint that becomes a Kubernetes Ingress
14+
SHARED_HTTP = 0;
15+
// Describes an endpoint that becomes a Kubernetes NodePort
16+
RANDOM_PORT = 1;
17+
}
18+
Kind kind = 1;
19+
}

0 commit comments

Comments
 (0)