forked from cerc-io/laconicd
Setup and plumbing for registry module (#4)
Reviewed-on: deep-stack/laconic2d#4 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
@@ -2,13 +2,14 @@ syntax = "proto3";
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// Params defines the auction module parameters
|
||||
message Params {
|
||||
// Write custom stringer method
|
||||
|
||||
@@ -2,14 +2,14 @@ syntax = "proto3";
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// Query defines the gRPC querier interface for the auction module
|
||||
service Query {
|
||||
// Params queries auction module params
|
||||
|
||||
@@ -2,8 +2,6 @@ syntax = "proto3";
|
||||
|
||||
package cerc.auction.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
@@ -11,6 +9,8 @@ import "google/protobuf/duration.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
|
||||
// Tx defines the gRPC tx interface
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
@@ -2,11 +2,11 @@ syntax = "proto3";
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// Params defines the parameters of the bond module.
|
||||
message Params {
|
||||
// max_bond_amount is maximum amount to bond
|
||||
|
||||
@@ -2,11 +2,11 @@ syntax = "proto3";
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// GenesisState defines the bond module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the parameters of the module.
|
||||
|
||||
@@ -2,8 +2,6 @@ syntax = "proto3";
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
@@ -11,6 +9,8 @@ import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
// import "cosmos/query/v1/query.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// Query defines the gRPC querier service for bond module
|
||||
service Query {
|
||||
// Params queries bonds module params.
|
||||
|
||||
@@ -2,13 +2,13 @@ syntax = "proto3";
|
||||
|
||||
package cerc.bond.v1;
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
|
||||
// Msg defines the bond Msg service.
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.module.v1;
|
||||
|
||||
import "cosmos/app/v1alpha1/module.proto";
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/registry"
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// GenesisState defines the registry module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the params of registry module.
|
||||
Params params = 1 [(gogoproto.nullable) = false];
|
||||
|
||||
// records
|
||||
repeated Record records = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"records\" yaml:\"records\""
|
||||
];
|
||||
|
||||
// authorities
|
||||
repeated AuthorityEntry authorities = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""
|
||||
];
|
||||
|
||||
// names
|
||||
repeated NameEntry names = 4 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"names\" yaml:\"names\""
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// Query defines the gRPC querier service for registry module
|
||||
service Query {
|
||||
// Params queries the registry module params.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/params";
|
||||
}
|
||||
|
||||
// Records queries all records
|
||||
rpc Records(QueryRecordsRequest) returns (QueryRecordsResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/records";
|
||||
}
|
||||
|
||||
// Get record by id
|
||||
rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/records/{id}";
|
||||
}
|
||||
|
||||
// Get records by bond id
|
||||
rpc GetRecordsByBondId(QueryRecordsByBondIdRequest) returns (QueryRecordsByBondIdResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/records-by-bond-id/{id}";
|
||||
}
|
||||
|
||||
// NameRecords queries all name records
|
||||
rpc NameRecords(QueryNameRecordsRequest) returns (QueryNameRecordsResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/names";
|
||||
}
|
||||
|
||||
// Whois method retrieve the name authority info
|
||||
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/whois/{name}";
|
||||
}
|
||||
|
||||
// LookupCrn
|
||||
rpc LookupCrn(QueryLookupCrnRequest) returns (QueryLookupCrnResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/lookup";
|
||||
}
|
||||
|
||||
// ResolveCrn
|
||||
rpc ResolveCrn(QueryResolveCrnRequest) returns (QueryResolveCrnResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/resolve";
|
||||
}
|
||||
|
||||
// GetRecordExpiryQueue
|
||||
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueueRequest) returns (QueryGetRecordExpiryQueueResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/record-expiry";
|
||||
}
|
||||
|
||||
// GetAuthorityExpiryQueue
|
||||
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueueRequest) returns (QueryGetAuthorityExpiryQueueResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/authority-expiry";
|
||||
}
|
||||
|
||||
// Get registry module balance
|
||||
rpc GetRegistryModuleBalance(QueryGetRegistryModuleBalanceRequest) returns (QueryGetRegistryModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/balance";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request type for registry params
|
||||
message QueryParamsRequest {}
|
||||
|
||||
// QueryParamsResponse is response type for registry params
|
||||
message QueryParamsResponse {
|
||||
Params params = 1;
|
||||
}
|
||||
|
||||
// QueryRecordsRequest is request type for registry records list
|
||||
message QueryRecordsRequest {
|
||||
// TODO: Unused, check
|
||||
// message LinkInput {
|
||||
// string id = 1;
|
||||
// }
|
||||
|
||||
message ArrayInput {
|
||||
repeated ValueInput values = 1;
|
||||
}
|
||||
message MapInput {
|
||||
map<string, ValueInput> values = 1;
|
||||
}
|
||||
message ValueInput {
|
||||
// Type of record attribute value
|
||||
oneof value {
|
||||
string string = 1;
|
||||
int64 int = 2;
|
||||
double float = 3;
|
||||
bool boolean = 4;
|
||||
string link = 5;
|
||||
ArrayInput array = 6;
|
||||
MapInput map = 7;
|
||||
}
|
||||
}
|
||||
message KeyValueInput {
|
||||
string key = 1;
|
||||
ValueInput value = 2;
|
||||
}
|
||||
|
||||
repeated KeyValueInput attributes = 1;
|
||||
|
||||
bool all = 2;
|
||||
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
||||
}
|
||||
|
||||
// QueryRecordsResponse is response type for registry records list
|
||||
message QueryRecordsResponse {
|
||||
repeated Record records = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryRecordByIdRequest is request type for registry records by id
|
||||
message QueryRecordByIdRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// QueryRecordByIdResponse is response type for registry records by id
|
||||
message QueryRecordByIdResponse {
|
||||
Record record = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// QueryRecordsByBondIdRequest is request type for get the records by bond-id
|
||||
message QueryRecordsByBondIdRequest {
|
||||
string id = 1;
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||
}
|
||||
|
||||
// QueryRecordsByBondIdResponse is response type for records list by bond-id
|
||||
message QueryRecordsByBondIdResponse {
|
||||
repeated Record records = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryNameRecordsRequest is request type for registry names records
|
||||
message QueryNameRecordsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryNameRecordsResponse is response type for registry names records
|
||||
message QueryNameRecordsResponse {
|
||||
repeated NameEntry names = 1 [(gogoproto.nullable) = false];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryWhoisRequest is request type for Get NameAuthority
|
||||
message QueryWhoisRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// QueryWhoisResponse is response type for whois request
|
||||
message QueryWhoisResponse {
|
||||
NameAuthority name_authority = 1 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"name_authority\" yaml:\"name_authority\""
|
||||
];
|
||||
}
|
||||
|
||||
// QueryLookupCrnRequest is request type for LookupCrn
|
||||
message QueryLookupCrnRequest {
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryLookupCrnResponse is response type for QueryLookupCrnRequest
|
||||
message QueryLookupCrnResponse {
|
||||
NameRecord name = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrnRequest is request type for ResolveCrn
|
||||
message QueryResolveCrnRequest {
|
||||
string crn = 1;
|
||||
}
|
||||
|
||||
// QueryResolveCrnResponse is response type for QueryResolveCrnRequest
|
||||
message QueryResolveCrnResponse {
|
||||
Record record = 1;
|
||||
}
|
||||
|
||||
// QueryGetRecordExpiryQueueRequest
|
||||
message QueryGetRecordExpiryQueueRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryGetRecordExpiryQueueResponse
|
||||
message QueryGetRecordExpiryQueueResponse {
|
||||
repeated ExpiryQueueRecord records = 1;
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// ExpiryQueueRecord
|
||||
message ExpiryQueueRecord {
|
||||
string id = 1;
|
||||
repeated string value = 2;
|
||||
}
|
||||
|
||||
// QueryGetAuthorityExpiryQueueRequest
|
||||
message QueryGetAuthorityExpiryQueueRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryGetAuthorityExpiryQueueResponse
|
||||
message QueryGetAuthorityExpiryQueueResponse {
|
||||
repeated ExpiryQueueRecord authorities = 1;
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryGetRegistryModuleBalanceRequest is request type for registry module accounts balance
|
||||
message QueryGetRegistryModuleBalanceRequest {}
|
||||
|
||||
// QueryGetRegistryModuleBalanceResponse is response type for registry module accounts balance
|
||||
message QueryGetRegistryModuleBalanceResponse {
|
||||
repeated AccountBalance balances = 1;
|
||||
}
|
||||
|
||||
// AccountBalance is registry module account balance
|
||||
message AccountBalance {
|
||||
string account_name = 1 [(gogoproto.moretags) = "json:\"account_name\" yaml:\"account_name\""];
|
||||
repeated cosmos.base.v1beta1.Coin balance = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
||||
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// Params defines the registry module parameters
|
||||
message Params {
|
||||
cosmos.base.v1beta1.Coin record_rent = 1[
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""
|
||||
];
|
||||
|
||||
google.protobuf.Duration record_rent_duration = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\""
|
||||
];
|
||||
|
||||
cosmos.base.v1beta1.Coin authority_rent = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""
|
||||
];
|
||||
|
||||
google.protobuf.Duration authority_rent_duration = 4 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\""
|
||||
];
|
||||
|
||||
google.protobuf.Duration authority_grace_period = 5 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\""
|
||||
];
|
||||
|
||||
bool authority_auction_enabled = 6 [(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""];
|
||||
|
||||
google.protobuf.Duration authority_auction_commits_duration = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\""
|
||||
];
|
||||
|
||||
google.protobuf.Duration authority_auction_reveals_duration = 8 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdduration) = true,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\""
|
||||
];
|
||||
|
||||
cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\""
|
||||
];
|
||||
|
||||
cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\""
|
||||
];
|
||||
|
||||
cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\""
|
||||
];
|
||||
}
|
||||
|
||||
// Record defines a registry record
|
||||
message Record {
|
||||
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string create_time = 3 [(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""];
|
||||
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiry_time\" yaml:\"expiry_time\""];
|
||||
bool deleted = 5;
|
||||
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
|
||||
bytes attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
|
||||
repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
|
||||
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
|
||||
}
|
||||
|
||||
// AuthorityEntry defines a registry authority
|
||||
message AuthorityEntry {
|
||||
string name = 1;
|
||||
NameAuthority entry = 2;
|
||||
}
|
||||
|
||||
// NameAuthority
|
||||
message NameAuthority {
|
||||
// Owner public key.
|
||||
string owner_public_key = 1 [(gogoproto.moretags) = "json:\"owner_public_key\" yaml:\"owner_public_key\""];
|
||||
// Owner address.
|
||||
string owner_address = 2 [(gogoproto.moretags) = "json:\"owner_address\" yaml:\"owner_address\""];
|
||||
// height at which name/authority was created.
|
||||
uint64 height = 3;
|
||||
string status = 4;
|
||||
string auction_id = 5 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
||||
string bond_id = 6 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
|
||||
google.protobuf.Timestamp expiry_time = 7 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.stdtime) = true,
|
||||
(gogoproto.moretags) = "json:\"expiry_time\" yaml:\"expiry_time\""
|
||||
];
|
||||
}
|
||||
|
||||
// NameEntry
|
||||
message NameEntry {
|
||||
string name = 1;
|
||||
NameRecord entry = 2;
|
||||
}
|
||||
|
||||
// NameRecord defines a versioned name record
|
||||
message NameRecord {
|
||||
NameRecordEntry latest = 1;
|
||||
repeated NameRecordEntry history = 2;
|
||||
}
|
||||
|
||||
// NameRecordEntry
|
||||
message NameRecordEntry {
|
||||
string id = 1;
|
||||
uint64 height = 2;
|
||||
}
|
||||
|
||||
// Signature
|
||||
message Signature {
|
||||
string sig = 1 [(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""];
|
||||
string pub_key = 2 [(gogoproto.moretags) = "json:\"pub_key\" yaml:\"pub_key\""];
|
||||
}
|
||||
|
||||
// BlockChangeSet
|
||||
message BlockChangeSet {
|
||||
int64 height = 1;
|
||||
repeated string records = 2;
|
||||
repeated string auctions = 3;
|
||||
repeated AuctionBidInfo auction_bids = 4 [(gogoproto.moretags) = "json:\"auction_bids\" yaml:\"auction_bids\""];
|
||||
repeated string authorities = 5;
|
||||
repeated string names = 6;
|
||||
}
|
||||
|
||||
// AuctionBidInfo
|
||||
message AuctionBidInfo {
|
||||
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
|
||||
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidder_address\" yaml:\"bidder_address\""];
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.registry.v1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
|
||||
// Msg is a service which exposes the registry functionality
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// SetRecord records a new record with given payload and bond id
|
||||
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/set_record";
|
||||
}
|
||||
|
||||
// Renew Record renews an expired record
|
||||
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/renew_record";
|
||||
}
|
||||
|
||||
// AssociateBond
|
||||
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/associate_bond";
|
||||
}
|
||||
|
||||
// DissociateBond
|
||||
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/dissociate_bond";
|
||||
}
|
||||
|
||||
// DissociateRecords
|
||||
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/dissociate_records";
|
||||
}
|
||||
|
||||
// ReAssociateRecords
|
||||
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/reassociate_records";
|
||||
}
|
||||
|
||||
// SetName will store the name with given crn and name
|
||||
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/set_name";
|
||||
}
|
||||
|
||||
// Reserve name
|
||||
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/reserve_name";
|
||||
}
|
||||
|
||||
// Delete Name method will remove authority name
|
||||
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/delete_name";
|
||||
}
|
||||
|
||||
// SetAuthorityBond
|
||||
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {
|
||||
option (google.api.http).post = "/cerc/registry/v1/set_authority_bond";
|
||||
}
|
||||
}
|
||||
|
||||
// MsgSetRecord
|
||||
message MsgSetRecord {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 2;
|
||||
Payload payload = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// MsgSetRecordResponse
|
||||
message MsgSetRecordResponse {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// Payload
|
||||
message Payload {
|
||||
Record record = 1;
|
||||
repeated Signature signatures = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""
|
||||
];
|
||||
}
|
||||
|
||||
// MsgSetName
|
||||
message MsgSetName {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string crn = 1;
|
||||
string cid = 2;
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetNameResponse
|
||||
message MsgSetNameResponse {}
|
||||
|
||||
// MsgReserveName
|
||||
message MsgReserveAuthority {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string name = 1;
|
||||
string signer = 2;
|
||||
|
||||
// if creating a sub-authority.
|
||||
string owner = 3;
|
||||
}
|
||||
|
||||
// MsgReserveNameResponse
|
||||
message MsgReserveAuthorityResponse {}
|
||||
|
||||
// MsgSetAuthorityBond
|
||||
message MsgSetAuthorityBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string name = 1;
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgSetAuthorityBondResponse
|
||||
message MsgSetAuthorityBondResponse {}
|
||||
|
||||
// MsgDeleteNameAuthority
|
||||
message MsgDeleteNameAuthority {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string crn = 1;
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDeleteNameAuthorityResponse
|
||||
message MsgDeleteNameAuthorityResponse {}
|
||||
|
||||
// MsgRenewRecord
|
||||
message MsgRenewRecord {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgRenewRecordResponse
|
||||
message MsgRenewRecordResponse {}
|
||||
|
||||
// MsgAssociateBond
|
||||
message MsgAssociateBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
|
||||
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgAssociateBondResponse
|
||||
message MsgAssociateBondResponse {}
|
||||
|
||||
// MsgDissociateBond
|
||||
message MsgDissociateBond {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateBondResponse
|
||||
message MsgDissociateBondResponse {}
|
||||
|
||||
// MsgDissociateRecords
|
||||
message MsgDissociateRecords {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string bond_id = 1 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
|
||||
string signer = 2;
|
||||
}
|
||||
|
||||
// MsgDissociateRecordsResponse
|
||||
message MsgDissociateRecordsResponse {}
|
||||
|
||||
// MsgReAssociateRecords
|
||||
message MsgReAssociateRecords {
|
||||
option (cosmos.msg.v1.signer) = "signer";
|
||||
|
||||
string new_bond_id = 1 [(gogoproto.moretags) = "json:\"new_bond_id\" yaml:\"new_bond_id\""];
|
||||
string old_bond_id = 2 [(gogoproto.moretags) = "json:\"old_bond_id\" yaml:\"old_bond_id\""];
|
||||
string signer = 3;
|
||||
}
|
||||
|
||||
// MsgReAssociateRecordsResponse
|
||||
message MsgReAssociateRecordsResponse {}
|
||||
Reference in New Issue
Block a user