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.

227 lines
5.0 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 diffs = 1;
  129. }
  130. //----------------------------------------
  131. // Blockchain Types
  132. message Header {
  133. string chain_id = 1;
  134. int64 height = 2;
  135. int64 time = 3;
  136. int32 num_txs = 4;
  137. BlockID last_block_id = 5;
  138. bytes last_commit_hash = 6;
  139. bytes data_hash = 7;
  140. bytes validators_hash = 8;
  141. bytes app_hash = 9;
  142. }
  143. message BlockID {
  144. bytes hash = 1;
  145. PartSetHeader parts = 2;
  146. }
  147. message PartSetHeader {
  148. int32 total = 1;
  149. bytes hash = 2;
  150. }
  151. message Validator {
  152. bytes pub_key = 1;
  153. int64 power = 2;
  154. }
  155. message Evidence {
  156. bytes pub_key = 1;
  157. int64 height = 2;
  158. }
  159. //----------------------------------------
  160. // Abstract types
  161. message KVPair {
  162. string key = 1;
  163. enum Type {
  164. STRING = 0;
  165. INT = 1;
  166. }
  167. Type value_type = 2;
  168. string value_string = 3;
  169. int64 value_int = 4;
  170. }
  171. //----------------------------------------
  172. // Service Definition
  173. service ABCIApplication {
  174. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  175. rpc Flush(RequestFlush) returns (ResponseFlush);
  176. rpc Info(RequestInfo) returns (ResponseInfo);
  177. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  178. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  179. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  180. rpc Query(RequestQuery) returns (ResponseQuery);
  181. rpc Commit(RequestCommit) returns (ResponseCommit);
  182. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  183. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  184. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  185. }