Update proto files and scripts

This commit is contained in:
Nex
2018-09-07 13:22:14 +08:00
parent e9ca38a078
commit fa403bc24e
3 changed files with 59 additions and 23 deletions

View File

@@ -11,11 +11,11 @@ option java_multiple_files = true;
service AcChain {
rpc BlockNumber (BlockNumberRequest) returns (BlockNumberResponse);
rpc GetBlockByNumber (GetBlockByNumberRequest) returns (GetBlockByNumberResponse);
rpc GetBlockByHash (GetBlockByHashRequest) returns (GetBlockByHashResponse);
rpc GetMessageByHash (GetMessageByHashRequest) returns (GetMessageByHashResponse);
rpc GetMessageByBlockNumberAndIndex (GetMessageByBlockNumberAndIndexRequest) returns (GetMessageByBlockNumberAndIndexResponse);
rpc GetMessageByBlockHashAndIndex (GetMessageByBlockHashAndIndexRequest) returns (GetMessageByBlockHashAndIndexResponse);
rpc GetBlockByNumber (GetBlockByNumberRequest) returns (Block);
rpc GetBlockByHash (GetBlockByHashRequest) returns (Block);
rpc GetMessageByHash (GetMessageByHashRequest) returns (Block);
rpc GetMessageByBlockNumberAndIndex (GetMessageByBlockNumberAndIndexRequest) returns (Message);
rpc GetMessageByBlockHashAndIndex (GetMessageByBlockHashAndIndexRequest) returns (Message);
}
message Message {
@@ -57,41 +57,26 @@ message GetBlockByNumberRequest {
uint64 number = 2;
bool full_transaction = 3;
}
message GetBlockByNumberResponse {
Block block = 1;
}
message GetBlockByHashRequest {
string ledger = 1;
bytes hash = 2;
bool full_transaction = 3;
}
message GetBlockByHashResponse {
Block block = 1;
}
message GetMessageByHashRequest {
string ledger = 1;
bytes hash = 2;
}
message GetMessageByHashResponse {
Message message = 1;
}
message GetMessageByBlockNumberAndIndexRequest {
string ledger = 1;
uint64 block_number = 2;
uint32 index = 3;
}
message GetMessageByBlockNumberAndIndexResponse {
Message message = 1;
}
message GetMessageByBlockHashAndIndexRequest {
string ledger = 1;
bytes block_hash = 2;
uint32 index = 3;
}
message GetMessageByBlockHashAndIndexResponse {
Message message = 1;
}

View File

@@ -2,6 +2,7 @@ syntax = "proto3";
package bg.api;
import "google/protobuf/empty.proto";
import "bg/api/common.proto";
option go_package = "bg/api/protobuf/tx_ledger";
@@ -11,7 +12,7 @@ option java_multiple_files = true;
service TxLedger {
rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse);
rpc GetLedgers (GetLedgersRequest) returns (GetLedgersResponse);
rpc GetLedgers (google.protobuf.Empty) returns (GetLedgersResponse);
rpc SendMessage (SendMessageRequest) returns (SendMessageResponse);
}
@@ -22,8 +23,6 @@ message CreateLedgerResponse {
bool ok = 1;
}
message GetLedgersRequest {
}
message GetLedgersResponse {
repeated string ledgers = 1;
}