Commit 820571b3 authored by madengji's avatar madengji

add clang format

parent cdf51d68
Language: 'Proto'
BasedOnStyle: 'LLVM'
AccessModifierOffset: '-1'
AlignAfterOpenBracket: 'Align'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlinesLeft: 'true'
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'true'
ColumnLimit: '200'
IndentWidth: '4'
ContinuationIndentWidth: '4'
TabWidth: '4'
TabWidth: '4'
ReflowComments: 'true'
SortIncludes: 'true'
AllowShortFunctionsOnASingleLine: 'Empty'
AllowShortIfStatementsOnASingleLine: 'true'
consensus/raft/tools/scripts/grpc33.log
consensus/raft/tools/scripts/logs/
*.orig
store/kvmvcc/1.png
store/kvmvcc/cpu.pprof
store/kvmvcc/kvmvcc.test
store/mpt/1.png
store/mpt/cpu.pprof
store/mpt/mpt.test
tool
.vscode
chain33
chain33-cli
tool
datadir*
*.log
*.exe
*.orig
*.bak
*.log.last
.idea
.vscode
build/chain33*
build/datadir
build/bityuan*
build/para
build/execblock
build/relayd
build/relayd.toml
build/*.log
build/fzm
build/guodun
build/main.sh
build/main*
build/para.sh
build/ci
build/tools/autotest/autotest
build/tools/autotest/*.toml
build/tools/autotest/chain33
build/tools/autotest/chain33-cli
.DS_Store
logs/
build/wallet
plugin/store/kvmvcc/1.png
plugin/store/kvmvcc/cpu.pprof
plugin/store/kvmvcc/kvmvcc.test
plugin/store/mpt/1.png
plugin/store/mpt/cpu.pprof
plugin/store/mpt/mpt.test
plugin/consensus/raft/tools/scripts/grpc33.log
plugin/consensus/raft/tools/scripts/logs/
......@@ -221,7 +221,6 @@ auto_ci: clean fmt_proto fmt_shell protobuf
${auto_fmt}
git add *.go *.sh *.proto
git status
echo "branch"
echo $(branch)
files=$$(git status -suno); if [ -n "$$files" ]; then \
git add *.go *.sh *.proto; \
......
......@@ -5,186 +5,196 @@ import "transaction.proto";
package types;
message AddressResult {
string addr = 1;
int64 amount = 2;
repeated bytes hashValues = 3;
string showSecret = 4;
string addr = 1;
int64 amount = 2;
repeated bytes hashValues = 3;
string showSecret = 4;
}
// order
message BlackwhiteRound {
// txhash
string gameID = 1;
// create -> play(timeout) -> show -> done
int32 status = 2;
// 游戏押金可大于
int64 playAmount = 3;
// 游戏人数
int32 playerCount = 4;
// 当前游戏人数
int32 curPlayerCount = 5;
// 游戏需要比对次数
int32 loop = 6;
// 当前出示密钥人数
int32 curShowCount = 7;
// 创建游戏时间
int64 createTime = 8;
// 出示密钥开始时间
int64 showTime = 9;
// 超时时间
int64 timeout = 10;
// 创建游戏地址
string createAddr = 11;
// 游戏名称
string gameName = 12;
// 游戏加密结果
repeated AddressResult addrResult = 13;
// 游戏赢家
repeated string winner = 14;
// block高度以及索引值
int64 index = 15;
// txhash
string gameID = 1;
// create -> play(timeout) -> show -> done
int32 status = 2;
// 游戏押金可大于
int64 playAmount = 3;
// 游戏人数
int32 playerCount = 4;
// 当前游戏人数
int32 curPlayerCount = 5;
// 游戏需要比对次数
int32 loop = 6;
// 当前出示密钥人数
int32 curShowCount = 7;
// 创建游戏时间
int64 createTime = 8;
// 出示密钥开始时间
int64 showTime = 9;
// 超时时间
int64 timeout = 10;
// 创建游戏地址
string createAddr = 11;
// 游戏名称
string gameName = 12;
// 游戏加密结果
repeated AddressResult addrResult = 13;
// 游戏赢家
repeated string winner = 14;
// block高度以及索引值
int64 index = 15;
}
// actions
message BlackwhiteAction {
oneof value {
BlackwhiteCreate create = 1;
BlackwhitePlay play = 2;
BlackwhiteShow show = 3;
BlackwhiteTimeoutDone timeoutDone = 4;
}
int32 ty = 6;
oneof value {
BlackwhiteCreate create = 1;
BlackwhitePlay play = 2;
BlackwhiteShow show = 3;
BlackwhiteTimeoutDone timeoutDone = 4;
}
int32 ty = 6;
}
message BlackwhiteCreate {
int64 playAmount = 1;
int32 playerCount = 2;
int64 timeout = 3;
string gameName = 4;
int64 playAmount = 1;
int32 playerCount = 2;
int64 timeout = 3;
string gameName = 4;
}
message BlackwhitePlay {
string gameID = 1;
int64 amount = 2;
repeated bytes hashValues = 3;
string gameID = 1;
int64 amount = 2;
repeated bytes hashValues = 3;
}
message BlackwhiteShow {
string gameID = 1;
string secret = 2;
string gameID = 1;
string secret = 2;
}
message BlackwhiteTimeoutDone { string gameID = 1; }
message BlackwhiteTimeoutDone {
string gameID = 1;
}
// logs
message ReceiptBlackwhite { BlackwhiteRound round = 1; }
message ReceiptBlackwhite {
BlackwhiteRound round = 1;
}
message ReceiptBlackwhiteStatus {
string gameID = 1;
int32 status = 2;
//记录上一次状态
int32 prevStatus = 3;
string addr = 4;
int64 index = 5;
string gameID = 1;
int32 status = 2;
//记录上一次状态
int32 prevStatus = 3;
string addr = 4;
int64 index = 5;
}
message ReqBlackwhiteRoundInfo { string gameID = 1; }
message ReqBlackwhiteRoundInfo {
string gameID = 1;
}
message ReplyBlackwhiteRoundInfo { BlackwhiteRoundResult round = 1; }
message ReplyBlackwhiteRoundInfo {
BlackwhiteRoundResult round = 1;
}
message ReqBlackwhiteRoundList {
//优先根据status查询,status不可为空
int32 status = 1;
//二级搜索,如果要查询一个地址下的所有game信息,可以根据status,分多次查询,这样规避存储数据时的臃余情况
string address = 2;
int32 count = 3;
int32 direction = 4;
int64 index = 5;
//优先根据status查询,status不可为空
int32 status = 1;
//二级搜索,如果要查询一个地址下的所有game信息,可以根据status,分多次查询,这样规避存储数据时的臃余情况
string address = 2;
int32 count = 3;
int32 direction = 4;
int64 index = 5;
}
message ReplyBlackwhiteRoundList { repeated BlackwhiteRoundResult round = 1; }
message ReplyBlackwhiteRoundList {
repeated BlackwhiteRoundResult round = 1;
}
message ReqLoopResult {
string gameID = 1;
int32 loopSeq = 2;
string gameID = 1;
int32 loopSeq = 2;
}
message perLoopResult {
repeated string winers = 1;
repeated string losers = 2;
repeated string winers = 1;
repeated string losers = 2;
}
message ReplyLoopResults {
string gameID = 1;
repeated perLoopResult results = 2;
string gameID = 1;
repeated perLoopResult results = 2;
}
message BlackwhiteRoundResult {
// txhash
string gameID = 1;
// create -> play(timeout) -> show -> done
int32 status = 2;
// 游戏押金可大于
int64 playAmount = 3;
// 游戏人数
int32 playerCount = 4;
// 当前游戏人数
int32 curPlayerCount = 5;
// 游戏需要比对次数
int32 loop = 6;
// 当前出示密钥人数
int32 curShowCount = 7;
// 创建游戏时间
int64 createTime = 8;
// 出示密钥开始时间
int64 showTime = 9;
// 超时时间
int64 timeout = 10;
// 创建游戏地址
string createAddr = 11;
// 游戏名称
string gameName = 12;
// 游戏加密结果
repeated AddressResult addrResult = 13;
// 游戏赢家
repeated string winner = 14;
// block高度以及索引值
int64 index = 15;
// txhash
string gameID = 1;
// create -> play(timeout) -> show -> done
int32 status = 2;
// 游戏押金可大于
int64 playAmount = 3;
// 游戏人数
int32 playerCount = 4;
// 当前游戏人数
int32 curPlayerCount = 5;
// 游戏需要比对次数
int32 loop = 6;
// 当前出示密钥人数
int32 curShowCount = 7;
// 创建游戏时间
int64 createTime = 8;
// 出示密钥开始时间
int64 showTime = 9;
// 超时时间
int64 timeout = 10;
// 创建游戏地址
string createAddr = 11;
// 游戏名称
string gameName = 12;
// 游戏加密结果
repeated AddressResult addrResult = 13;
// 游戏赢家
repeated string winner = 14;
// block高度以及索引值
int64 index = 15;
}
message BlackwhiteCreateTxReq {
int64 PlayAmount = 1;
int32 PlayerCount = 2;
int64 Timeout = 3;
string GameName = 4;
int64 Fee = 5;
int64 PlayAmount = 1;
int32 PlayerCount = 2;
int64 Timeout = 3;
string GameName = 4;
int64 Fee = 5;
}
message BlackwhitePlayTxReq {
string GameID = 1;
int64 Amount = 2;
repeated bytes HashValues = 3;
int64 Fee = 4;
string GameID = 1;
int64 Amount = 2;
repeated bytes HashValues = 3;
int64 Fee = 4;
}
message BlackwhiteShowTxReq {
string GameID = 1;
string Secret = 2;
int64 Fee = 3;
string GameID = 1;
string Secret = 2;
int64 Fee = 3;
}
message BlackwhiteTimeoutDoneTxReq {
string GameID = 1;
int64 Fee = 2;
string GameID = 1;
int64 Fee = 2;
}
service blackwhite {
// blackwhite 对外提供服务的接口
//区块链接口
rpc Create(BlackwhiteCreate) returns (UnsignTx) {}
//获取最新的区块头
rpc Show(BlackwhiteShow) returns (UnsignTx) {}
//交易接口
rpc Play(BlackwhitePlay) returns (UnsignTx) {}
rpc TimeoutDone(BlackwhiteTimeoutDone) returns (UnsignTx) {}
// blackwhite 对外提供服务的接口
//区块链接口
rpc Create(BlackwhiteCreate) returns (UnsignTx) {}
//获取最新的区块头
rpc Show(BlackwhiteShow) returns (UnsignTx) {}
//交易接口
rpc Play(BlackwhitePlay) returns (UnsignTx) {}
rpc TimeoutDone(BlackwhiteTimeoutDone) returns (UnsignTx) {}
}
\ No newline at end of file
......@@ -3,38 +3,38 @@ syntax = "proto3";
package types;
message Cert {
bytes certId = 1;
int64 createTime = 2;
string key = 3;
bytes value = 4;
bytes certId = 1;
int64 createTime = 2;
string key = 3;
bytes value = 4;
}
message CertAction {
oneof value {
CertNew new = 1;
CertUpdate update = 2;
CertNormal normal = 3;
}
int32 ty = 4;
oneof value {
CertNew new = 1;
CertUpdate update = 2;
CertNormal normal = 3;
}
int32 ty = 4;
}
message CertNew {
string key = 1;
bytes value = 2;
string key = 1;
bytes value = 2;
}
message CertUpdate {
string key = 1;
bytes value = 2;
string key = 1;
bytes value = 2;
}
message CertNormal {
string key = 1;
bytes value = 2;
string key = 1;
bytes value = 2;
}
message Authority {
bool enable = 1;
string cryptoPath = 2;
string signType = 3;
bool enable = 1;
string cryptoPath = 2;
string signType = 3;
}
\ No newline at end of file
......@@ -4,110 +4,116 @@ package types;
//合约对象信息
message EVMContractObject {
string addr = 1;
EVMContractData data = 2;
EVMContractState state = 3;
string addr = 1;
EVMContractData data = 2;
EVMContractState state = 3;
}
// 存放合约固定数据
message EVMContractData {
string creator = 1;
string name = 2;
string alias = 3;
string addr = 4;
bytes code = 5;
bytes codeHash = 6;
string creator = 1;
string name = 2;
string alias = 3;
string addr = 4;
bytes code = 5;
bytes codeHash = 6;
}
// 存放合约变化数据
message EVMContractState {
uint64 nonce = 1;
bool suicided = 2;
bytes storageHash = 3;
map<string, bytes> storage = 4;
uint64 nonce = 1;
bool suicided = 2;
bytes storageHash = 3;
map<string, bytes> storage = 4;
}
// 创建/调用合约的请求结构
message EVMContractAction {
// 转账金额
uint64 amount = 1;
// 消耗限制,默认为Transaction.Fee
uint64 gasLimit = 2;
// gas价格,默认为1
uint32 gasPrice = 3;
// 合约数据
bytes code = 4;
// 合约别名,方便识别
string alias = 5;
// 交易备注
string note = 6;
// 转账金额
uint64 amount = 1;
// 消耗限制,默认为Transaction.Fee
uint64 gasLimit = 2;
// gas价格,默认为1
uint32 gasPrice = 3;
// 合约数据
bytes code = 4;
// 合约别名,方便识别
string alias = 5;
// 交易备注
string note = 6;
}
// 合约创建/调用日志
message ReceiptEVMContract {
string caller = 1;
string contractName = 2;
string contractAddr = 3;
uint64 usedGas = 4;
// 创建合约返回的代码
bytes ret = 5;
string caller = 1;
string contractName = 2;
string contractAddr = 3;
uint64 usedGas = 4;
// 创建合约返回的代码
bytes ret = 5;
}
// 用于保存EVM只能合约中的状态数据变更
message EVMStateChangeItem {
string key = 1;
bytes preValue = 2;
bytes currentValue = 3;
string key = 1;
bytes preValue = 2;
bytes currentValue = 3;
}
// 存放合约固定数据
message EVMContractDataCmd {
string creator = 1;
string name = 2;
string alias = 3;
string addr = 4;
string code = 5;
string codeHash = 6;
string creator = 1;
string name = 2;
string alias = 3;
string addr = 4;
string code = 5;
string codeHash = 6;
}
// 存放合约变化数据
message EVMContractStateCmd {
uint64 nonce = 1;
bool suicided = 2;
string storageHash = 3;
map<string, string> storage = 4;
uint64 nonce = 1;
bool suicided = 2;
string storageHash = 3;
map<string, string> storage = 4;
}
// 合约创建/调用日志
message ReceiptEVMContractCmd {
string caller = 1;
// 合约创建时才会返回此内容
string contractName = 2;
string contractAddr = 3;
uint64 usedGas = 4;
// 创建合约返回的代码
string ret = 5;
string caller = 1;
// 合约创建时才会返回此内容
string contractName = 2;
string contractAddr = 3;
uint64 usedGas = 4;
// 创建合约返回的代码
string ret = 5;
}
message CheckEVMAddrReq { string addr = 1; }
message CheckEVMAddrReq {
string addr = 1;
}
message CheckEVMAddrResp {
bool contract = 1;
string contractAddr = 2;
string contractName = 3;
string aliasName = 4;
bool contract = 1;
string contractAddr = 2;
string contractName = 3;
string aliasName = 4;
}
message EstimateEVMGasReq {
string to = 1;
bytes code = 2;
string caller = 3;
uint64 amount = 4;
string to = 1;
bytes code = 2;
string caller = 3;
uint64 amount = 4;
}
message EstimateEVMGasResp {
uint64 gas = 1;
}
message EstimateEVMGasResp { uint64 gas = 1; }
message EvmDebugReq {
// 0 query, 1 set, -1 clear
int32 optype = 1;
// 0 query, 1 set, -1 clear
int32 optype = 1;
}
message EvmDebugResp { string debugStatus = 1; }
\ No newline at end of file
message EvmDebugResp {
string debugStatus = 1;
}
\ No newline at end of file
......@@ -3,121 +3,133 @@ syntax = "proto3";
package types;
message Game {
//默认是由创建这局游戏的txHash作为gameId
string gameId = 1;
// create 1 -> Match 2 -> Cancel 3 -> Close 4
int32 status = 2;
//创建时间
int64 createTime = 3;
//匹配时间(何时参与对赌)
int64 matchTime = 4;
//状态close的时间(包括cancel)
int64 closetime = 5;
//赌注
int64 value = 6;
//发起者账号地址
string createAddress = 7;
//对赌者账号地址
string matchAddress = 8;
// hash 类型,预留字段
string hashType = 9;
//庄家创建游戏时,庄家自己出拳结果加密后的hash值
bytes hashValue = 10;
//用来公布庄家出拳结果的私钥
string secret = 11;
// 1 平局,2 庄家获胜,3 matcher获胜,4
// 庄家开奖超时,matcher获胜,并获得本局所有赌资
int32 result = 12;
// matcher 出拳结果
int32 matcherGuess = 13;
// create txHash
string createTxHash = 14;
// matche交易hash
string matchTxHash = 15;
// close txhash
string closeTxHash = 16;
// cancel txhash
string cancelTxHash = 17;
int64 index = 18;
int64 prevIndex = 19;
int32 creatorGuess = 20;
//默认是由创建这局游戏的txHash作为gameId
string gameId = 1;
// create 1 -> Match 2 -> Cancel 3 -> Close 4
int32 status = 2;
//创建时间
int64 createTime = 3;
//匹配时间(何时参与对赌)
int64 matchTime = 4;
//状态close的时间(包括cancel)
int64 closetime = 5;
//赌注
int64 value = 6;
//发起者账号地址
string createAddress = 7;
//对赌者账号地址
string matchAddress = 8;
// hash 类型,预留字段
string hashType = 9;
//庄家创建游戏时,庄家自己出拳结果加密后的hash值
bytes hashValue = 10;
//用来公布庄家出拳结果的私钥
string secret = 11;
// 1 平局,2 庄家获胜,3 matcher获胜,4
// 庄家开奖超时,matcher获胜,并获得本局所有赌资
int32 result = 12;
// matcher 出拳结果
int32 matcherGuess = 13;
// create txHash
string createTxHash = 14;
// matche交易hash
string matchTxHash = 15;
// close txhash
string closeTxHash = 16;
// cancel txhash
string cancelTxHash = 17;
int64 index = 18;
int64 prevIndex = 19;
int32 creatorGuess = 20;
}
// message for execs.game
message GameAction {
oneof value {
GameCreate create = 1;
GameCancel cancel = 2;
GameClose close = 3;
GameMatch match = 4;
}
int32 ty = 10;
oneof value {
GameCreate create = 1;
GameCancel cancel = 2;
GameClose close = 3;
GameMatch match = 4;
}
int32 ty = 10;
}
message GameMatch {
string gameId = 1;
int32 guess = 2;
string gameId = 1;
int32 guess = 2;
}
message GameCancel { string gameId = 1; }
message GameCancel {
string gameId = 1;
}
message GameClose {
string gameId = 1;
string secret = 2;
string gameId = 1;
string secret = 2;
}
message GameCreate {
int64 value = 1;
//加密用的算法
string hashType = 2;
//加密后的值
bytes hashValue = 3;
int64 value = 1;
//加密用的算法
string hashType = 2;
//加密后的值
bytes hashValue = 3;
}
// queryByAddr 和 queryByStatus共用同一个结构体
message QueryGameListByStatusAndAddr {
//优先根据status查询,status不可为空
int32 status = 1;
//二级搜索,如果要查询一个地址下的所有game信息,可以根据status,分多次查询,这样规避存储数据时的臃余情况
string address = 2;
// 索引值
int64 index = 3;
//单页返回多少条记录,默认返回20条,单次最多返回100条
int32 count = 4;
// 0降序,1升序,默认降序
int32 direction = 5;
//优先根据status查询,status不可为空
int32 status = 1;
//二级搜索,如果要查询一个地址下的所有game信息,可以根据status,分多次查询,这样规避存储数据时的臃余情况
string address = 2;
// 索引值
int64 index = 3;
//单页返回多少条记录,默认返回20条,单次最多返回100条
int32 count = 4;
// 0降序,1升序,默认降序
int32 direction = 5;
}
// 统计数量
message QueryGameListCount {
//优先根据status查询,status不可为空
int32 status = 1;
//二级搜索,如果要查询一个地址下的所有game信息,可以根据status,分多次查询,这样规避存储数据时的臃余情况
string address = 2;
//优先根据status查询,status不可为空
int32 status = 1;
//二级搜索,如果要查询一个地址下的所有game信息,可以根据status,分多次查询,这样规避存储数据时的臃余情况
string address = 2;
}
// 索引value值
message GameRecord {
string gameId = 1;
int64 index = 2;
string gameId = 1;
int64 index = 2;
}
message QueryGameInfo { string gameId = 1; }
message QueryGameInfo {
string gameId = 1;
}
message QueryGameInfos { repeated string gameIds = 1; }
message QueryGameInfos {
repeated string gameIds = 1;
}
message ReplyGameList { repeated Game games = 1; }
message ReplyGameList {
repeated Game games = 1;
}
message ReplyGameListCount { int64 count = 1; }
message ReplyGameListCount {
int64 count = 1;
}
message ReplyGame { Game game = 1; }
message ReplyGame {
Game game = 1;
}
message ReceiptGame {
string gameId = 1;
int32 status = 2;
//记录上一次状态
int32 prevStatus = 3;
string addr = 4;
string createAddr = 5;
string matchAddr = 6;
int64 index = 7;
int64 prevIndex = 8;
string gameId = 1;
int32 status = 2;
//记录上一次状态
int32 prevStatus = 3;
string addr = 4;
string createAddr = 5;
string matchAddr = 6;
int64 index = 7;
int64 prevIndex = 8;
}
......@@ -2,52 +2,52 @@ syntax = "proto3";
package types;
message Hashlock {
bytes hashlockId = 1;
int32 status = 2;
int64 CreateTime = 3;
string toAddress = 4;
string returnAddress = 5;
int64 amount = 6;
int64 frozentime = 7;
bytes hashlockId = 1;
int32 status = 2;
int64 CreateTime = 3;
string toAddress = 4;
string returnAddress = 5;
int64 amount = 6;
int64 frozentime = 7;
}
message HashlockLock {
int64 amount = 1;
int64 time = 2;
bytes hash = 3;
string toAddress = 4;
string returnAddress = 5;
int64 amount = 1;
int64 time = 2;
bytes hash = 3;
string toAddress = 4;
string returnAddress = 5;
}
message HashlockSend {
bytes secret = 1;
// bytes hash = 3;
bytes secret = 1;
// bytes hash = 3;
}
message Hashlockquery {
int64 time = 1;
int32 status = 2;
int64 amount = 3;
int64 createTime = 4;
int64 currentTime = 5;
int64 time = 1;
int32 status = 2;
int64 amount = 3;
int64 createTime = 4;
int64 currentTime = 5;
}
message HashRecv {
bytes HashlockId = 1;
Hashlockquery Infomation = 2;
bytes HashlockId = 1;
Hashlockquery Infomation = 2;
}
message HashlockUnlock {
bytes secret = 1;
// bytes hash = 3;
bytes secret = 1;
// bytes hash = 3;
}
// message for hashlock
message HashlockAction {
oneof value {
HashlockLock hlock = 1;
HashlockSend hsend = 2;
HashlockUnlock hunlock = 3;
}
int32 ty = 4;
oneof value {
HashlockLock hlock = 1;
HashlockSend hsend = 2;
HashlockUnlock hunlock = 3;
}
int32 ty = 4;
}
\ No newline at end of file
......@@ -3,172 +3,194 @@ syntax = "proto3";
package types;
message PurchaseRecord {
int64 amount = 1;
int64 number = 2;
int64 index = 3;
int64 way = 4;
int64 amount = 1;
int64 number = 2;
int64 index = 3;
int64 way = 4;
}
message PurchaseRecords {
repeated PurchaseRecord record = 1;
int64 fundWin = 2;
int64 amountOneRound = 3;
repeated PurchaseRecord record = 1;
int64 fundWin = 2;
int64 amountOneRound = 3;
}
message Lottery {
string lotteryId = 1;
int32 status = 2;
int64 createHeight = 3;
int64 fund = 4;
int64 purBlockNum = 5;
int64 drawBlockNum = 6;
int64 lastTransToPurState = 7;
int64 lastTransToDrawState = 8;
map<string, PurchaseRecords> records = 9;
int64 totalPurchasedTxNum = 10;
string createAddr = 11;
int64 round = 12;
int64 luckyNumber = 13;
int64 createOnMain = 14;
int64 lastTransToPurStateOnMain = 15;
int64 lastTransToDrawStateOnMain = 16;
repeated MissingRecord missingRecords = 17;
}
message MissingRecord { repeated int32 times = 1; }
string lotteryId = 1;
int32 status = 2;
int64 createHeight = 3;
int64 fund = 4;
int64 purBlockNum = 5;
int64 drawBlockNum = 6;
int64 lastTransToPurState = 7;
int64 lastTransToDrawState = 8;
map<string, PurchaseRecords> records = 9;
int64 totalPurchasedTxNum = 10;
string createAddr = 11;
int64 round = 12;
int64 luckyNumber = 13;
int64 createOnMain = 14;
int64 lastTransToPurStateOnMain = 15;
int64 lastTransToDrawStateOnMain = 16;
repeated MissingRecord missingRecords = 17;
}
message MissingRecord {
repeated int32 times = 1;
}
message LotteryAction {
oneof value {
LotteryCreate create = 1;
LotteryBuy buy = 2;
LotteryDraw draw = 3;
LotteryClose close = 4;
}
int32 ty = 10;
oneof value {
LotteryCreate create = 1;
LotteryBuy buy = 2;
LotteryDraw draw = 3;
LotteryClose close = 4;
}
int32 ty = 10;
}
message LotteryCreate {
int64 purBlockNum = 1;
int64 drawBlockNum = 2;
int64 purBlockNum = 1;
int64 drawBlockNum = 2;
}
message LotteryBuy {
string lotteryId = 1;
int64 amount = 2;
int64 number = 3;
int64 way = 4;
string lotteryId = 1;
int64 amount = 2;
int64 number = 3;
int64 way = 4;
}
message LotteryDraw { string lotteryId = 1; }
message LotteryDraw {
string lotteryId = 1;
}
message LotteryClose { string lotteryId = 1; }
message LotteryClose {
string lotteryId = 1;
}
message ReceiptLottery {
string lotteryId = 1;
int32 status = 2;
int32 prevStatus = 3;
string addr = 4;
int64 round = 5;
int64 number = 6;
int64 amount = 7;
int64 luckyNumber = 8;
int64 time = 9;
string txHash = 10;
LotteryUpdateBuyInfo updateInfo = 11;
int64 way = 12;
int64 index = 13;
}
message ReqLotteryInfo { string lotteryId = 1; }
string lotteryId = 1;
int32 status = 2;
int32 prevStatus = 3;
string addr = 4;
int64 round = 5;
int64 number = 6;
int64 amount = 7;
int64 luckyNumber = 8;
int64 time = 9;
string txHash = 10;
LotteryUpdateBuyInfo updateInfo = 11;
int64 way = 12;
int64 index = 13;
}
message ReqLotteryInfo {
string lotteryId = 1;
}
message ReqLotteryBuyInfo {
string lotteryId = 1;
string addr = 2;
int64 round = 3;
string lotteryId = 1;
string addr = 2;
int64 round = 3;
}
message ReqLotteryBuyHistory {
string lotteryId = 1;
string addr = 2;
int64 round = 3;
int32 count = 4;
int32 direction = 5;
int64 index = 6;
string lotteryId = 1;
string addr = 2;
int64 round = 3;
int32 count = 4;
int32 direction = 5;
int64 index = 6;
}
message ReqLotteryLuckyInfo {
string lotteryId = 1;
repeated int64 round = 2;
string lotteryId = 1;
repeated int64 round = 2;
}
message ReqLotteryLuckyHistory {
string lotteryId = 1;
int64 round = 2;
int32 count = 3;
int32 direction = 4;
string lotteryId = 1;
int64 round = 2;
int32 count = 3;
int32 direction = 4;
}
message ReplyLotteryNormalInfo {
int64 createHeight = 1;
int64 purBlockNum = 2;
int64 drawBlockNum = 3;
string createAddr = 4;
int64 createHeight = 1;
int64 purBlockNum = 2;
int64 drawBlockNum = 3;
string createAddr = 4;
}
message ReplyLotteryCurrentInfo {
int32 status = 1;
int64 fund = 2;
int64 lastTransToPurState = 3;
int64 lastTransToDrawState = 4;
int64 totalPurchasedTxNum = 5;
int64 round = 6;
int64 luckyNumber = 7;
int64 lastTransToPurStateOnMain = 8;
int64 lastTransToDrawStateOnMain = 9;
int64 purBlockNum = 10;
int64 drawBlockNum = 11;
repeated MissingRecord missingRecords = 12;
int32 status = 1;
int64 fund = 2;
int64 lastTransToPurState = 3;
int64 lastTransToDrawState = 4;
int64 totalPurchasedTxNum = 5;
int64 round = 6;
int64 luckyNumber = 7;
int64 lastTransToPurStateOnMain = 8;
int64 lastTransToDrawStateOnMain = 9;
int64 purBlockNum = 10;
int64 drawBlockNum = 11;
repeated MissingRecord missingRecords = 12;
}
message ReplyLotteryHistoryLuckyNumber { repeated int64 luckyNumber = 1; }
message ReplyLotteryHistoryLuckyNumber {
repeated int64 luckyNumber = 1;
}
message ReplyLotteryShowInfo { repeated LotteryBuyRecord records = 1; }
message ReplyLotteryShowInfo {
repeated LotteryBuyRecord records = 1;
}
message LotteryNumberRecord {
int64 number = 1;
int64 amount = 2;
int64 number = 1;
int64 amount = 2;
}
// used for execlocal
message LotteryBuyRecord {
int64 number = 1;
int64 amount = 2;
int64 round = 3;
int64 type = 4;
int64 way = 5;
int64 index = 6;
int64 time = 7;
string txHash = 8;
int64 number = 1;
int64 amount = 2;
int64 round = 3;
int64 type = 4;
int64 way = 5;
int64 index = 6;
int64 time = 7;
string txHash = 8;
}
message LotteryBuyRecords { repeated LotteryBuyRecord records = 1; }
message LotteryBuyRecords {
repeated LotteryBuyRecord records = 1;
}
message LotteryDrawRecord {
int64 number = 1;
int64 round = 2;
int64 time = 3;
string txHash = 4;
int64 number = 1;
int64 round = 2;
int64 time = 3;
string txHash = 4;
}
message LotteryDrawRecords { repeated LotteryDrawRecord records = 1; }
message LotteryDrawRecords {
repeated LotteryDrawRecord records = 1;
}
message LotteryUpdateRec {
int64 index = 1;
int64 type = 2;
int64 index = 1;
int64 type = 2;
}
message LotteryUpdateRecs { repeated LotteryUpdateRec records = 1; }
message LotteryUpdateRecs {
repeated LotteryUpdateRec records = 1;
}
message LotteryUpdateBuyInfo { map<string, LotteryUpdateRecs> buyInfo = 1; }
message LotteryUpdateBuyInfo {
map<string, LotteryUpdateRecs> buyInfo = 1;
}
message ReplyLotteryPurchaseAddr { repeated string address = 1; }
message ReplyLotteryPurchaseAddr {
repeated string address = 1;
}
......@@ -2,20 +2,24 @@ syntax = "proto3";
package types;
message Norm {
bytes normId = 1;
int64 createTime = 2;
string key = 3;
bytes value = 4;
bytes normId = 1;
int64 createTime = 2;
string key = 3;
bytes value = 4;
}
message NormAction {
oneof value { NormPut nput = 1; }
int32 ty = 5;
oneof value {
NormPut nput = 1;
}
int32 ty = 5;
}
message NormPut {
string key = 1;
bytes value = 2;
string key = 1;
bytes value = 2;
}
message NormGetKey { string key = 1; }
\ No newline at end of file
message NormGetKey {
string key = 1;
}
\ No newline at end of file
......@@ -7,117 +7,127 @@ package types;
// stateDB
message ParacrossStatusDetails {
repeated string addrs = 1;
repeated bytes blockHash = 2;
repeated string addrs = 1;
repeated bytes blockHash = 2;
}
message ParacrossHeightStatus {
// ing, done
int32 status = 1;
string title = 2;
int64 height = 3;
ParacrossStatusDetails details = 4;
// ing, done
int32 status = 1;
string title = 2;
int64 height = 3;
ParacrossStatusDetails details = 4;
}
message ParacrossStatus {
string title = 1;
int64 height = 2;
bytes blockHash = 3;
string title = 1;
int64 height = 2;
bytes blockHash = 3;
}
// action
message ParacrossNodeStatus {
bytes mainBlockHash = 1;
int64 mainBlockHeight = 2;
string title = 3;
int64 height = 4;
bytes preBlockHash = 5;
bytes blockHash = 6;
bytes preStateHash = 7;
bytes stateHash = 8;
uint32 txCounts = 9;
bytes txResult = 10;
repeated bytes txHashs = 11;
bytes crossTxResult = 12;
repeated bytes crossTxHashs = 13;
bytes mainBlockHash = 1;
int64 mainBlockHeight = 2;
string title = 3;
int64 height = 4;
bytes preBlockHash = 5;
bytes blockHash = 6;
bytes preStateHash = 7;
bytes stateHash = 8;
uint32 txCounts = 9;
bytes txResult = 10;
repeated bytes txHashs = 11;
bytes crossTxResult = 12;
repeated bytes crossTxHashs = 13;
}
message ParacrossCommitAction { ParacrossNodeStatus status = 1; }
message ParacrossCommitAction {
ParacrossNodeStatus status = 1;
}
message ParacrossMinerAction { ParacrossNodeStatus status = 1; }
message ParacrossMinerAction {
ParacrossNodeStatus status = 1;
}
message ParacrossAction {
oneof value {
ParacrossCommitAction commit = 1;
ParacrossMinerAction miner = 3;
AssetsTransfer assetTransfer = 4;
AssetsWithdraw assetWithdraw = 5;
AssetsTransfer transfer = 6;
AssetsWithdraw withdraw = 7;
AssetsTransferToExec transferToExec = 8;
}
int32 ty = 2;
oneof value {
ParacrossCommitAction commit = 1;
ParacrossMinerAction miner = 3;
AssetsTransfer assetTransfer = 4;
AssetsWithdraw assetWithdraw = 5;
AssetsTransfer transfer = 6;
AssetsWithdraw withdraw = 7;
AssetsTransferToExec transferToExec = 8;
}
int32 ty = 2;
}
// logs
message ReceiptParacrossCommit {
string addr = 1;
ParacrossNodeStatus status = 2;
ParacrossHeightStatus prev = 3;
ParacrossHeightStatus current = 4;
string addr = 1;
ParacrossNodeStatus status = 2;
ParacrossHeightStatus prev = 3;
ParacrossHeightStatus current = 4;
}
message ReceiptParacrossMiner { ParacrossNodeStatus status = 1; }
message ReceiptParacrossMiner {
ParacrossNodeStatus status = 1;
}
message ReceiptParacrossDone {
int32 totalNodes = 1;
int32 totalCommit = 2;
int32 mostSameCommit = 3;
string title = 4;
int64 height = 5;
bytes stateHash = 6;
uint32 txCounts = 7;
bytes txResult = 8;
int32 totalNodes = 1;
int32 totalCommit = 2;
int32 mostSameCommit = 3;
string title = 4;
int64 height = 5;
bytes stateHash = 6;
uint32 txCounts = 7;
bytes txResult = 8;
}
message ReceiptParacrossRecord {
string addr = 1;
ParacrossNodeStatus status = 2;
string addr = 1;
ParacrossNodeStatus status = 2;
}
// LocalDB
// title-height-addr : txHash
message ParacrossTx { string txHash = 1; }
message ParacrossTx {
string txHash = 1;
}
// query
message ReqParacrossTitleHeight {
string title = 1;
int64 height = 2;
string title = 1;
int64 height = 2;
}
message RespParacrossTitles { repeated ReceiptParacrossDone titles = 1; }
message RespParacrossTitles {
repeated ReceiptParacrossDone titles = 1;
}
// 跨链转账相关
message ParacrossAsset {
// input
string from = 1;
string to = 2;
bool isWithdraw = 3;
bytes txHash = 4;
int64 amount = 5;
string exec = 6;
string symbol = 7;
// 主链部分
int64 height = 10;
// 平行链部分
int64 commitDoneHeight = 21;
int64 paraHeight = 22;
bool success = 23;
// input
string from = 1;
string to = 2;
bool isWithdraw = 3;
bytes txHash = 4;
int64 amount = 5;
string exec = 6;
string symbol = 7;
// 主链部分
int64 height = 10;
// 平行链部分
int64 commitDoneHeight = 21;
int64 paraHeight = 22;
bool success = 23;
}
service paracross {
rpc GetTitle(ReqString) returns (ParacrossStatus) {}
rpc ListTitles(ReqNil) returns (RespParacrossTitles) {}
rpc GetTitleHeight(ReqParacrossTitleHeight) returns (ReceiptParacrossDone) {}
rpc GetAssetTxResult(ReqHash) returns (ParacrossAsset) {}
rpc GetTitle(ReqString) returns (ParacrossStatus) {}
rpc ListTitles(ReqNil) returns (RespParacrossTitles) {}
rpc GetTitleHeight(ReqParacrossTitleHeight) returns (ReceiptParacrossDone) {}
rpc GetAssetTxResult(ReqHash) returns (ParacrossAsset) {}
}
\ No newline at end of file
......@@ -6,156 +6,170 @@ package types;
//斗牛游戏内容
message PokerBull {
string gameId = 1; //默认是由创建这局游戏的txHash作为gameId
int32 status = 2; // Start 1 -> Continue 2 -> Quit 3
int64 startTime = 3; //开始时间
string startTxHash = 4; //游戏启动交易hash
int64 value = 5; //赌注
PBPoker poker = 6; //扑克牌
repeated PBPlayer players = 7; //玩家历史牌和结果集
int32 playerNum = 8; //玩家数
repeated PBResult results = 9; //游戏结果集
int64 index = 10; //索引
int64 prevIndex = 11; //上级索引
int64 quitTime = 12; //游戏结束时间
string quitTxHash = 13; //游戏结束交易hash
string dealerAddr = 14; //下局庄家地址
bool isWaiting = 15; //游戏是否处于等待状态
int32 preStatus = 16; //上一index的状态
string gameId = 1; //默认是由创建这局游戏的txHash作为gameId
int32 status = 2; // Start 1 -> Continue 2 -> Quit 3
int64 startTime = 3; //开始时间
string startTxHash = 4; //游戏启动交易hash
int64 value = 5; //赌注
PBPoker poker = 6; //扑克牌
repeated PBPlayer players = 7; //玩家历史牌和结果集
int32 playerNum = 8; //玩家数
repeated PBResult results = 9; //游戏结果集
int64 index = 10; //索引
int64 prevIndex = 11; //上级索引
int64 quitTime = 12; //游戏结束时间
string quitTxHash = 13; //游戏结束交易hash
string dealerAddr = 14; //下局庄家地址
bool isWaiting = 15; //游戏是否处于等待状态
int32 preStatus = 16; //上一index的状态
}
//一把牌
message PBHand {
repeated int32 cards = 1; //一把牌,五张
int32 result = 2; //斗牛结果 (没牛:0, 牛1-9:1-9, 牛牛:10)
string address = 3; //玩家地址
bool isWin = 4; //是否赢庄家
int32 leverage = 5; //赌注倍数
repeated int32 cards = 1; //一把牌,五张
int32 result = 2; //斗牛结果 (没牛:0, 牛1-9:1-9, 牛牛:10)
string address = 3; //玩家地址
bool isWin = 4; //是否赢庄家
int32 leverage = 5; //赌注倍数
}
//玩家
message PBPlayer {
repeated PBHand hands = 1; //历史发牌和斗牛结果
string address = 2; //玩家地址
int64 txHash = 3; //发牌随机数因子txhash的整数格式
bool ready = 4; // continue状态下,是否ready
repeated PBHand hands = 1; //历史发牌和斗牛结果
string address = 2; //玩家地址
int64 txHash = 3; //发牌随机数因子txhash的整数格式
bool ready = 4; // continue状态下,是否ready
}
//本局游戏结果
message PBResult {
repeated PBHand hands = 1; //本局所有玩家的牌和结果,按牛大小升序排序
string winner = 2; //赢家地址
int32 leverage = 3; //赢得赌注倍数
string dealer = 4; //庄家
int32 dealerLeverage = 5; //庄家赌注倍数
repeated PBHand hands = 1; //本局所有玩家的牌和结果,按牛大小升序排序
string winner = 2; //赢家地址
int32 leverage = 3; //赢得赌注倍数
string dealer = 4; //庄家
int32 dealerLeverage = 5; //庄家赌注倍数
}
//扑克牌
message PBPoker {
repeated int32 cards = 1; // 52张牌
int32 pointer = 2; //已发牌偏移
repeated int32 cards = 1; // 52张牌
int32 pointer = 2; //已发牌偏移
}
//游戏状态
message PBGameAction {
oneof value {
PBGameStart start = 1;
PBGameContinue continue = 2;
PBGameQuit quit = 3;
PBGameQuery query = 4;
}
int32 ty = 10;
oneof value {
PBGameStart start = 1;
PBGameContinue continue = 2;
PBGameQuit quit = 3;
PBGameQuery query = 4;
}
int32 ty = 10;
}
//游戏启动
message PBGameStart {
int64 value = 1;
int32 playerNum = 2;
int64 value = 1;
int32 playerNum = 2;
}
//游戏继续
message PBGameContinue { string gameId = 1; }
message PBGameContinue {
string gameId = 1;
}
//游戏结束
message PBGameQuit { string gameId = 1; }
message PBGameQuit {
string gameId = 1;
}
//查询游戏结果
message PBGameQuery { string gameId = 1; }
message PBGameQuery {
string gameId = 1;
}
//根据状态和游戏人数查找
message QueryPBGameListByStatusAndPlayerNum {
int32 status = 1;
int32 playerNum = 2;
int64 index = 3;
int32 status = 1;
int32 playerNum = 2;
int64 index = 3;
}
// 索引value值
message PBGameRecord {
string gameId = 1;
int32 status = 2;
int64 index = 3;
string gameId = 1;
int32 status = 2;
int64 index = 3;
}
message PBGameIndexRecord {
string gameId = 1;
int64 index = 2;
string gameId = 1;
int64 index = 2;
}
message PBGameRecords { repeated PBGameRecord records = 1; }
message PBGameRecords {
repeated PBGameRecord records = 1;
}
message QueryPBGameInfo {
string gameId = 1;
string addr = 2;
int32 status = 3;
int64 index = 4;
string gameId = 1;
string addr = 2;
int32 status = 3;
int64 index = 4;
}
message ReplyPBGame { PokerBull game = 1; }
message ReplyPBGame {
PokerBull game = 1;
}
message QueryPBGameInfos { repeated string gameIds = 1; }
message QueryPBGameInfos {
repeated string gameIds = 1;
}
message ReplyPBGameList { repeated PokerBull games = 1; }
message ReplyPBGameList {
repeated PokerBull games = 1;
}
message ReceiptPBGame {
string gameId = 1;
int32 status = 2;
string addr = 3;
int64 index = 4;
int64 prevIndex = 5;
int32 playerNum = 6;
int64 value = 7;
bool isWaiting = 8;
repeated string players = 9;
int32 preStatus = 10;
string gameId = 1;
int32 status = 2;
string addr = 3;
int64 index = 4;
int64 prevIndex = 5;
int32 playerNum = 6;
int64 value = 7;
bool isWaiting = 8;
repeated string players = 9;
int32 preStatus = 10;
}
message PBStartTxReq {
int64 value = 1;
int32 playerNum = 2;
int64 fee = 3;
int64 value = 1;
int32 playerNum = 2;
int64 fee = 3;
}
message PBContinueTxReq {
string gameId = 1;
int64 fee = 2;
string gameId = 1;
int64 fee = 2;
}
message PBQuitTxReq {
string gameId = 1;
int64 fee = 2;
string gameId = 1;
int64 fee = 2;
}
message PBQueryReq {
string gameId = 1;
int64 fee = 2;
string gameId = 1;
int64 fee = 2;
}
// pokerbull 对外提供服务的接口
service pokerbull {
//游戏开始
rpc Start(PBGameStart) returns (UnsignTx) {}
//游戏继续
rpc Continue(PBGameContinue) returns (UnsignTx) {}
//游戏结束
rpc Quit(PBGameQuit) returns (UnsignTx) {}
//游戏开始
rpc Start(PBGameStart) returns (UnsignTx) {}
//游戏继续
rpc Continue(PBGameContinue) returns (UnsignTx) {}
//游戏结束
rpc Quit(PBGameQuit) returns (UnsignTx) {}
}
This diff is collapsed.
......@@ -2,204 +2,212 @@ syntax = "proto3";
package types;
enum RelayOrderStatus {
init = 0;
pending = 1;
locking = 2;
confirming = 3;
finished = 4;
canceled = 5;
timeout = 6; // TODO: may not needed?
init = 0;
pending = 1;
locking = 2;
confirming = 3;
finished = 4;
canceled = 5;
timeout = 6; // TODO: may not needed?
}
message RelayAction {
oneof value {
RelayCreate create = 1;
RelayAccept accept = 2;
RelayRevoke revoke = 3;
RelayConfirmTx confirmTx = 4;
RelayVerify verify = 5;
RelayVerifyCli verifyCli = 6;
BtcHeaders btcHeaders = 7;
}
int32 ty = 10;
oneof value {
RelayCreate create = 1;
RelayAccept accept = 2;
RelayRevoke revoke = 3;
RelayConfirmTx confirmTx = 4;
RelayVerify verify = 5;
RelayVerifyCli verifyCli = 6;
BtcHeaders btcHeaders = 7;
}
int32 ty = 10;
}
message RelayOrder {
string id = 1;
RelayOrderStatus status = 2;
RelayOrderStatus preStatus = 3;
uint64 amount = 4;
string createrAddr = 5;
uint32 coinOperation = 6;
string coin = 7;
uint64 coinAmount = 8;
string coinAddr = 9;
string coinTxHash = 10;
int64 createTime = 11;
string acceptAddr = 12;
int64 acceptTime = 13;
int64 confirmTime = 14;
int64 finishTime = 15;
string finishTxHash = 16;
int64 height = 17;
uint64 coinHeight = 18;
uint32 coinWaits = 19;
string id = 1;
RelayOrderStatus status = 2;
RelayOrderStatus preStatus = 3;
uint64 amount = 4;
string createrAddr = 5;
uint32 coinOperation = 6;
string coin = 7;
uint64 coinAmount = 8;
string coinAddr = 9;
string coinTxHash = 10;
int64 createTime = 11;
string acceptAddr = 12;
int64 acceptTime = 13;
int64 confirmTime = 14;
int64 finishTime = 15;
string finishTxHash = 16;
int64 height = 17;
uint64 coinHeight = 18;
uint32 coinWaits = 19;
}
message RelayCreate {
uint32 operation = 1; // 0: buy, 1: sell
string coin = 2; // outside coin BTC, ETH...
uint64 amount = 3;
string addr = 4;
uint64 btyAmount = 5;
uint32 coinWaits = 6; // the coin blocks to wait
uint32 operation = 1; // 0: buy, 1: sell
string coin = 2; // outside coin BTC, ETH...
uint64 amount = 3;
string addr = 4;
uint64 btyAmount = 5;
uint32 coinWaits = 6; // the coin blocks to wait
}
message RelayAccept {
string orderId = 1;
string coinAddr = 2; // for sell coin case needed
uint32 coinWaits = 3;
string orderId = 1;
string coinAddr = 2; // for sell coin case needed
uint32 coinWaits = 3;
}
message RelayRevoke {
string orderId = 1;
uint32 target = 2; // 0:create , 1: accept
uint32 action = 3; // 0: unlock, 1: cancel (only for creator)
string orderId = 1;
uint32 target = 2; // 0:create , 1: accept
uint32 action = 3; // 0: unlock, 1: cancel (only for creator)
}
//客户只用交易hash提交, 验证需要的其他信息由relayd提供
message RelayConfirmTx {
string orderId = 1;
string txHash = 2;
string orderId = 1;
string txHash = 2;
}
// relayd提供验证信息
message RelayVerify {
string orderId = 1;
BtcTransaction tx = 2;
BtcSpv spv = 3;
string orderId = 1;
BtcTransaction tx = 2;
BtcSpv spv = 3;
}
message RelayVerifyCli {
string orderId = 1;
string rawTx = 2;
uint32 txIndex = 3;
string merkBranch = 4;
string blockHash = 5;
string orderId = 1;
string rawTx = 2;
uint32 txIndex = 3;
string merkBranch = 4;
string blockHash = 5;
}
message BtcHeader {
string hash = 1;
uint64 confirmations = 2;
uint64 height = 3;
uint32 version = 4;
string merkleRoot = 5;
int64 time = 6;
uint64 nonce = 7;
int64 bits = 8;
int64 difficulty = 9;
string previousHash = 10;
string nextHash = 11;
bool isReset = 12; // 0: nomal btc headers sync (default), 1: set the base
// head (may not from 1)
}
message BtcHeaders { repeated BtcHeader btcHeader = 1; }
string hash = 1;
uint64 confirmations = 2;
uint64 height = 3;
uint32 version = 4;
string merkleRoot = 5;
int64 time = 6;
uint64 nonce = 7;
int64 bits = 8;
int64 difficulty = 9;
string previousHash = 10;
string nextHash = 11;
bool isReset = 12; // 0: nomal btc headers sync (default), 1: set the base
// head (may not from 1)
}
message BtcHeaders {
repeated BtcHeader btcHeader = 1;
}
message BtcTransaction {
string hash = 1; // txhash
uint64 blockHeight = 2;
repeated Vin vin = 3;
repeated Vout vout = 4;
int64 time = 5;
uint64 confirmations = 6;
string hash = 1; // txhash
uint64 blockHeight = 2;
repeated Vin vin = 3;
repeated Vout vout = 4;
int64 time = 5;
uint64 confirmations = 6;
}
message Vin {
string address = 1;
uint64 Value = 2;
string address = 1;
uint64 Value = 2;
}
message Vout {
bool coinbase = 1;
string address = 2;
uint64 Value = 3;
bool coinbase = 1;
string address = 2;
uint64 Value = 3;
}
message BtcSpv {
string hash = 1; // txhash
int64 time = 2;
uint64 height = 3;
string blockHash = 4;
uint32 txIndex = 5;
repeated bytes branchProof = 6;
string hash = 1; // txhash
int64 time = 2;
uint64 height = 3;
string blockHash = 4;
uint32 txIndex = 5;
repeated bytes branchProof = 6;
}
message RelayLastRcvBtcHeader {
BtcHeader Header = 1;
uint64 baseHeight = 2;
BtcHeader Header = 1;
uint64 baseHeight = 2;
}
message ReceiptRelayRcvBTCHeaders {
repeated BtcHeader headers = 1;
uint64 lastHeight = 2; // last height is the last btc Tx's last height
uint64 newHeight = 3;
uint64 lastBaseHeight = 4; // last base height means ever base height
uint64 newBaseHeight = 5;
repeated BtcHeader headers = 1;
uint64 lastHeight = 2; // last height is the last btc Tx's last height
uint64 newHeight = 3;
uint64 lastBaseHeight = 4; // last base height means ever base height
uint64 newBaseHeight = 5;
}
message ReceiptRelayLog {
string orderId = 1;
string curStatus = 2;
string preStatus = 3;
string txAmount = 4;
string createrAddr = 5;
string coinOperation = 6;
string coin = 7;
string coinAmount = 8;
string coinAddr = 9;
string coinTxHash = 10;
int64 createTime = 11;
string acceptAddr = 12;
int64 acceptTime = 13;
int64 confirmTime = 14;
int64 finishTime = 15;
string finishTxHash = 16;
uint64 coinHeight = 17;
uint32 coinWaits = 18;
string orderId = 1;
string curStatus = 2;
string preStatus = 3;
string txAmount = 4;
string createrAddr = 5;
string coinOperation = 6;
string coin = 7;
string coinAmount = 8;
string coinAddr = 9;
string coinTxHash = 10;
int64 createTime = 11;
string acceptAddr = 12;
int64 acceptTime = 13;
int64 confirmTime = 14;
int64 finishTime = 15;
string finishTxHash = 16;
uint64 coinHeight = 17;
uint32 coinWaits = 18;
}
message ReqRelayAddrCoins {
string addr = 1;
RelayOrderStatus status = 2;
repeated string coins = 3;
int32 pageNumber = 4;
int32 pageSize = 5;
string addr = 1;
RelayOrderStatus status = 2;
repeated string coins = 3;
int32 pageNumber = 4;
int32 pageSize = 5;
}
message ReplyRelayOrders { repeated RelayOrder relayorders = 1; }
message ReplyRelayOrders {
repeated RelayOrder relayorders = 1;
}
message QueryRelayOrderParam {
RelayOrderStatus status = 1;
string orderId = 2;
RelayOrderStatus status = 1;
string orderId = 2;
}
message QueryRelayOrderResult { repeated RelayOrder orders = 1; }
message QueryRelayOrderResult {
repeated RelayOrder orders = 1;
}
message ReqRelayBtcHeaderHeightList {
int64 reqHeight = 1;
int32 counts = 2;
int32 direction = 3; // 0: desc, 1: asc
int64 reqHeight = 1;
int32 counts = 2;
int32 direction = 3; // 0: desc, 1: asc
}
message ReplyRelayBtcHeadHeightList { repeated int64 heights = 1; }
message ReplyRelayBtcHeadHeightList {
repeated int64 heights = 1;
}
message ReqRelayQryBTCHeadHeight {
int64 baseHeight = 1; // from the baseHeight begin, if any
int64 baseHeight = 1; // from the baseHeight begin, if any
}
message ReplayRelayQryBTCHeadHeight {
int64 curHeight = 1; // current height in chain
int64 baseHeight = 2; // base height means the the 1st head record in chain db
// (base height can be change)
int64 curHeight = 1; // current height in chain
int64 baseHeight = 2; // base height means the the 1st head record in chain db
// (base height can be change)
}
\ No newline at end of file
......@@ -6,70 +6,70 @@ package types;
// message for retrieve start
message RetrievePara {
string defaultAddress = 1;
int32 status = 2;
int64 createTime = 3;
int64 prepareTime = 4;
int64 delayPeriod = 5;
string defaultAddress = 1;
int32 status = 2;
int64 createTime = 3;
int64 prepareTime = 4;
int64 delayPeriod = 5;
}
message Retrieve {
// used as key
string backupAddress = 1;
repeated RetrievePara retPara = 2;
// used as key
string backupAddress = 1;
repeated RetrievePara retPara = 2;
}
message RetrieveAction {
oneof value {
PrepareRetrieve prepare = 1;
PerformRetrieve perform = 2;
BackupRetrieve backup = 3;
CancelRetrieve cancel = 4;
}
int32 ty = 5;
oneof value {
PrepareRetrieve prepare = 1;
PerformRetrieve perform = 2;
BackupRetrieve backup = 3;
CancelRetrieve cancel = 4;
}
int32 ty = 5;
}
message BackupRetrieve {
string backupAddress = 1;
string defaultAddress = 2;
int64 delayPeriod = 3;
string backupAddress = 1;
string defaultAddress = 2;
int64 delayPeriod = 3;
}
message PrepareRetrieve {
string backupAddress = 1;
string defaultAddress = 2;
string backupAddress = 1;
string defaultAddress = 2;
}
message PerformRetrieve {
string backupAddress = 1;
string defaultAddress = 2;
string backupAddress = 1;
string defaultAddress = 2;
}
message CancelRetrieve {
string backupAddress = 1;
string defaultAddress = 2;
string backupAddress = 1;
string defaultAddress = 2;
}
message ReqRetrieveInfo {
string backupAddress = 1;
string defaultAddress = 2;
string backupAddress = 1;
string defaultAddress = 2;
}
message RetrieveQuery {
string backupAddress = 1;
string defaultAddress = 2;
int64 delayPeriod = 3;
int64 prepareTime = 4;
int64 remainTime = 5;
int32 status = 6;
string backupAddress = 1;
string defaultAddress = 2;
int64 delayPeriod = 3;
int64 prepareTime = 4;
int64 remainTime = 5;
int32 status = 6;
}
// retrieve 对外提供服务的接口
service retrieve {
rpc Prepare(PrepareRetrieve) returns (UnsignTx) {}
rpc Perform(PerformRetrieve) returns (UnsignTx) {}
rpc Backup(BackupRetrieve) returns (UnsignTx) {}
rpc Cancel(CancelRetrieve) returns (UnsignTx) {}
rpc Prepare(PrepareRetrieve) returns (UnsignTx) {}
rpc Perform(PerformRetrieve) returns (UnsignTx) {}
rpc Backup(BackupRetrieve) returns (UnsignTx) {}
rpc Cancel(CancelRetrieve) returns (UnsignTx) {}
}
// message for retrieve end
\ No newline at end of file
......@@ -4,123 +4,131 @@ package types;
import "common.proto";
message Ticket {
string ticketId = 1;
// 0 -> 未成熟 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
int32 status = 2;
// genesis 创建的私钥比较特殊
bool isGenesis = 3;
//创建时间
int64 createTime = 4;
//挖矿时间
int64 minerTime = 5;
//挖到的币的数目
int64 minerValue = 8;
string minerAddress = 6;
// return wallet
string returnAddress = 7;
string ticketId = 1;
// 0 -> 未成熟 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
int32 status = 2;
// genesis 创建的私钥比较特殊
bool isGenesis = 3;
//创建时间
int64 createTime = 4;
//挖矿时间
int64 minerTime = 5;
//挖到的币的数目
int64 minerValue = 8;
string minerAddress = 6;
// return wallet
string returnAddress = 7;
}
// message for execs.ticket
message TicketAction {
oneof value {
TicketBind tbind = 5;
TicketOpen topen = 1;
TicketGenesis genesis = 2;
TicketClose tclose = 3;
TicketMiner miner = 4;
}
int32 ty = 10;
oneof value {
TicketBind tbind = 5;
TicketOpen topen = 1;
TicketGenesis genesis = 2;
TicketClose tclose = 3;
TicketMiner miner = 4;
}
int32 ty = 10;
}
message TicketMiner {
uint32 bits = 1;
int64 reward = 2;
string ticketId = 3;
bytes modify = 4;
//挖到区块时公开
bytes privHash = 5;
uint32 bits = 1;
int64 reward = 2;
string ticketId = 3;
bytes modify = 4;
//挖到区块时公开
bytes privHash = 5;
}
message TicketMinerOld {
uint32 bits = 1;
int64 reward = 2;
string ticketId = 3;
bytes modify = 4;
uint32 bits = 1;
int64 reward = 2;
string ticketId = 3;
bytes modify = 4;
}
message MinerFlag {
int32 flag = 1;
int64 reserve = 2;
int32 flag = 1;
int64 reserve = 2;
}
message TicketBind {
string minerAddress = 1;
string returnAddress = 2;
string minerAddress = 1;
string returnAddress = 2;
}
message TicketOpen {
//用户挖矿的ticket 地址
string minerAddress = 1;
//购买ticket的数目
int32 count = 2;
//币实际存储的地址
string returnAddress = 3;
//随机种子
int64 randSeed = 4;
//购买ticket时公开
repeated bytes pubHashes = 5;
//用户挖矿的ticket 地址
string minerAddress = 1;
//购买ticket的数目
int32 count = 2;
//币实际存储的地址
string returnAddress = 3;
//随机种子
int64 randSeed = 4;
//购买ticket时公开
repeated bytes pubHashes = 5;
}
message TicketGenesis {
string minerAddress = 1;
string returnAddress = 2;
int32 count = 3;
string minerAddress = 1;
string returnAddress = 2;
int32 count = 3;
}
message TicketClose { repeated string ticketId = 1; }
message TicketClose {
repeated string ticketId = 1;
}
message TicketList {
string addr = 1;
int32 status = 3;
string addr = 1;
int32 status = 3;
}
message TicketInfos { repeated string ticketIds = 1; }
message TicketInfos {
repeated string ticketIds = 1;
}
message ReplyTicketList { repeated Ticket tickets = 1; }
message ReplyTicketList {
repeated Ticket tickets = 1;
}
message ReplyWalletTickets {
repeated Ticket tickets = 1;
repeated bytes privkeys = 2;
repeated Ticket tickets = 1;
repeated bytes privkeys = 2;
}
message ReceiptTicket {
string ticketId = 1;
int32 status = 2;
int32 prevStatus = 3;
string addr = 4;
string ticketId = 1;
int32 status = 2;
int32 prevStatus = 3;
string addr = 4;
}
message ReceiptTicketBind {
string oldMinerAddress = 1;
string newMinerAddress = 2;
string returnAddress = 3;
string oldMinerAddress = 1;
string newMinerAddress = 2;
string returnAddress = 3;
}
message ReqBindMiner {
string bindAddr = 1;
string originAddr = 2;
int64 amount = 3;
bool checkBalance = 4;
string bindAddr = 1;
string originAddr = 2;
int64 amount = 3;
bool checkBalance = 4;
}
message ReplyBindMiner { string txHex = 1; }
message ReplyBindMiner {
string txHex = 1;
}
service ticket {
//创建绑定挖矿
rpc CreateBindMiner(ReqBindMiner) returns (ReplyBindMiner) {}
//查询钱包票数
rpc GetTicketCount(types.ReqNil) returns (Int64) {}
// Miner
//设置自动挖矿
rpc SetAutoMining(MinerFlag) returns (Reply) {}
//创建绑定挖矿
rpc CreateBindMiner(ReqBindMiner) returns (ReplyBindMiner) {}
//查询钱包票数
rpc GetTicketCount(types.ReqNil) returns (Int64) {}
// Miner
//设置自动挖矿
rpc SetAutoMining(MinerFlag) returns (Reply) {}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ syntax = "proto3";
package signatory;
message Config {
repeated string whitelist = 1;
string jrpcBindAddr = 2;
string privkey = 3;
repeated string whitelist = 1;
string jrpcBindAddr = 2;
string privkey = 3;
}
......@@ -7,134 +7,140 @@ package types;
// action
message TokenAction {
oneof value {
TokenPreCreate tokenPreCreate = 1;
TokenFinishCreate tokenFinishCreate = 2;
TokenRevokeCreate tokenRevokeCreate = 3;
AssetsTransfer transfer = 4;
AssetsWithdraw withdraw = 5;
AssetsGenesis genesis = 6;
AssetsTransferToExec transferToExec = 8;
}
int32 Ty = 7;
oneof value {
TokenPreCreate tokenPreCreate = 1;
TokenFinishCreate tokenFinishCreate = 2;
TokenRevokeCreate tokenRevokeCreate = 3;
AssetsTransfer transfer = 4;
AssetsWithdraw withdraw = 5;
AssetsGenesis genesis = 6;
AssetsTransferToExec transferToExec = 8;
}
int32 Ty = 7;
}
//创建token,支持最大精确度是8位小数,即存入数据库的实际总额需要放大1e8倍
message TokenPreCreate {
string name = 1;
string symbol = 2;
string introduction = 3;
int64 total = 4;
int64 price = 5;
string owner = 6;
string name = 1;
string symbol = 2;
string introduction = 3;
int64 total = 4;
int64 price = 5;
string owner = 6;
}
message TokenFinishCreate {
string symbol = 1;
string owner = 2;
string symbol = 1;
string owner = 2;
}
message TokenRevokeCreate {
string symbol = 1;
string owner = 2;
string symbol = 1;
string owner = 2;
}
// state db
message Token {
string name = 1;
string symbol = 2;
string introduction = 3;
int64 total = 4;
int64 price = 5;
string owner = 6;
string creator = 7;
int32 status = 8;
string name = 1;
string symbol = 2;
string introduction = 3;
int64 total = 4;
int64 price = 5;
string owner = 6;
string creator = 7;
int32 status = 8;
}
// log
message ReceiptToken {
string symbol = 1;
string owner = 2;
int32 status = 3;
string symbol = 1;
string owner = 2;
int32 status = 3;
}
// local
message LocalToken {
string name = 1;
string symbol = 2;
string introduction = 3;
int64 total = 4;
int64 price = 5;
string owner = 6;
string creator = 7;
int32 status = 8;
int64 createdHeight = 9;
int64 createdTime = 10;
int64 prepareCreateHeight = 11;
int64 prepareCreateTime = 12;
int32 precision = 13;
// 如果需要这个项可以单独做一个域存储
int64 totalTransferTimes = 14;
int64 revokedHeight = 15;
int64 revokedTime = 16;
string name = 1;
string symbol = 2;
string introduction = 3;
int64 total = 4;
int64 price = 5;
string owner = 6;
string creator = 7;
int32 status = 8;
int64 createdHeight = 9;
int64 createdTime = 10;
int64 prepareCreateHeight = 11;
int64 prepareCreateTime = 12;
int32 precision = 13;
// 如果需要这个项可以单独做一个域存储
int64 totalTransferTimes = 14;
int64 revokedHeight = 15;
int64 revokedTime = 16;
}
// query
message ReqTokens {
bool queryAll = 1;
int32 status = 2;
repeated string tokens = 3;
bool symbolOnly = 4;
bool queryAll = 1;
int32 status = 2;
repeated string tokens = 3;
bool symbolOnly = 4;
}
message ReplyTokens { repeated LocalToken tokens = 1; }
message ReplyTokens {
repeated LocalToken tokens = 1;
}
message TokenRecv {
string token = 1;
int64 recv = 2;
string token = 1;
int64 recv = 2;
}
message ReplyAddrRecvForTokens {
repeated TokenRecv tokenRecvs = 1;
}
message ReplyAddrRecvForTokens { repeated TokenRecv tokenRecvs = 1; }
message ReqTokenBalance {
repeated string addresses = 1;
string tokenSymbol = 2;
string execer = 3;
repeated string addresses = 1;
string tokenSymbol = 2;
string execer = 3;
}
message ReqAccountTokenAssets {
string address = 1;
string execer = 2;
string address = 1;
string execer = 2;
}
message TokenAsset {
string symbol = 1;
Account account = 2;
string symbol = 1;
Account account = 2;
}
message ReplyAccountTokenAssets { repeated TokenAsset tokenAssets = 1; }
message ReplyAccountTokenAssets {
repeated TokenAsset tokenAssets = 1;
}
message ReqAddrTokens {
string addr = 1;
int32 status = 2;
repeated string token = 3;
int32 direction = 4;
int32 count = 5;
string fromKey = 6;
string addr = 1;
int32 status = 2;
repeated string token = 3;
int32 direction = 4;
int32 count = 5;
string fromKey = 6;
}
message ReqTokenTx {
string symbol = 1;
//表示取所有/from/to/其他的hash列表
int32 flag = 2;
int32 count = 3;
int32 direction = 4;
int64 height = 5;
int64 index = 6;
string addr = 7;
string symbol = 1;
//表示取所有/from/to/其他的hash列表
int32 flag = 2;
int32 count = 3;
int32 direction = 4;
int64 height = 5;
int64 index = 6;
string addr = 7;
}
service token {
// token 对外提供服务的接口
//区块链接口
rpc GetTokenBalance(ReqTokenBalance) returns (Accounts) {}
// token 对外提供服务的接口
//区块链接口
rpc GetTokenBalance(ReqTokenBalance) returns (Accounts) {}
}
\ No newline at end of file
This diff is collapsed.
......@@ -4,175 +4,185 @@ import "transaction.proto";
package types;
message BlockID { bytes Hash = 1; }
message BlockID {
bytes Hash = 1;
}
message TendermintBitArray {
int32 Bits = 1;
repeated uint64 Elems = 2;
int32 Bits = 1;
repeated uint64 Elems = 2;
}
message Vote {
bytes ValidatorAddress = 1;
int32 ValidatorIndex = 2;
int64 Height = 3;
int32 Round = 4;
int64 Timestamp = 5;
uint32 Type = 6;
BlockID BlockID = 7;
bytes Signature = 8;
bytes ValidatorAddress = 1;
int32 ValidatorIndex = 2;
int64 Height = 3;
int32 Round = 4;
int64 Timestamp = 5;
uint32 Type = 6;
BlockID BlockID = 7;
bytes Signature = 8;
}
message TendermintCommit {
BlockID BlockID = 1;
repeated Vote Precommits = 2;
BlockID BlockID = 1;
repeated Vote Precommits = 2;
}
message TendermintBlockInfo {
TendermintCommit SeenCommit = 1;
TendermintCommit LastCommit = 2;
State State = 3;
Proposal Proposal = 4;
TendermintBlock block = 5;
TendermintCommit SeenCommit = 1;
TendermintCommit LastCommit = 2;
State State = 3;
Proposal Proposal = 4;
TendermintBlock block = 5;
}
message BlockSize {
int32 MaxBytes = 1;
int32 MaxTxs = 2;
int64 MaxGas = 3;
int32 MaxBytes = 1;
int32 MaxTxs = 2;
int64 MaxGas = 3;
}
message TxSize {
int32 MaxBytes = 1;
int64 MaxGas = 2;
int32 MaxBytes = 1;
int64 MaxGas = 2;
}
message BlockGossip { int32 BlockPartSizeBytes = 1; }
message BlockGossip {
int32 BlockPartSizeBytes = 1;
}
message EvidenceParams { int64 MaxAge = 1; }
message EvidenceParams {
int64 MaxAge = 1;
}
message ConsensusParams {
BlockSize BlockSize = 1;
TxSize TxSize = 2;
BlockGossip BlockGossip = 3;
EvidenceParams EvidenceParams = 4;
BlockSize BlockSize = 1;
TxSize TxSize = 2;
BlockGossip BlockGossip = 3;
EvidenceParams EvidenceParams = 4;
}
message Validator {
bytes Address = 1;
bytes PubKey = 2;
int64 VotingPower = 3;
int64 Accum = 4;
bytes Address = 1;
bytes PubKey = 2;
int64 VotingPower = 3;
int64 Accum = 4;
}
message ValidatorSet {
repeated Validator Validators = 1;
Validator Proposer = 2;
repeated Validator Validators = 1;
Validator Proposer = 2;
}
message State {
string ChainID = 1;
int64 LastBlockHeight = 2;
int64 LastBlockTotalTx = 3;
BlockID LastBlockID = 4;
int64 LastBlockTime = 5;
ValidatorSet Validators = 6;
ValidatorSet LastValidators = 7;
int64 LastHeightValidatorsChanged = 8;
ConsensusParams ConsensusParams = 9;
int64 LastHeightConsensusParamsChanged = 10;
bytes LastResultsHash = 11;
bytes AppHash = 12;
string ChainID = 1;
int64 LastBlockHeight = 2;
int64 LastBlockTotalTx = 3;
BlockID LastBlockID = 4;
int64 LastBlockTime = 5;
ValidatorSet Validators = 6;
ValidatorSet LastValidators = 7;
int64 LastHeightValidatorsChanged = 8;
ConsensusParams ConsensusParams = 9;
int64 LastHeightConsensusParamsChanged = 10;
bytes LastResultsHash = 11;
bytes AppHash = 12;
}
message DuplicateVoteEvidence {
string pubKey = 1;
Vote voteA = 2;
Vote voteB = 3;
string pubKey = 1;
Vote voteA = 2;
Vote voteB = 3;
}
message EvidenceEnvelope {
string typeName = 1;
bytes data = 2;
string typeName = 1;
bytes data = 2;
}
message EvidenceData { repeated EvidenceEnvelope evidence = 1; }
message EvidenceData {
repeated EvidenceEnvelope evidence = 1;
}
message TendermintBlockHeader {
string chainID = 1;
int64 height = 2;
int64 round = 3;
int64 time = 4;
int64 numTxs = 5;
BlockID lastBlockID = 6;
int64 totalTxs = 7;
bytes lastCommitHash = 8;
bytes validatorsHash = 9;
bytes consensusHash = 10;
bytes appHash = 11;
bytes lastResultsHash = 12;
bytes evidenceHash = 13;
string chainID = 1;
int64 height = 2;
int64 round = 3;
int64 time = 4;
int64 numTxs = 5;
BlockID lastBlockID = 6;
int64 totalTxs = 7;
bytes lastCommitHash = 8;
bytes validatorsHash = 9;
bytes consensusHash = 10;
bytes appHash = 11;
bytes lastResultsHash = 12;
bytes evidenceHash = 13;
}
message TendermintBlock {
TendermintBlockHeader header = 1;
repeated Transaction txs = 2;
EvidenceData evidence = 3;
TendermintCommit lastCommit = 4;
bytes proposerAddr = 5;
TendermintBlockHeader header = 1;
repeated Transaction txs = 2;
EvidenceData evidence = 3;
TendermintCommit lastCommit = 4;
bytes proposerAddr = 5;
}
message Proposal {
int64 height = 1;
int32 round = 2;
int64 timestamp = 3;
int32 POLRound = 4;
BlockID POLBlockID = 5;
bytes signature = 6;
bytes blockhash = 7;
int64 height = 1;
int32 round = 2;
int64 timestamp = 3;
int32 POLRound = 4;
BlockID POLBlockID = 5;
bytes signature = 6;
bytes blockhash = 7;
}
message NewRoundStepMsg {
int64 height = 1;
int32 round = 2;
int32 step = 3;
int32 secondsSinceStartTime = 4;
int32 lastCommitRound = 5;
int64 height = 1;
int32 round = 2;
int32 step = 3;
int32 secondsSinceStartTime = 4;
int32 lastCommitRound = 5;
}
message CommitStepMsg { int64 height = 1; }
message CommitStepMsg {
int64 height = 1;
}
message ProposalPOLMsg {
int64 height = 1;
int32 proposalPOLRound = 2;
TendermintBitArray proposalPOL = 3;
int64 height = 1;
int32 proposalPOLRound = 2;
TendermintBitArray proposalPOL = 3;
}
message HasVoteMsg {
int64 height = 1;
int32 round = 2;
int32 type = 3;
int32 index = 4;
int64 height = 1;
int32 round = 2;
int32 type = 3;
int32 index = 4;
}
message VoteSetMaj23Msg {
int64 height = 1;
int32 round = 2;
int32 type = 3;
BlockID blockID = 4;
int64 height = 1;
int32 round = 2;
int32 type = 3;
BlockID blockID = 4;
}
message VoteSetBitsMsg {
int64 height = 1;
int32 round = 2;
int32 type = 3;
BlockID blockID = 4;
TendermintBitArray votes = 5;
int64 height = 1;
int32 round = 2;
int32 type = 3;
BlockID blockID = 4;
TendermintBitArray votes = 5;
}
message Heartbeat {
bytes validatorAddress = 1;
int32 validatorIndex = 2;
int64 height = 3;
int32 round = 4;
int32 sequence = 5;
bytes signature = 6;
bytes validatorAddress = 1;
int32 validatorIndex = 2;
int64 height = 3;
int32 round = 4;
int32 sequence = 5;
bytes signature = 6;
}
......@@ -4,20 +4,26 @@ package types;
import "tendermint.proto";
message ValNode {
bytes pubKey = 1;
int64 power = 2;
bytes pubKey = 1;
int64 power = 2;
}
message ValNodes { repeated ValNode nodes = 1; }
message ValNodes {
repeated ValNode nodes = 1;
}
message ValNodeAction {
oneof value {
ValNode node = 1;
TendermintBlockInfo blockInfo = 2;
}
int32 Ty = 3;
oneof value {
ValNode node = 1;
TendermintBlockInfo blockInfo = 2;
}
int32 Ty = 3;
}
message ReqNodeInfo { int64 height = 1; }
message ReqNodeInfo {
int64 height = 1;
}
message ReqBlockInfo { int64 height = 1; }
\ No newline at end of file
message ReqBlockInfo {
int64 height = 1;
}
\ No newline at end of file
......@@ -3,23 +3,29 @@ syntax = "proto3";
package mpt;
message Node {
oneof value {
FullNode full = 2;
ShortNode short = 3;
HashNode hash = 4;
ValueNode val = 5;
}
int32 Ty = 1;
int32 index = 6;
oneof value {
FullNode full = 2;
ShortNode short = 3;
HashNode hash = 4;
ValueNode val = 5;
}
int32 Ty = 1;
int32 index = 6;
}
message FullNode { repeated Node nodes = 1; }
message FullNode {
repeated Node nodes = 1;
}
message ShortNode {
bytes key = 1;
Node val = 2;
bytes key = 1;
Node val = 2;
}
message HashNode { bytes hash = 1; }
message HashNode {
bytes hash = 1;
}
message ValueNode { bytes value = 1; }
message ValueNode {
bytes value = 1;
}
package mpt
import (
lru "github.com/hashicorp/golang-lru"
"gitlab.33.cn/chain33/chain33/common"
clog "gitlab.33.cn/chain33/chain33/common/log"
log "gitlab.33.cn/chain33/chain33/common/log/log15"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment