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.

219 lines
4.9 KiB

8 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. uint64 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. }
  55. message RequestEndBlock{
  56. uint64 height = 1;
  57. }
  58. //----------------------------------------
  59. // Response types
  60. message Response {
  61. oneof value{
  62. ResponseException exception = 1;
  63. ResponseEcho echo = 2;
  64. ResponseFlush flush = 3;
  65. ResponseInfo info = 4;
  66. ResponseSetOption set_option = 5;
  67. ResponseDeliverTx deliver_tx = 6;
  68. ResponseCheckTx check_tx = 7;
  69. ResponseCommit commit = 8;
  70. ResponseQuery query = 9;
  71. ResponseInitChain init_chain = 10;
  72. ResponseBeginBlock begin_block = 11;
  73. ResponseEndBlock end_block = 12;
  74. }
  75. }
  76. message ResponseException{
  77. string error = 1;
  78. }
  79. message ResponseEcho {
  80. string message = 1;
  81. }
  82. message ResponseFlush{
  83. }
  84. message ResponseInfo {
  85. string data = 1;
  86. string version = 2;
  87. uint64 last_block_height = 3;
  88. bytes last_block_app_hash = 4;
  89. }
  90. message ResponseSetOption{
  91. string log = 1;
  92. }
  93. message ResponseDeliverTx{
  94. uint32 code = 1;
  95. bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  96. string log = 3;
  97. repeated KVPair tags = 4;
  98. }
  99. message ResponseCheckTx{
  100. uint32 code = 1;
  101. bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  102. string log = 3;
  103. uint64 gas = 4;
  104. uint64 fee = 5;
  105. }
  106. message ResponseQuery{
  107. uint32 code = 1;
  108. int64 index = 2;
  109. bytes key = 3 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  110. bytes value = 4 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  111. bytes proof = 5 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  112. uint64 height = 6;
  113. string log = 7;
  114. }
  115. message ResponseCommit{
  116. uint32 code = 1;
  117. bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
  118. string log = 3;
  119. }
  120. message ResponseInitChain{
  121. }
  122. message ResponseBeginBlock{
  123. }
  124. message ResponseEndBlock{
  125. repeated Validator diffs = 1;
  126. }
  127. //----------------------------------------
  128. // Blockchain Types
  129. message Header {
  130. string chain_id = 1;
  131. uint64 height = 2;
  132. uint64 time = 3;
  133. uint64 num_txs = 4;
  134. BlockID last_block_id = 5;
  135. bytes last_commit_hash = 6;
  136. bytes data_hash = 7;
  137. bytes validators_hash = 8;
  138. bytes app_hash = 9;
  139. }
  140. message BlockID {
  141. bytes hash = 1;
  142. PartSetHeader parts = 2;
  143. }
  144. message PartSetHeader {
  145. uint64 total = 1;
  146. bytes hash = 2;
  147. }
  148. message Validator {
  149. bytes pubKey = 1;
  150. uint64 power = 2;
  151. }
  152. //----------------------------------------
  153. // Abstract types
  154. message KVPair {
  155. string key = 1;
  156. enum Type {
  157. STRING = 0;
  158. INT = 1;
  159. }
  160. Type value_type = 2;
  161. string value_string = 3;
  162. int64 value_int = 4;
  163. }
  164. //----------------------------------------
  165. // Service Definition
  166. service ABCIApplication {
  167. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  168. rpc Flush(RequestFlush) returns (ResponseFlush);
  169. rpc Info(RequestInfo) returns (ResponseInfo);
  170. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  171. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  172. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  173. rpc Query(RequestQuery) returns (ResponseQuery);
  174. rpc Commit(RequestCommit) returns (ResponseCommit);
  175. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  176. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  177. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  178. }