The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/api/proto/message/message.proto

116 lines
3.1 KiB

syntax = "proto3";
package message;
// Client is the service used for any client-facing requests.
service ClientService {
rpc Process(Message) returns (Response) {}
}
// ServiceType indicates which service used to generate this message.
enum ServiceType {
CONSENSUS = 0;
STAKING = 1 [deprecated=true];
DRAND = 2 [deprecated=true];
CLIENT_SUPPORT = 3;
}
// MessageType indicates what is the type of this message.
enum MessageType {
NEWNODE_BEACON_STAKING = 0 [deprecated=true];
ANNOUNCE = 1;
PREPARE = 2;
PREPARED = 3;
COMMIT = 4;
COMMITTED = 5;
VIEWCHANGE = 6;
NEWVIEW = 7;
DRAND_INIT = 10 [deprecated=true];
DRAND_COMMIT = 11 [deprecated=true];
LOTTERY_REQUEST = 12 [deprecated=true]; // it should be either ENTER or GETPLAYERS but it will be removed later.
}
// This is universal message for all communication protocols.
// There are different Requests for different message types.
// As we introduce a new type of message just add a new MessageType and new type of request in Message.
//
// The request field will be either one of the structure corresponding to the MessageType type.
message Message {
ServiceType service_type = 1;
MessageType type = 2;
bytes signature = 3;
oneof request {
StakingRequest staking = 4 [deprecated=true];
ConsensusRequest consensus = 5 ;
DrandRequest drand = 6 [deprecated=true];
ViewChangeRequest viewchange = 7;
// Refactor this later after demo.
LotteryRequest lottery_request = 8 [deprecated=true];
}
}
message Response {
ServiceType service_type = 1;
MessageType type = 2;
oneof response {
LotteryResponse lottery_response = 3 [deprecated=true];
}
}
message LotteryResponse {
repeated string players = 2 [deprecated=true];
repeated string balances = 3 [deprecated=true];
}
message LotteryRequest {
enum Type {
ENTER = 0 [deprecated=true];
RESULT = 1 [deprecated=true];
PICK_WINNER = 2 [deprecated=true];
}
Type type = 1 [deprecated=true];
string private_key = 2 [deprecated=true];
int64 amount = 3 [deprecated=true];
}
// Staking Request from new node to beacon node.
message StakingRequest {
bytes transaction = 1 [deprecated=true];
string node_id = 2 [deprecated=true];
}
message ConsensusRequest {
uint64 view_id = 1;
uint64 block_num = 2;
uint32 shard_id = 3;
bytes block_hash = 4;
bytes block = 5;
bytes sender_pubkey = 6;
bytes payload = 7;
}
message DrandRequest {
uint32 shard_id = 1 [deprecated=true];
bytes sender_pubkey = 2 [deprecated=true];
bytes block_hash = 3 [deprecated=true];
bytes payload = 4 [deprecated=true];
}
message ViewChangeRequest {
uint64 view_id = 1;
uint64 block_num = 2;
uint32 shard_id = 3;
bytes sender_pubkey = 4;
bytes leader_pubkey = 5;
bytes payload = 6; // message payload: either m1 type or m2 type
bytes viewchange_sig = 7; // signature on payload
bytes viewid_sig = 8; // signature on view_id
// below is for newview message only
// only need 1 valid m1 type message which is in payload
bytes m2_aggsigs = 9; // m2: |nil|
bytes m2_bitmap = 10;
bytes m3_aggsigs = 11; // m3: |viewID|
bytes m3_bitmap= 12;
bytes prepared_block = 13;
}