tendermint/types/types.proto

93 lines
2.3 KiB
Protocol Buffer
Raw Normal View History

2016-01-30 19:36:33 -08:00
syntax = "proto3";
package types;
2016-01-31 19:56:02 -08:00
// This file is copied from http://github.com/tendermint/tmsp
2016-01-30 19:36:33 -08:00
//----------------------------------------
// Message types
2016-01-31 19:56:02 -08:00
enum MessageType {
NullMessage = 0x00;
2016-02-28 18:53:24 -08:00
Echo = 0x01;
Flush = 0x02;
Info = 0x03;
SetOption = 0x04;
Exception = 0x05;
AppendTx = 0x11;
CheckTx = 0x12;
Commit = 0x13;
Query = 0x14;
InitChain = 0x15;
2016-03-06 17:57:47 -08:00
// BeginBlock = 0x16; NOT USED
EndBlock = 0x17;
2016-01-31 19:56:02 -08:00
}
2016-01-30 19:36:33 -08:00
//----------------------------------------
// Code types
enum CodeType {
OK = 0;
// General response codes, 0 ~ 99
InternalError = 1;
EncodingError = 2;
BadNonce = 3;
Unauthorized = 4;
InsufficientFunds = 5;
UnknownRequest = 6;
// Reserved for basecoin, 100 ~ 199
BaseEncodingError = 101;
BaseBadNonce = 102;
BaseUnknownAccount = 103;
BaseUnauthorized = 104;
BaseInsufficientFunds = 105;
BaseInsufficientFees = 106;
// Reserved for governance, 200 ~ 299
GovUnknownEntity = 201;
GovUnknownGroup = 202;
2016-03-15 11:36:05 -07:00
GovUnknownProposal = 203;
GovDuplicateGroup = 204;
GovDuplicateMember = 205;
GovDuplicateProposal = 206;
GovDuplicateVote = 207;
GovInvalidMember = 208;
GovInvalidVote = 209;
GovInvalidVotingPower = 210;
}
2016-01-30 19:36:33 -08:00
//----------------------------------------
// Request types
message Request {
2016-01-31 19:56:02 -08:00
MessageType type = 1;
2016-01-30 19:36:33 -08:00
bytes data = 2;
string key = 3;
string value = 4;
2016-02-28 18:53:24 -08:00
repeated Validator validators = 5;
uint64 height = 6;
2016-01-30 19:36:33 -08:00
}
//----------------------------------------
// Response types
message Response {
2016-01-31 19:56:02 -08:00
MessageType type = 1;
2016-01-30 19:36:33 -08:00
bytes data = 2;
CodeType code = 3;
2016-01-30 19:36:33 -08:00
string error = 4;
string log = 5;
2016-02-28 18:53:24 -08:00
repeated Validator validators = 6;
2016-01-30 19:36:33 -08:00
}
2016-01-31 19:56:02 -08:00
2016-02-28 18:53:24 -08:00
//----------------------------------------
// Misc types
message Validator {
bytes pubKey = 1;
uint64 power = 2;
}