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.

241 lines
4.8 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. }
  65. message RequestSetOption{
  66. string key = 1;
  67. string value = 2;
  68. }
  69. message RequestDeliverTx{
  70. bytes tx = 1;
  71. }
  72. message RequestCheckTx{
  73. bytes tx = 1;
  74. }
  75. message RequestQuery{
  76. bytes data = 1;
  77. string path = 2;
  78. uint64 height = 3;
  79. bool prove = 4;
  80. }
  81. message RequestCommit{
  82. }
  83. message RequestInitChain{
  84. repeated Validator validators = 1;
  85. }
  86. message RequestBeginBlock{
  87. bytes hash = 1;
  88. Header header = 2;
  89. }
  90. message RequestEndBlock{
  91. uint64 height = 1;
  92. }
  93. //----------------------------------------
  94. // Response types
  95. message Response {
  96. oneof value{
  97. ResponseException exception = 1;
  98. ResponseEcho echo = 2;
  99. ResponseFlush flush = 3;
  100. ResponseInfo info = 4;
  101. ResponseSetOption set_option = 5;
  102. ResponseDeliverTx deliver_tx = 6;
  103. ResponseCheckTx check_tx = 7;
  104. ResponseCommit commit = 8;
  105. ResponseQuery query = 9;
  106. ResponseInitChain init_chain = 10;
  107. ResponseBeginBlock begin_block = 11;
  108. ResponseEndBlock end_block = 12;
  109. }
  110. }
  111. message ResponseException{
  112. string error = 1;
  113. }
  114. message ResponseEcho {
  115. string message = 1;
  116. }
  117. message ResponseFlush{
  118. }
  119. message ResponseInfo {
  120. string data = 1;
  121. string version = 2;
  122. uint64 last_block_height = 3;
  123. bytes last_block_app_hash = 4;
  124. }
  125. message ResponseSetOption{
  126. string log = 1;
  127. }
  128. message ResponseDeliverTx{
  129. CodeType code = 1;
  130. bytes data = 2;
  131. string log = 3;
  132. }
  133. message ResponseCheckTx{
  134. CodeType code = 1;
  135. bytes data = 2;
  136. string log = 3;
  137. }
  138. message ResponseQuery{
  139. CodeType code = 1;
  140. int64 index = 2;
  141. bytes key = 3;
  142. bytes value = 4;
  143. bytes proof = 5;
  144. uint64 height = 6;
  145. string log = 7;
  146. }
  147. message ResponseCommit{
  148. CodeType code = 1;
  149. bytes data = 2;
  150. string log = 3;
  151. }
  152. message ResponseInitChain{
  153. }
  154. message ResponseBeginBlock{
  155. }
  156. message ResponseEndBlock{
  157. repeated Validator diffs = 1;
  158. }
  159. //----------------------------------------
  160. // Blockchain Types
  161. message Header {
  162. string chain_id = 1;
  163. uint64 height = 2;
  164. uint64 time = 3;
  165. uint64 num_txs = 4;
  166. BlockID last_block_id = 5;
  167. bytes last_commit_hash = 6;
  168. bytes data_hash = 7;
  169. bytes validators_hash = 8;
  170. bytes app_hash = 9;
  171. }
  172. message BlockID {
  173. bytes hash = 1;
  174. PartSetHeader parts = 2;
  175. }
  176. message PartSetHeader {
  177. uint64 total = 1;
  178. bytes hash = 2;
  179. }
  180. message Validator {
  181. bytes pubKey = 1;
  182. uint64 power = 2;
  183. }
  184. //----------------------------------------
  185. // Service Definition
  186. service ABCIApplication {
  187. rpc Echo(RequestEcho) returns (ResponseEcho) ;
  188. rpc Flush(RequestFlush) returns (ResponseFlush);
  189. rpc Info(RequestInfo) returns (ResponseInfo);
  190. rpc SetOption(RequestSetOption) returns (ResponseSetOption);
  191. rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
  192. rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
  193. rpc Query(RequestQuery) returns (ResponseQuery);
  194. rpc Commit(RequestCommit) returns (ResponseCommit);
  195. rpc InitChain(RequestInitChain) returns (ResponseInitChain);
  196. rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
  197. rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
  198. }