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.

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