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.

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