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.

260 lines
5.8 KiB

8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
  1. syntax = "proto3";
  2. package types;
  3. // For more information on gogo.proto, see:
  4. // https://github.com/gogo/protobuf/blob/master/extensions.md
  5. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  6. import "github.com/tendermint/tmlibs/common/types.proto";
  7. // This file is copied from http://github.com/tendermint/abci
  8. // NOTE: When using custom types, mind the warnings.
  9. // https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues
  10. //----------------------------------------
  11. // Request types
  12. message Request {
  13. oneof value {
  14. RequestEcho echo = 2;
  15. RequestFlush flush = 3;
  16. RequestInfo info = 4;
  17. RequestSetOption set_option = 5;
  18. RequestInitChain init_chain = 6;
  19. RequestQuery query = 7;
  20. RequestBeginBlock begin_block = 8;
  21. RequestCheckTx check_tx = 9;
  22. RequestDeliverTx deliver_tx = 19;
  23. RequestEndBlock end_block = 11;
  24. RequestCommit commit = 12;
  25. }
  26. }
  27. message RequestEcho {
  28. string message = 1;
  29. }
  30. message RequestFlush {
  31. }
  32. message RequestInfo {
  33. string version = 1;
  34. }
  35. // nondeterministic
  36. message RequestSetOption {
  37. string key = 1;
  38. string value = 2;
  39. }
  40. message RequestInitChain {
  41. repeated Validator validators = 1 [(gogoproto.nullable)=false];
  42. }
  43. message RequestQuery {
  44. bytes data = 1;
  45. string path = 2;
  46. int64 height = 3;
  47. bool prove = 4;
  48. }
  49. message RequestBeginBlock {
  50. bytes hash = 1;
  51. Header header = 2 [(gogoproto.nullable)=false];
  52. repeated int32 absent_validators = 3;
  53. repeated Evidence byzantine_validators = 4 [(gogoproto.nullable)=false];
  54. }
  55. message RequestCheckTx {
  56. bytes tx = 1;
  57. }
  58. message RequestDeliverTx {
  59. bytes tx = 1;
  60. }
  61. message RequestEndBlock {
  62. int64 height = 1;
  63. }
  64. message RequestCommit {
  65. }
  66. //----------------------------------------
  67. // Response types
  68. message Response {
  69. oneof value {
  70. ResponseException exception = 1;
  71. ResponseEcho echo = 2;
  72. ResponseFlush flush = 3;
  73. ResponseInfo info = 4;
  74. ResponseSetOption set_option = 5;
  75. ResponseInitChain init_chain = 6;
  76. ResponseQuery query = 7;
  77. ResponseBeginBlock begin_block = 8;
  78. ResponseCheckTx check_tx = 9;
  79. ResponseDeliverTx deliver_tx = 10;
  80. ResponseEndBlock end_block = 11;
  81. ResponseCommit commit = 12;
  82. }
  83. }
  84. // nondeterministic
  85. message ResponseException {
  86. string error = 1;
  87. }
  88. message ResponseEcho {
  89. string message = 1;
  90. }
  91. message ResponseFlush {
  92. }
  93. message ResponseInfo {
  94. string data = 1;
  95. string version = 2;
  96. int64 last_block_height = 3;
  97. bytes last_block_app_hash = 4;
  98. }
  99. // nondeterministic
  100. message ResponseSetOption {
  101. uint32 code = 1;
  102. // bytes data = 2;
  103. string log = 3;
  104. string info = 4;
  105. }
  106. message ResponseInitChain {
  107. }
  108. message ResponseQuery {
  109. uint32 code = 1;
  110. // bytes data = 2; // use "value" instead.
  111. string log = 3; // nondeterministic
  112. string info = 4; // nondeterministic
  113. int64 index = 5;
  114. bytes key = 6;
  115. bytes value = 7;
  116. bytes proof = 8;
  117. int64 height = 9;
  118. }
  119. message ResponseBeginBlock {
  120. }
  121. message ResponseCheckTx {
  122. uint32 code = 1;
  123. bytes data = 2;
  124. string log = 3; // nondeterministic
  125. string info = 4; // nondeterministic
  126. int64 gas_wanted = 5;
  127. // int64 gas_used = 6;
  128. repeated common.KVPair tags = 7 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];
  129. common.KI64Pair fee = 8 [(gogoproto.nullable)=false];
  130. }
  131. message ResponseDeliverTx {
  132. uint32 code = 1;
  133. bytes data = 2;
  134. string log = 3; // nondeterministic
  135. string info = 4; // nondeterministic
  136. int64 gas_wanted = 5;
  137. int64 gas_used = 6;
  138. repeated common.KVPair tags = 7 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];
  139. // common.KI64Pair fee = 8;
  140. }
  141. message ResponseEndBlock {
  142. repeated Validator validator_updates = 1 [(gogoproto.nullable)=false];
  143. ConsensusParams consensus_param_updates = 2;
  144. }
  145. message ResponseCommit {
  146. // reserve 1
  147. bytes data = 2;
  148. }
  149. //----------------------------------------
  150. // Misc.
  151. // ConsensusParams contains all consensus-relevant parameters
  152. // that can be adjusted by the abci app
  153. message ConsensusParams {
  154. BlockSize block_size = 1;
  155. TxSize tx_size = 2;
  156. BlockGossip block_gossip = 3;
  157. }
  158. // BlockSize contain limits on the block size.
  159. message BlockSize {
  160. int32 max_bytes = 1;
  161. int32 max_txs = 2;
  162. int64 max_gas = 3;
  163. }
  164. // TxSize contain limits on the tx size.
  165. message TxSize {
  166. int32 max_bytes = 1;
  167. int64 max_gas = 2;
  168. }
  169. // BlockGossip determine consensus critical
  170. // elements of how blocks are gossiped
  171. message BlockGossip {
  172. // Note: must not be 0
  173. int32 block_part_size_bytes = 1;
  174. }
  175. //----------------------------------------
  176. // Blockchain Types
  177. message Header {
  178. string chain_id = 1 [(gogoproto.customname)="ChainID"];
  179. int64 height = 2;
  180. int64 time = 3;
  181. int32 num_txs = 4;
  182. BlockID last_block_id = 5 [(gogoproto.customname)="LastBlockID", (gogoproto.nullable)=false];
  183. bytes last_commit_hash = 6;
  184. bytes data_hash = 7;
  185. bytes validators_hash = 8;
  186. bytes app_hash = 9;
  187. }
  188. message BlockID {
  189. bytes hash = 1;
  190. PartSetHeader parts = 2 [(gogoproto.nullable)=false];
  191. }
  192. message PartSetHeader {
  193. int32 total = 1;
  194. bytes hash = 2;
  195. }
  196. message Validator {
  197. bytes pub_key = 1;
  198. int64 power = 2;
  199. }
  200. message Evidence {
  201. bytes pub_key = 1;
  202. int64 height = 2;
  203. }
  204. //----------------------------------------
  205. // Service Definition
  206. service ABCIApplication {
  207. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  208. rpc Flush(RequestFlush) returns (ResponseFlush);
  209. rpc Info(RequestInfo) returns (ResponseInfo);
  210. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  211. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  212. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  213. rpc Query(RequestQuery) returns (ResponseQuery);
  214. rpc Commit(RequestCommit) returns (ResponseCommit);
  215. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  216. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  217. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  218. }