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/p2p/stream/protocols/sync/message/msg.proto

80 lines
1.6 KiB

syntax = "proto3";
package harmony.stream.sync.message ;
option go_package = "message";
message Message {
oneof req_or_resp {
Request req = 1;
Response resp = 2;
}
}
message Request {
uint64 req_id = 1;
oneof request {
GetBlockNumberRequest get_block_number_request = 2;
GetBlockHashesRequest get_block_hashes_request = 3;
GetBlocksByNumRequest get_blocks_by_num_request = 4;
GetBlocksByHashesRequest get_blocks_by_hashes_request = 5;
GetEpochStateRequest get_epoch_state_request = 6;
}
}
message GetBlockNumberRequest {}
message GetBlockHashesRequest {
repeated uint64 nums = 1 [packed=true];
}
message GetBlocksByNumRequest {
repeated uint64 nums = 1 [packed=true];
}
message GetBlocksByHashesRequest {
repeated bytes block_hashes = 1;
}
message GetEpochStateRequest {
uint64 epoch = 1;
}
message Response {
uint64 req_id = 1;
oneof response {
ErrorResponse error_response = 2;
GetBlockNumberResponse get_block_number_response = 3;
GetBlockHashesResponse get_block_hashes_response = 4;
GetBlocksByNumResponse get_blocks_by_num_response = 5;
GetBlocksByHashesResponse get_blocks_by_hashes_response = 6;
GetEpochStateResponse get_epoch_state_response = 7;
}
}
message ErrorResponse {
string error = 1;
}
message GetBlockNumberResponse {
uint64 number = 1;
}
message GetBlockHashesResponse {
repeated bytes hashes = 1;
}
message GetBlocksByNumResponse {
repeated bytes blocks_bytes = 1;
}
message GetBlocksByHashesResponse {
repeated bytes blocks_bytes = 1;
}
message GetEpochStateResponse {
bytes header_bytes = 1;
bytes shard_state = 2;
}