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.

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