block_query.proto 806 B

1234567891011121314151617181920212223242526272829
  1. syntax = "proto3";
  2. option go_package = "./pb";
  3. package pb;
  4. import "common.proto";
  5. service BlockQueryService {
  6. rpc QueryBlockByHash(QueryBlockReq) returns (pb.Response);
  7. rpc QueryBlockByHeight(QueryBlockReq) returns (pb.Response);
  8. rpc QueryLatestBlock(QueryBlockReq) returns (pb.Response);
  9. }
  10. message Block {
  11. string hash = 1; // 区块 hash
  12. int64 height = 2; // 区块块高
  13. int64 block_time = 3; // 区块时间
  14. string chain_id = 4; // 所在链 ID
  15. int64 txsCount = 5; // 区块包含的交易数量
  16. repeated string txs = 6; // 区块交易
  17. }
  18. message QueryBlockReq {
  19. string chain_id = 1; // 查询的子链 chain-id
  20. string hash = 2; // 区块 hash
  21. int64 height = 3; // 区块块高
  22. bool has_txs = 4; // 返回是否包含区块交易
  23. }