tendermint/types/types.proto

258 lines
5.8 KiB
Protocol Buffer
Raw Normal View History

2016-01-30 19:36:33 -08:00
syntax = "proto3";
package types;
2017-12-20 17:32:32 -08:00
// For more information on gogo.proto, see:
// https://github.com/gogo/protobuf/blob/master/extensions.md
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
2017-01-12 12:47:55 -08:00
// This file is copied from http://github.com/tendermint/abci
2016-01-31 19:56:02 -08:00
2016-01-30 19:36:33 -08:00
//----------------------------------------
// Request types
message Request {
oneof value {
RequestEcho echo = 2;
RequestFlush flush = 3;
RequestInfo info = 4;
RequestSetOption set_option = 5;
RequestInitChain init_chain = 6;
RequestQuery query = 7;
RequestBeginBlock begin_block = 8;
RequestCheckTx check_tx = 9;
RequestDeliverTx deliver_tx = 19;
2017-11-09 13:56:24 -08:00
RequestEndBlock end_block = 11;
RequestCommit commit = 12;
2017-11-09 13:56:24 -08:00
}
2016-05-13 23:22:32 -07:00
}
message RequestEcho {
2017-11-09 13:56:24 -08:00
string message = 1;
2016-05-13 23:22:32 -07:00
}
message RequestFlush {
}
message RequestInfo {
2017-11-09 13:56:24 -08:00
string version = 1;
2016-05-13 23:22:32 -07:00
}
message RequestSetOption {
2017-11-09 13:56:24 -08:00
string key = 1;
string value = 2;
2016-05-13 23:22:32 -07:00
}
message RequestInitChain {
repeated Validator validators = 1 [(gogoproto.nullable) = false];
2016-05-13 23:22:32 -07:00
}
message RequestQuery {
2017-11-09 13:56:24 -08:00
bytes data = 1;
string path = 2;
2017-11-30 21:41:07 -08:00
int64 height = 3;
2017-11-09 13:56:24 -08:00
bool prove = 4;
2017-01-10 06:49:26 -08:00
}
message RequestBeginBlock {
2017-11-09 13:56:24 -08:00
bytes hash = 1;
Header header = 2 [(gogoproto.nullable) = false];
repeated int32 absent_validators = 3;
repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
2016-05-13 23:22:32 -07:00
}
message RequestCheckTx {
bytes tx = 1;
}
message RequestDeliverTx {
bytes tx = 1;
}
message RequestEndBlock {
2017-11-30 21:41:07 -08:00
int64 height = 1;
2016-01-30 19:36:33 -08:00
}
message RequestCommit {
}
2016-01-30 19:36:33 -08:00
//----------------------------------------
// Response types
message Response {
oneof value {
2017-11-09 13:56:24 -08:00
ResponseException exception = 1;
ResponseEcho echo = 2;
ResponseFlush flush = 3;
ResponseInfo info = 4;
ResponseSetOption set_option = 5;
ResponseInitChain init_chain = 6;
ResponseQuery query = 7;
ResponseBeginBlock begin_block = 8;
ResponseCheckTx check_tx = 9;
ResponseDeliverTx deliver_tx = 10;
ResponseEndBlock end_block = 11;
ResponseCommit commit = 12;
2017-11-09 13:56:24 -08:00
}
2016-05-13 23:22:32 -07:00
}
message ResponseException {
2017-11-09 13:56:24 -08:00
string error = 1;
2016-05-13 23:22:32 -07:00
}
message ResponseEcho {
2017-11-09 13:56:24 -08:00
string message = 1;
2016-05-13 23:22:32 -07:00
}
message ResponseFlush {
2016-05-13 23:22:32 -07:00
}
message ResponseInfo {
2017-11-09 13:56:24 -08:00
string data = 1;
string version = 2;
2017-11-30 21:41:07 -08:00
int64 last_block_height = 3;
2017-11-09 13:56:24 -08:00
bytes last_block_app_hash = 4;
2016-05-13 23:22:32 -07:00
}
message ResponseSetOption {
uint32 code = 1;
string log = 2;
2016-05-13 23:22:32 -07:00
}
message ResponseInitChain {
2016-05-13 23:22:32 -07:00
}
message ResponseQuery {
uint32 code = 1;
int64 index = 2;
bytes key = 3 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
bytes value = 4 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
bytes proof = 5 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
int64 height = 6;
string log = 7;
2016-05-13 23:22:32 -07:00
}
message ResponseBeginBlock {
2017-01-10 06:49:26 -08:00
}
message ResponseCheckTx {
uint32 code = 1;
bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
string log = 3;
int64 gas = 4;
KI64Pair fee = 5 [(gogoproto.nullable) = false];
2016-05-13 23:22:32 -07:00
}
message ResponseDeliverTx {
uint32 code = 1;
bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
string log = 3;
repeated KVPair tags = 4 [(gogoproto.nullable) = false];
2016-05-13 23:22:32 -07:00
}
message ResponseEndBlock {
repeated Validator validator_updates = 1 [(gogoproto.nullable) = false];
ConsensusParams consensus_param_updates = 2;
2016-05-13 23:22:32 -07:00
}
message ResponseCommit {
uint32 code = 1;
bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false];
string log = 3;
}
//----------------------------------------
// Misc.
// ConsensusParams contains all consensus-relevant parameters
// that can be adjusted by the abci app
message ConsensusParams {
BlockSize block_size = 1;
TxSize tx_size = 2;
BlockGossip block_gossip = 3;
}
// BlockSize contain limits on the block size.
message BlockSize {
int32 max_bytes = 1;
int32 max_txs = 2;
int64 max_gas = 3;
}
// TxSize contain limits on the tx size.
message TxSize {
int32 max_bytes = 1;
int64 max_gas = 2;
}
// BlockGossip determine consensus critical
// elements of how blocks are gossiped
2017-12-20 17:32:32 -08:00
message BlockGossip {
// Note: must not be 0
int32 block_part_size_bytes = 1;
2016-01-30 19:36:33 -08:00
}
2016-01-31 19:56:02 -08:00
//----------------------------------------
// Blockchain Types
message Header {
2017-12-20 17:32:32 -08:00
string chain_id = 1 [(gogoproto.customname) = "ChainID"];
2017-11-30 21:41:07 -08:00
int64 height = 2;
int64 time = 3;
int32 num_txs = 4;
BlockID last_block_id = 5 [(gogoproto.customname) = "LastBlockID", (gogoproto.nullable) = false];
2017-11-09 13:56:24 -08:00
bytes last_commit_hash = 6;
bytes data_hash = 7;
bytes validators_hash = 8;
bytes app_hash = 9;
2016-11-16 13:11:36 -08:00
}
message BlockID {
2017-11-09 13:56:24 -08:00
bytes hash = 1;
PartSetHeader parts = 2 [(gogoproto.nullable) = false];
}
message PartSetHeader {
int32 total = 1;
2017-11-09 13:56:24 -08:00
bytes hash = 2;
}
2016-02-28 18:53:24 -08:00
message Validator {
2017-11-30 21:41:07 -08:00
bytes pub_key = 1;
int64 power = 2;
2016-02-28 18:53:24 -08:00
}
2016-05-17 21:54:32 -07:00
message Evidence {
bytes pub_key = 1;
int64 height = 2;
}
//----------------------------------------
// Abstract types
message KVPair {
bytes key = 1;
bytes value = 2;
}
message KI64Pair {
bytes key = 1;
int64 value = 2;
}
2016-05-17 21:54:32 -07:00
//----------------------------------------
// Service Definition
2017-01-12 12:47:55 -08:00
service ABCIApplication {
2017-11-09 13:56:24 -08:00
rpc Echo(RequestEcho) returns (ResponseEcho) ;
rpc Flush(RequestFlush) returns (ResponseFlush);
rpc Info(RequestInfo) returns (ResponseInfo);
rpc SetOption(RequestSetOption) returns (ResponseSetOption);
rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
rpc Query(RequestQuery) returns (ResponseQuery);
rpc Commit(RequestCommit) returns (ResponseCommit);
rpc InitChain(RequestInitChain) returns (ResponseInitChain);
rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
2016-05-17 21:54:32 -07:00
}