Format
This commit is contained in:
parent
5ff6cc24ee
commit
c1b575d50c
@ -14,5 +14,5 @@ service Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ClientVersionResponse {
|
message ClientVersionResponse {
|
||||||
string version = 1; // 节点客户端版本
|
string version = 1; // 节点客户端版本
|
||||||
}
|
}
|
||||||
|
@ -10,80 +10,80 @@ option java_outer_classname = "QueryProto";
|
|||||||
option java_multiple_files = true;
|
option java_multiple_files = true;
|
||||||
|
|
||||||
service Query {
|
service Query {
|
||||||
rpc GetBlockByHash (GetBlockByHashRequest) returns (GetBlockByHashResponse);
|
rpc GetBlockByHash (GetBlockByHashRequest) returns (GetBlockByHashResponse);
|
||||||
rpc GetBlocks (BlocksRequest) returns (GetBlocksResponse);
|
rpc GetBlocks (BlocksRequest) returns (GetBlocksResponse);
|
||||||
rpc CountBlocks (BlocksRequest) returns (CountBlocksResponse);
|
rpc CountBlocks (BlocksRequest) returns (CountBlocksResponse);
|
||||||
rpc GetTransactionByHash (GetTransactionByHashRequest) returns (GetTransactionByHashResponse);
|
rpc GetTransactionByHash (GetTransactionByHashRequest) returns (GetTransactionByHashResponse);
|
||||||
rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (GetTransactionByBlockHashAndIndexResponse);
|
rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (GetTransactionByBlockHashAndIndexResponse);
|
||||||
rpc GetTransactions (TransactionsRequest) returns (GetTransactionsResponse);
|
rpc GetTransactions (TransactionsRequest) returns (GetTransactionsResponse);
|
||||||
rpc CountTransactions (TransactionsRequest) returns (CountTransactionsResponse);
|
rpc CountTransactions (TransactionsRequest) returns (CountTransactionsResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
message BlockFilter {
|
message BlockFilter {
|
||||||
bytes hash = 1;
|
bytes hash = 1;
|
||||||
int64 timestamp = 2;
|
int64 timestamp = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// repeated Transaction/BlockFilters are combined by "&&"(and) operator;
|
// repeated Transaction/BlockFilters are combined by "&&"(and) operator;
|
||||||
message TransactionFilter {
|
message TransactionFilter {
|
||||||
bytes hash = 1;
|
bytes hash = 1;
|
||||||
bytes from = 2;
|
bytes from = 2;
|
||||||
bytes to = 3;
|
bytes to = 3;
|
||||||
bytes timestamp = 4;
|
bytes timestamp = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBlockByHashRequest {
|
message GetBlockByHashRequest {
|
||||||
string ledger = 1;
|
string ledger = 1;
|
||||||
bytes hash = 2;
|
bytes hash = 2;
|
||||||
bool full_transactions = 3;
|
bool full_transactions = 3;
|
||||||
}
|
}
|
||||||
message GetBlockByHashResponse {
|
message GetBlockByHashResponse {
|
||||||
Block block = 1;
|
Block block = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BlocksRequest {
|
message BlocksRequest {
|
||||||
string ledger = 1;
|
string ledger = 1;
|
||||||
repeated BlockFilter filters = 2;
|
repeated BlockFilter filters = 2;
|
||||||
int64 start_timestamp = 3; // required
|
int64 start_timestamp = 3; // required
|
||||||
int64 end_timestamp = 4;
|
int64 end_timestamp = 4;
|
||||||
}
|
}
|
||||||
message GetBlocksResponse {
|
message GetBlocksResponse {
|
||||||
repeated Block blocks = 1;
|
repeated Block blocks = 1;
|
||||||
int64 start_timestamp = 2;
|
int64 start_timestamp = 2;
|
||||||
int64 end_timestamp = 3;
|
int64 end_timestamp = 3;
|
||||||
}
|
}
|
||||||
message CountBlocksResponse {
|
message CountBlocksResponse {
|
||||||
uint64 count = 1;
|
uint64 count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTransactionByHashRequest {
|
message GetTransactionByHashRequest {
|
||||||
string ledger = 1;
|
string ledger = 1;
|
||||||
bytes hash = 2;
|
bytes hash = 2;
|
||||||
}
|
}
|
||||||
message GetTransactionByHashResponse {
|
message GetTransactionByHashResponse {
|
||||||
Transaction transaction = 1;
|
Transaction transaction = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTransactionByBlockHashAndIndexRequest {
|
message GetTransactionByBlockHashAndIndexRequest {
|
||||||
string ledger = 1;
|
string ledger = 1;
|
||||||
bytes block_hash = 2;
|
bytes block_hash = 2;
|
||||||
uint32 index = 3;
|
uint32 index = 3;
|
||||||
}
|
}
|
||||||
message GetTransactionByBlockHashAndIndexResponse {
|
message GetTransactionByBlockHashAndIndexResponse {
|
||||||
Transaction transaction = 1;
|
Transaction transaction = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TransactionsRequest {
|
message TransactionsRequest {
|
||||||
string ledger = 1;
|
string ledger = 1;
|
||||||
repeated TransactionFilter filters = 2;
|
repeated TransactionFilter filters = 2;
|
||||||
int64 start_timestamp = 3; // required
|
int64 start_timestamp = 3; // required
|
||||||
int64 end_timestamp = 4;
|
int64 end_timestamp = 4;
|
||||||
}
|
}
|
||||||
message GetTransactionsResponse {
|
message GetTransactionsResponse {
|
||||||
repeated Transaction transactions = 1;
|
repeated Transaction transactions = 1;
|
||||||
int64 start_timestamp = 2;
|
int64 start_timestamp = 2;
|
||||||
int64 end_timestamp = 3;
|
int64 end_timestamp = 3;
|
||||||
}
|
}
|
||||||
message CountTransactionsResponse {
|
message CountTransactionsResponse {
|
||||||
uint64 count = 1;
|
uint64 count = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user