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.

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