This commit is contained in:
Nex 2020-03-07 13:15:29 +08:00
parent 5ff6cc24ee
commit c1b575d50c
2 changed files with 42 additions and 42 deletions

View File

@ -14,5 +14,5 @@ service Node {
}
message ClientVersionResponse {
string version = 1; //
}
string version = 1; //
}

View File

@ -10,80 +10,80 @@ option java_outer_classname = "QueryProto";
option java_multiple_files = true;
service Query {
rpc GetBlockByHash (GetBlockByHashRequest) returns (GetBlockByHashResponse);
rpc GetBlocks (BlocksRequest) returns (GetBlocksResponse);
rpc CountBlocks (BlocksRequest) returns (CountBlocksResponse);
rpc GetTransactionByHash (GetTransactionByHashRequest) returns (GetTransactionByHashResponse);
rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (GetTransactionByBlockHashAndIndexResponse);
rpc GetTransactions (TransactionsRequest) returns (GetTransactionsResponse);
rpc CountTransactions (TransactionsRequest) returns (CountTransactionsResponse);
rpc GetBlockByHash (GetBlockByHashRequest) returns (GetBlockByHashResponse);
rpc GetBlocks (BlocksRequest) returns (GetBlocksResponse);
rpc CountBlocks (BlocksRequest) returns (CountBlocksResponse);
rpc GetTransactionByHash (GetTransactionByHashRequest) returns (GetTransactionByHashResponse);
rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (GetTransactionByBlockHashAndIndexResponse);
rpc GetTransactions (TransactionsRequest) returns (GetTransactionsResponse);
rpc CountTransactions (TransactionsRequest) returns (CountTransactionsResponse);
}
message BlockFilter {
bytes hash = 1;
int64 timestamp = 2;
bytes hash = 1;
int64 timestamp = 2;
}
// repeated Transaction/BlockFilters are combined by "&&"(and) operator;
message TransactionFilter {
bytes hash = 1;
bytes from = 2;
bytes to = 3;
bytes timestamp = 4;
bytes hash = 1;
bytes from = 2;
bytes to = 3;
bytes timestamp = 4;
}
message GetBlockByHashRequest {
string ledger = 1;
bytes hash = 2;
bool full_transactions = 3;
string ledger = 1;
bytes hash = 2;
bool full_transactions = 3;
}
message GetBlockByHashResponse {
Block block = 1;
Block block = 1;
}
message BlocksRequest {
string ledger = 1;
repeated BlockFilter filters = 2;
int64 start_timestamp = 3; // required
int64 end_timestamp = 4;
string ledger = 1;
repeated BlockFilter filters = 2;
int64 start_timestamp = 3; // required
int64 end_timestamp = 4;
}
message GetBlocksResponse {
repeated Block blocks = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
repeated Block blocks = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
}
message CountBlocksResponse {
uint64 count = 1;
uint64 count = 1;
}
message GetTransactionByHashRequest {
string ledger = 1;
bytes hash = 2;
string ledger = 1;
bytes hash = 2;
}
message GetTransactionByHashResponse {
Transaction transaction = 1;
Transaction transaction = 1;
}
message GetTransactionByBlockHashAndIndexRequest {
string ledger = 1;
bytes block_hash = 2;
uint32 index = 3;
string ledger = 1;
bytes block_hash = 2;
uint32 index = 3;
}
message GetTransactionByBlockHashAndIndexResponse {
Transaction transaction = 1;
Transaction transaction = 1;
}
message TransactionsRequest {
string ledger = 1;
repeated TransactionFilter filters = 2;
int64 start_timestamp = 3; // required
int64 end_timestamp = 4;
string ledger = 1;
repeated TransactionFilter filters = 2;
int64 start_timestamp = 3; // required
int64 end_timestamp = 4;
}
message GetTransactionsResponse {
repeated Transaction transactions = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
repeated Transaction transactions = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
}
message CountTransactionsResponse {
uint64 count = 1;
uint64 count = 1;
}