forked from cerc-io/registry-sdk
Add types and methods for participants onboarding module (#12)
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675) Co-authored-by: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Reviewed-on: cerc-io/registry-sdk#12 Co-authored-by: Nabarun <nabarun@deepstacksoft.com> Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.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/laconicd/x/onboarding"
|
||||
};
|
||||
|
||||
string authority = 1;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// GenesisState defines the onboarding module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the parameters of the module.
|
||||
Params params = 1 [ (gogoproto.nullable) = false ];
|
||||
// participants defines all the participants
|
||||
repeated Participant participants = 2 [ (gogoproto.nullable) = false ];
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// Params defines the parameters of the onboarding module.
|
||||
message Params {
|
||||
bool onboarding_enabled = 1 [
|
||||
(gogoproto.moretags) = "json:\"onboarding_enabled\" yaml:\"onboarding_enabled\""
|
||||
];
|
||||
}
|
||||
|
||||
// Participant defines the data that will be stored for each enrolled participant
|
||||
message Participant {
|
||||
string cosmos_address = 1 [
|
||||
(gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\""
|
||||
];
|
||||
|
||||
string nitro_address = 2 [
|
||||
(gogoproto.moretags) = "json:\"nitro_address\" yaml:\"nitro_address\""
|
||||
];
|
||||
}
|
||||
// EthPayload defines the payload that is signed by the ethereum private key
|
||||
message EthPayload {
|
||||
string address = 1 [
|
||||
(gogoproto.moretags) = "json:\"address\" yaml:\"address\""
|
||||
];
|
||||
|
||||
string msg = 2 [
|
||||
(gogoproto.moretags) = "json:\"msg\" yaml:\"msg\""
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// Query defines the gRPC querier service for onboarding module
|
||||
service Query {
|
||||
// Participants queries Participants list
|
||||
rpc Participants(QueryParticipantsRequest) returns (QueryParticipantsResponse) {
|
||||
option (google.api.http).get = "/cerc/onboarding/v1/participants";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParticipantsRequest queries participants
|
||||
message QueryParticipantsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryParticipantsResponse is response type for get the participants
|
||||
message QueryParticipantsResponse {
|
||||
repeated Participant participants = 1
|
||||
[ (gogoproto.moretags) = "json:\"participants\" yaml:\"participants\"" ];
|
||||
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// Msg defines the onboarding Msg service.
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// OnboardParticipant defines a method for enrolling a new validator.
|
||||
rpc OnboardParticipant(MsgOnboardParticipant)
|
||||
returns (MsgOnboardParticipantResponse) {
|
||||
option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant";
|
||||
};
|
||||
}
|
||||
|
||||
// MsgOnboardParticipant defines a SDK message for enrolling a new validator.
|
||||
message MsgOnboardParticipant {
|
||||
option (cosmos.msg.v1.signer) = "participant";
|
||||
|
||||
// Participant is the msg sender
|
||||
string participant = 1;
|
||||
EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ];
|
||||
string eth_signature = 3;
|
||||
}
|
||||
|
||||
// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response type.
|
||||
message MsgOnboardParticipantResponse {}
|
||||
Reference in New Issue
Block a user