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.

98 lines
2.5 KiB

  1. syntax = "proto3";
  2. package types;
  3. // This file is copied from http://github.com/tendermint/tmsp
  4. //----------------------------------------
  5. // Message types
  6. enum MessageType {
  7. NullMessage = 0x00;
  8. Echo = 0x01;
  9. Flush = 0x02;
  10. Info = 0x03;
  11. SetOption = 0x04;
  12. Exception = 0x05;
  13. AppendTx = 0x11;
  14. CheckTx = 0x12;
  15. Commit = 0x13;
  16. Query = 0x14;
  17. InitChain = 0x15;
  18. // BeginBlock = 0x16; NOT USED
  19. EndBlock = 0x17;
  20. }
  21. //----------------------------------------
  22. // Code types
  23. enum CodeType {
  24. OK = 0;
  25. // General response codes, 0 ~ 99
  26. InternalError = 1;
  27. EncodingError = 2;
  28. BadNonce = 3;
  29. Unauthorized = 4;
  30. InsufficientFunds = 5;
  31. UnknownRequest = 6;
  32. // Reserved for basecoin, 100 ~ 199
  33. BaseDuplicateAddress = 101;
  34. BaseEncodingError = 102;
  35. BaseInsufficientFees = 103;
  36. BaseInsufficientFunds = 104;
  37. BaseInsufficientGasPrice = 105;
  38. BaseInvalidAddress = 106;
  39. BaseInvalidAmount = 107;
  40. BaseInvalidPubKey = 108;
  41. BaseInvalidSequence = 109;
  42. BaseInvalidSignature = 110;
  43. BaseUnknownAddress = 111;
  44. BaseUnknownPubKey = 112;
  45. // Reserved for governance, 200 ~ 299
  46. GovUnknownEntity = 201;
  47. GovUnknownGroup = 202;
  48. GovUnknownProposal = 203;
  49. GovDuplicateGroup = 204;
  50. GovDuplicateMember = 205;
  51. GovDuplicateProposal = 206;
  52. GovDuplicateVote = 207;
  53. GovInvalidMember = 208;
  54. GovInvalidVote = 209;
  55. GovInvalidVotingPower = 210;
  56. }
  57. //----------------------------------------
  58. // Request types
  59. message Request {
  60. MessageType type = 1;
  61. bytes data = 2;
  62. string key = 3;
  63. string value = 4;
  64. repeated Validator validators = 5;
  65. uint64 height = 6;
  66. }
  67. //----------------------------------------
  68. // Response types
  69. message Response {
  70. MessageType type = 1;
  71. bytes data = 2;
  72. CodeType code = 3;
  73. string error = 4;
  74. string log = 5;
  75. repeated Validator validators = 6;
  76. }
  77. //----------------------------------------
  78. // Misc types
  79. message Validator {
  80. bytes pubKey = 1;
  81. uint64 power = 2;
  82. }