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.

255 lines
5.7 KiB

8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 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 = 1;
  10. RequestFlush flush = 2;
  11. RequestInfo info = 3;
  12. RequestSetOption set_option = 4;
  13. RequestDeliverTx deliver_tx = 5;
  14. RequestCheckTx check_tx = 6;
  15. RequestCommit commit = 7;
  16. RequestQuery query = 8;
  17. RequestInitChain init_chain = 9;
  18. RequestBeginBlock begin_block = 10;
  19. RequestEndBlock end_block = 11;
  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 RequestDeliverTx{
  35. bytes tx = 1;
  36. }
  37. message RequestCheckTx{
  38. bytes tx = 1;
  39. }
  40. message RequestQuery{
  41. bytes data = 1;
  42. string path = 2;
  43. int64 height = 3;
  44. bool prove = 4;
  45. }
  46. message RequestCommit{
  47. }
  48. message RequestInitChain{
  49. repeated Validator validators = 1;
  50. }
  51. message RequestBeginBlock{
  52. bytes hash = 1;
  53. Header header = 2;
  54. repeated int32 absent_validators = 3;
  55. repeated Evidence byzantine_validators = 4;
  56. }
  57. message RequestEndBlock{
  58. int64 height = 1;
  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. ResponseDeliverTx deliver_tx = 6;
  70. ResponseCheckTx check_tx = 7;
  71. ResponseCommit commit = 8;
  72. ResponseQuery query = 9;
  73. ResponseInitChain init_chain = 10;
  74. ResponseBeginBlock begin_block = 11;
  75. ResponseEndBlock end_block = 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 ResponseDeliverTx{
  97. uint32 code = 1;
  98. bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  99. string log = 3;
  100. repeated KVPair tags = 4;
  101. }
  102. message ResponseCheckTx{
  103. uint32 code = 1;
  104. bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  105. string log = 3;
  106. int64 gas = 4;
  107. int64 fee = 5;
  108. }
  109. message ResponseQuery{
  110. uint32 code = 1;
  111. int64 index = 2;
  112. bytes key = 3 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  113. bytes value = 4 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  114. bytes proof = 5 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  115. int64 height = 6;
  116. string log = 7;
  117. }
  118. message ResponseCommit{
  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. }
  123. message ResponseInitChain{
  124. }
  125. message ResponseBeginBlock{
  126. }
  127. message ResponseEndBlock{
  128. repeated Validator changes = 1;
  129. ConsensusParams consensus_param_changes = 2;
  130. }
  131. message ConsensusParams{
  132. BlockSizeParams block_size_params = 1;
  133. TxSizeParams tx_size_params = 2;
  134. BlockGossipParams block_gossip_params = 3;
  135. }
  136. // BlockSizeParams contain limits on the block size.
  137. message BlockSizeParams{
  138. // NOTE: must not be 0 nor greater than 100MB
  139. int32 max_bytes = 1;
  140. int32 max_txs = 2;
  141. int64 max_gas = 3;
  142. }
  143. // TxSizeParams contain limits on the tx size.
  144. message TxSizeParams {
  145. int32 max_bytes = 1;
  146. int64 max_gas = 2;
  147. }
  148. // BlockGossipParams determine consensus critical
  149. // elements of how blocks are gossiped
  150. message BlockGossipParams {
  151. // Note: must not be 0
  152. int32 block_part_size_bytes = 1;
  153. }
  154. //----------------------------------------
  155. // Blockchain Types
  156. message Header {
  157. string chain_id = 1;
  158. int64 height = 2;
  159. int64 time = 3;
  160. int32 num_txs = 4;
  161. BlockID last_block_id = 5;
  162. bytes last_commit_hash = 6;
  163. bytes data_hash = 7;
  164. bytes validators_hash = 8;
  165. bytes app_hash = 9;
  166. }
  167. message BlockID {
  168. bytes hash = 1;
  169. PartSetHeader parts = 2;
  170. }
  171. message PartSetHeader {
  172. int32 total = 1;
  173. bytes hash = 2;
  174. }
  175. message Validator {
  176. bytes pub_key = 1;
  177. int64 power = 2;
  178. }
  179. message Evidence {
  180. bytes pub_key = 1;
  181. int64 height = 2;
  182. }
  183. //----------------------------------------
  184. // Abstract types
  185. message KVPair {
  186. string key = 1;
  187. enum Type {
  188. STRING = 0;
  189. INT = 1;
  190. }
  191. Type value_type = 2;
  192. string value_string = 3;
  193. int64 value_int = 4;
  194. }
  195. //----------------------------------------
  196. // Service Definition
  197. service ABCIApplication {
  198. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  199. rpc Flush(RequestFlush) returns (ResponseFlush);
  200. rpc Info(RequestInfo) returns (ResponseInfo);
  201. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  202. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  203. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  204. rpc Query(RequestQuery) returns (ResponseQuery);
  205. rpc Commit(RequestCommit) returns (ResponseCommit);
  206. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  207. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  208. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  209. }