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.

261 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 app_state_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. }
  109. message ResponseQuery {
  110. uint32 code = 1;
  111. // bytes data = 2; // use "value" instead.
  112. string log = 3; // nondeterministic
  113. string info = 4; // nondeterministic
  114. int64 index = 5;
  115. bytes key = 6;
  116. bytes value = 7;
  117. bytes proof = 8;
  118. int64 height = 9;
  119. }
  120. message ResponseBeginBlock {
  121. }
  122. message ResponseCheckTx {
  123. uint32 code = 1;
  124. bytes data = 2;
  125. string log = 3; // nondeterministic
  126. string info = 4; // nondeterministic
  127. int64 gas_wanted = 5;
  128. int64 gas_used = 6;
  129. repeated common.KVPair tags = 7 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];
  130. common.KI64Pair fee = 8 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];
  131. }
  132. message ResponseDeliverTx {
  133. uint32 code = 1;
  134. bytes data = 2;
  135. string log = 3; // nondeterministic
  136. string info = 4; // nondeterministic
  137. int64 gas_wanted = 5;
  138. int64 gas_used = 6;
  139. repeated common.KVPair tags = 7 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];
  140. common.KI64Pair fee = 8 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"];
  141. }
  142. message ResponseEndBlock {
  143. repeated Validator validator_updates = 1 [(gogoproto.nullable)=false];
  144. ConsensusParams consensus_param_updates = 2;
  145. }
  146. message ResponseCommit {
  147. // reserve 1
  148. bytes data = 2;
  149. }
  150. //----------------------------------------
  151. // Misc.
  152. // ConsensusParams contains all consensus-relevant parameters
  153. // that can be adjusted by the abci app
  154. message ConsensusParams {
  155. BlockSize block_size = 1;
  156. TxSize tx_size = 2;
  157. BlockGossip block_gossip = 3;
  158. }
  159. // BlockSize contain limits on the block size.
  160. message BlockSize {
  161. int32 max_bytes = 1;
  162. int32 max_txs = 2;
  163. int64 max_gas = 3;
  164. }
  165. // TxSize contain limits on the tx size.
  166. message TxSize {
  167. int32 max_bytes = 1;
  168. int64 max_gas = 2;
  169. }
  170. // BlockGossip determine consensus critical
  171. // elements of how blocks are gossiped
  172. message BlockGossip {
  173. // Note: must not be 0
  174. int32 block_part_size_bytes = 1;
  175. }
  176. //----------------------------------------
  177. // Blockchain Types
  178. message Header {
  179. string chain_id = 1 [(gogoproto.customname)="ChainID"];
  180. int64 height = 2;
  181. int64 time = 3;
  182. int32 num_txs = 4;
  183. BlockID last_block_id = 5 [(gogoproto.customname)="LastBlockID", (gogoproto.nullable)=false];
  184. bytes last_commit_hash = 6;
  185. bytes data_hash = 7;
  186. bytes validators_hash = 8;
  187. bytes app_hash = 9;
  188. }
  189. message BlockID {
  190. bytes hash = 1;
  191. PartSetHeader parts = 2 [(gogoproto.nullable)=false];
  192. }
  193. message PartSetHeader {
  194. int32 total = 1;
  195. bytes hash = 2;
  196. }
  197. message Validator {
  198. bytes pub_key = 1;
  199. int64 power = 2;
  200. }
  201. message Evidence {
  202. bytes pub_key = 1;
  203. int64 height = 2;
  204. }
  205. //----------------------------------------
  206. // Service Definition
  207. service ABCIApplication {
  208. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  209. rpc Flush(RequestFlush) returns (ResponseFlush);
  210. rpc Info(RequestInfo) returns (ResponseInfo);
  211. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  212. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  213. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  214. rpc Query(RequestQuery) returns (ResponseQuery);
  215. rpc Commit(RequestCommit) returns (ResponseCommit);
  216. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  217. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  218. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  219. }