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.

242 lines
4.9 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. syntax = "proto3";
  2. package types;
  3. // This file is copied from http://github.com/tendermint/abci
  4. //----------------------------------------
  5. // Code types
  6. enum CodeType {
  7. OK = 0;
  8. // General response codes, 0 ~ 99
  9. InternalError = 1;
  10. EncodingError = 2;
  11. BadNonce = 3;
  12. Unauthorized = 4;
  13. InsufficientFunds = 5;
  14. UnknownRequest = 6;
  15. // Reserved for basecoin, 100 ~ 199
  16. BaseDuplicateAddress = 101;
  17. BaseEncodingError = 102;
  18. BaseInsufficientFees = 103;
  19. BaseInsufficientFunds = 104;
  20. BaseInsufficientGasPrice = 105;
  21. BaseInvalidInput = 106;
  22. BaseInvalidOutput = 107;
  23. BaseInvalidPubKey = 108;
  24. BaseInvalidSequence = 109;
  25. BaseInvalidSignature = 110;
  26. BaseUnknownAddress = 111;
  27. BaseUnknownPubKey = 112;
  28. BaseUnknownPlugin = 113;
  29. // Reserved for governance, 200 ~ 299
  30. GovUnknownEntity = 201;
  31. GovUnknownGroup = 202;
  32. GovUnknownProposal = 203;
  33. GovDuplicateGroup = 204;
  34. GovDuplicateMember = 205;
  35. GovDuplicateProposal = 206;
  36. GovDuplicateVote = 207;
  37. GovInvalidMember = 208;
  38. GovInvalidVote = 209;
  39. GovInvalidVotingPower = 210;
  40. }
  41. //----------------------------------------
  42. // Request types
  43. message Request {
  44. oneof value{
  45. RequestEcho echo = 1;
  46. RequestFlush flush = 2;
  47. RequestInfo info = 3;
  48. RequestSetOption set_option = 4;
  49. RequestDeliverTx deliver_tx = 5;
  50. RequestCheckTx check_tx = 6;
  51. RequestCommit commit = 7;
  52. RequestQuery query = 8;
  53. RequestInitChain init_chain = 9;
  54. RequestBeginBlock begin_block = 10;
  55. RequestEndBlock end_block = 11;
  56. }
  57. }
  58. message RequestEcho {
  59. string message = 1;
  60. }
  61. message RequestFlush {
  62. }
  63. message RequestInfo {
  64. string version = 1;
  65. }
  66. message RequestSetOption{
  67. string key = 1;
  68. string value = 2;
  69. }
  70. message RequestDeliverTx{
  71. bytes tx = 1;
  72. }
  73. message RequestCheckTx{
  74. bytes tx = 1;
  75. }
  76. message RequestQuery{
  77. bytes data = 1;
  78. string path = 2;
  79. uint64 height = 3;
  80. bool prove = 4;
  81. }
  82. message RequestCommit{
  83. }
  84. message RequestInitChain{
  85. repeated Validator validators = 1;
  86. }
  87. message RequestBeginBlock{
  88. bytes hash = 1;
  89. Header header = 2;
  90. }
  91. message RequestEndBlock{
  92. uint64 height = 1;
  93. }
  94. //----------------------------------------
  95. // Response types
  96. message Response {
  97. oneof value{
  98. ResponseException exception = 1;
  99. ResponseEcho echo = 2;
  100. ResponseFlush flush = 3;
  101. ResponseInfo info = 4;
  102. ResponseSetOption set_option = 5;
  103. ResponseDeliverTx deliver_tx = 6;
  104. ResponseCheckTx check_tx = 7;
  105. ResponseCommit commit = 8;
  106. ResponseQuery query = 9;
  107. ResponseInitChain init_chain = 10;
  108. ResponseBeginBlock begin_block = 11;
  109. ResponseEndBlock end_block = 12;
  110. }
  111. }
  112. message ResponseException{
  113. string error = 1;
  114. }
  115. message ResponseEcho {
  116. string message = 1;
  117. }
  118. message ResponseFlush{
  119. }
  120. message ResponseInfo {
  121. string data = 1;
  122. string version = 2;
  123. uint64 last_block_height = 3;
  124. bytes last_block_app_hash = 4;
  125. }
  126. message ResponseSetOption{
  127. string log = 1;
  128. }
  129. message ResponseDeliverTx{
  130. CodeType code = 1;
  131. bytes data = 2;
  132. string log = 3;
  133. }
  134. message ResponseCheckTx{
  135. CodeType code = 1;
  136. bytes data = 2;
  137. string log = 3;
  138. }
  139. message ResponseQuery{
  140. CodeType code = 1;
  141. int64 index = 2;
  142. bytes key = 3;
  143. bytes value = 4;
  144. bytes proof = 5;
  145. uint64 height = 6;
  146. string log = 7;
  147. }
  148. message ResponseCommit{
  149. CodeType code = 1;
  150. bytes data = 2;
  151. string log = 3;
  152. }
  153. message ResponseInitChain{
  154. }
  155. message ResponseBeginBlock{
  156. }
  157. message ResponseEndBlock{
  158. repeated Validator diffs = 1;
  159. }
  160. //----------------------------------------
  161. // Blockchain Types
  162. message Header {
  163. string chain_id = 1;
  164. uint64 height = 2;
  165. uint64 time = 3;
  166. uint64 num_txs = 4;
  167. BlockID last_block_id = 5;
  168. bytes last_commit_hash = 6;
  169. bytes data_hash = 7;
  170. bytes validators_hash = 8;
  171. bytes app_hash = 9;
  172. }
  173. message BlockID {
  174. bytes hash = 1;
  175. PartSetHeader parts = 2;
  176. }
  177. message PartSetHeader {
  178. uint64 total = 1;
  179. bytes hash = 2;
  180. }
  181. message Validator {
  182. bytes pubKey = 1;
  183. uint64 power = 2;
  184. }
  185. //----------------------------------------
  186. // Service Definition
  187. service ABCIApplication {
  188. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  189. rpc Flush(RequestFlush) returns (ResponseFlush);
  190. rpc Info(RequestInfo) returns (ResponseInfo);
  191. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  192. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  193. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  194. rpc Query(RequestQuery) returns (ResponseQuery);
  195. rpc Commit(RequestCommit) returns (ResponseCommit);
  196. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  197. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  198. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  199. }