Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
820571b3
Commit
820571b3
authored
Nov 11, 2018
by
madengji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add clang format
parent
cdf51d68
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
1738 additions
and
1506 deletions
+1738
-1506
.clang-format
.clang-format
+21
-0
.gitignore
.gitignore
+40
-11
Makefile
Makefile
+0
-1
blackwhite.proto
plugin/dapp/blackwhite/proto/blackwhite.proto
+137
-126
cert.proto
plugin/dapp/cert/proto/cert.proto
+20
-19
evmcontract.proto
plugin/dapp/evm/proto/evmcontract.proto
+71
-65
game.proto
plugin/dapp/game/proto/game.proto
+97
-85
hashlock.proto
plugin/dapp/hashlock/proto/hashlock.proto
+30
-29
lottery.proto
plugin/dapp/lottery/proto/lottery.proto
+134
-112
norm.proto
plugin/dapp/norm/proto/norm.proto
+14
-10
paracross.proto
plugin/dapp/paracross/proto/paracross.proto
+83
-72
pokerbull.proto
plugin/dapp/pokerbull/proto/pokerbull.proto
+99
-85
privacy.proto
plugin/dapp/privacy/proto/privacy.proto
+282
-253
relay.proto
plugin/dapp/relay/proto/relay.proto
+142
-133
retrieve.proto
plugin/dapp/retrieve/proto/retrieve.proto
+37
-36
ticket.proto
plugin/dapp/ticket/proto/ticket.proto
+84
-75
config.proto
...in/dapp/token/cmd/signatory-server/signatory/config.proto
+3
-3
token.proto
plugin/dapp/token/proto/token.proto
+88
-81
trade.proto
plugin/dapp/trade/proto/trade.proto
+203
-180
tendermint.proto
plugin/dapp/valnode/proto/tendermint.proto
+116
-106
valnode.proto
plugin/dapp/valnode/proto/valnode.proto
+17
-11
node.proto
plugin/store/mpt/db/node.proto
+19
-13
mpt.go
plugin/store/mpt/mpt.go
+1
-0
No files found.
.clang-format
0 → 100644
View file @
820571b3
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'
.gitignore
View file @
820571b3
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/
Makefile
View file @
820571b3
...
...
@@ -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
;
\
...
...
plugin/dapp/blackwhite/proto/blackwhite.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/cert/proto/cert.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/evm/proto/evmcontract.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/game/proto/game.proto
View file @
820571b3
...
...
@@ -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
;
}
plugin/dapp/hashlock/proto/hashlock.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/lottery/proto/lottery.proto
View file @
820571b3
...
...
@@ -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
;
}
plugin/dapp/norm/proto/norm.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/paracross/proto/paracross.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/pokerbull/proto/pokerbull.proto
View file @
820571b3
...
...
@@ -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
)
{}
}
plugin/dapp/privacy/proto/privacy.proto
View file @
820571b3
...
...
@@ -11,433 +11,461 @@ import "wallet.proto";
// start/////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
message
PrivacyAction
{
oneof
value
{
Public2Privacy
public2privacy
=
1
;
Privacy2Privacy
privacy2privacy
=
2
;
Privacy2Public
privacy2public
=
3
;
}
int32
ty
=
4
;
oneof
value
{
Public2Privacy
public2privacy
=
1
;
Privacy2Privacy
privacy2privacy
=
2
;
Privacy2Public
privacy2public
=
3
;
}
int32
ty
=
4
;
}
message
Public2Privacy
{
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyOutput
output
=
7
;
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyOutput
output
=
7
;
}
message
Privacy2Privacy
{
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyInput
input
=
6
;
PrivacyOutput
output
=
7
;
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyInput
input
=
6
;
PrivacyOutput
output
=
7
;
}
message
Privacy2Public
{
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
3
;
PrivacyInput
input
=
4
;
PrivacyOutput
output
=
5
;
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
3
;
PrivacyInput
input
=
4
;
PrivacyOutput
output
=
5
;
}
message
UTXOGlobalIndex
{
// int64 height = 1;
// int32 txindex = 2;
bytes
txhash
=
3
;
int32
outindex
=
4
;
// int64 height = 1;
// int32 txindex = 2;
bytes
txhash
=
3
;
int32
outindex
=
4
;
}
// privacy input
message
KeyInput
{
int64
amount
=
1
;
repeated
UTXOGlobalIndex
utxoGlobalIndex
=
2
;
bytes
keyImage
=
3
;
int64
amount
=
1
;
repeated
UTXOGlobalIndex
utxoGlobalIndex
=
2
;
bytes
keyImage
=
3
;
}
message
PrivacyInput
{
repeated
KeyInput
keyinput
=
1
;
}
message
PrivacyInput
{
repeated
KeyInput
keyinput
=
1
;
}
// privacy output
message
keyOutput
{
int64
amount
=
1
;
bytes
onetimepubkey
=
2
;
int64
amount
=
1
;
bytes
onetimepubkey
=
2
;
}
message
PrivacyOutput
{
bytes
RpubKeytx
=
1
;
repeated
keyOutput
keyoutput
=
2
;
bytes
RpubKeytx
=
1
;
repeated
keyOutput
keyoutput
=
2
;
}
message
GroupUTXOGlobalIndex
{
int64
amount
=
1
;
repeated
UTXOGlobalIndex
utxoGlobalIndex
=
2
;
int64
amount
=
1
;
repeated
UTXOGlobalIndex
utxoGlobalIndex
=
2
;
}
message
LocalUTXOItem
{
int64
height
=
1
;
int32
txindex
=
2
;
int32
outindex
=
3
;
bytes
txhash
=
4
;
bytes
onetimepubkey
=
5
;
int64
height
=
1
;
int32
txindex
=
2
;
int32
outindex
=
3
;
bytes
txhash
=
4
;
bytes
onetimepubkey
=
5
;
}
message
ReqUTXOPubKeys
{
string
tokenName
=
1
;
repeated
GroupUTXOGlobalIndex
groupUTXOGlobalIndex
=
2
;
string
tokenName
=
1
;
repeated
GroupUTXOGlobalIndex
groupUTXOGlobalIndex
=
2
;
}
// 一个公钥信息
message
PublicKeyData
{
repeated
bytes
data
=
1
;
}
message
PublicKeyData
{
repeated
bytes
data
=
1
;
}
message
GroupUTXOPubKey
{
int64
amount
=
1
;
// 输出签名的所有公钥
repeated
bytes
pubkey
=
2
;
int64
amount
=
1
;
// 输出签名的所有公钥
repeated
bytes
pubkey
=
2
;
}
message
ResUTXOPubKeys
{
repeated
GroupUTXOPubKey
groupUTXOPubKeys
=
1
;
}
message
ResUTXOPubKeys
{
repeated
GroupUTXOPubKey
groupUTXOPubKeys
=
1
;
}
message
ReqPrivacyToken
{
string
token
=
1
;
int64
amount
=
2
;
string
token
=
1
;
int64
amount
=
2
;
}
message
AmountDetail
{
int64
amount
=
1
;
int64
count
=
2
;
int64
amount
=
1
;
int64
count
=
2
;
}
message
ReplyPrivacyAmounts
{
repeated
AmountDetail
amountDetail
=
1
;
}
message
ReplyPrivacyAmounts
{
repeated
AmountDetail
amountDetail
=
1
;
}
message
replyUTXOsOfAmount
{
repeated
LocalUTXOItem
localUTXOItems
=
1
;
}
message
replyUTXOsOfAmount
{
repeated
LocalUTXOItem
localUTXOItems
=
1
;
}
message
ReceiptPrivacyOutput
{
string
token
=
1
;
repeated
keyOutput
keyoutput
=
2
;
string
token
=
1
;
repeated
keyOutput
keyoutput
=
2
;
}
//各种amount额度的UTXO在链上的数量
message
AmountsOfUTXO
{
map
<
int64
,
int64
>
amountMap
=
1
;
}
message
AmountsOfUTXO
{
map
<
int64
,
int64
>
amountMap
=
1
;
}
message
TokenNamesOfUTXO
{
map
<
string
,
string
>
tokensMap
=
1
;
}
message
TokenNamesOfUTXO
{
map
<
string
,
string
>
tokensMap
=
1
;
}
// 用以转换成json后继续可见的结构
message
UTXOGlobalIndex4Print
{
string
txhash
=
1
;
int32
outindex
=
2
;
string
txhash
=
1
;
int32
outindex
=
2
;
}
message
KeyInput4Print
{
int64
amount
=
1
;
repeated
UTXOGlobalIndex4Print
utxoGlobalIndex
=
2
;
string
keyImage
=
3
;
int64
amount
=
1
;
repeated
UTXOGlobalIndex4Print
utxoGlobalIndex
=
2
;
string
keyImage
=
3
;
}
message
keyOutput4Print
{
int64
amount
=
1
;
string
onetimepubkey
=
2
;
int64
amount
=
1
;
string
onetimepubkey
=
2
;
}
message
PrivacyInput4Print
{
repeated
KeyInput4Print
keyinput
=
1
;
}
message
PrivacyInput4Print
{
repeated
KeyInput4Print
keyinput
=
1
;
}
message
PrivacyOutput4Print
{
string
RpubKeytx
=
1
;
repeated
keyOutput4Print
keyoutput
=
2
;
string
RpubKeytx
=
1
;
repeated
keyOutput4Print
keyoutput
=
2
;
}
message
Public2Privacy4Print
{
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyOutput4Print
output
=
7
;
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyOutput4Print
output
=
7
;
}
message
Privacy2Privacy4Print
{
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyInput4Print
input
=
6
;
PrivacyOutput4Print
output
=
7
;
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
5
;
PrivacyInput4Print
input
=
6
;
PrivacyOutput4Print
output
=
7
;
}
message
Privacy2Public4Print
{
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
3
;
PrivacyInput4Print
input
=
4
;
PrivacyOutput4Print
output
=
5
;
string
tokenname
=
1
;
int64
amount
=
2
;
string
note
=
3
;
PrivacyInput4Print
input
=
4
;
PrivacyOutput4Print
output
=
5
;
}
message
PrivacyAction4Print
{
oneof
value
{
Public2Privacy4Print
public2privacy
=
1
;
Privacy2Privacy4Print
privacy2privacy
=
2
;
Privacy2Public4Print
privacy2public
=
3
;
}
int32
ty
=
4
;
oneof
value
{
Public2Privacy4Print
public2privacy
=
1
;
Privacy2Privacy4Print
privacy2privacy
=
2
;
Privacy2Public4Print
privacy2public
=
3
;
}
int32
ty
=
4
;
}
message
ReqPub2Pri
{
//接收人可见公钥A
// string viewPublic = 1;
//接收人花费公钥B
// string spendPublic = 2;
string
tokenname
=
3
;
int64
amount
=
4
;
string
note
=
5
;
//发送人地址
string
sender
=
6
;
int32
mixin
=
7
;
string
pubkeypair
=
8
;
int64
expire
=
9
;
//接收人可见公钥A
// string viewPublic = 1;
//接收人花费公钥B
// string spendPublic = 2;
string
tokenname
=
3
;
int64
amount
=
4
;
string
note
=
5
;
//发送人地址
string
sender
=
6
;
int32
mixin
=
7
;
string
pubkeypair
=
8
;
int64
expire
=
9
;
}
message
ReqPri2Pri
{
//接收人可见公钥A
// string viewPublic = 1; //A
//接收人花费公钥B
// string spendPublic = 2; //B
string
tokenname
=
3
;
int64
amount
=
4
;
string
note
=
5
;
//隐私交易发起人地址
string
sender
=
6
;
int32
mixin
=
7
;
// string txhash = 7;
string
pubkeypair
=
8
;
int64
expire
=
9
;
//接收人可见公钥A
// string viewPublic = 1; //A
//接收人花费公钥B
// string spendPublic = 2; //B
string
tokenname
=
3
;
int64
amount
=
4
;
string
note
=
5
;
//隐私交易发起人地址
string
sender
=
6
;
int32
mixin
=
7
;
// string txhash = 7;
string
pubkeypair
=
8
;
int64
expire
=
9
;
}
message
ReqPri2Pub
{
string
receiver
=
1
;
string
tokenname
=
2
;
int64
amount
=
3
;
string
note
=
4
;
//隐私交易发起人地址
string
sender
=
5
;
int32
mixin
=
6
;
// string txhash = 6;
int64
expire
=
7
;
string
receiver
=
1
;
string
tokenname
=
2
;
int64
amount
=
3
;
string
note
=
4
;
//隐私交易发起人地址
string
sender
=
5
;
int32
mixin
=
6
;
// string txhash = 6;
int64
expire
=
7
;
}
message
ReqCreateUTXOs
{
// string viewPublic = 1; //接收人可见公钥A
// string spendPublic = 2; //接收人花费公钥B
string
tokenname
=
3
;
int64
amount
=
4
;
string
note
=
5
;
string
sender
=
6
;
//发送人地址
int32
count
=
7
;
string
pubkeypair
=
8
;
int64
expire
=
9
;
// string viewPublic = 1; //接收人可见公钥A
// string spendPublic = 2; //接收人花费公钥B
string
tokenname
=
3
;
int64
amount
=
4
;
string
note
=
5
;
string
sender
=
6
;
//发送人地址
int32
count
=
7
;
string
pubkeypair
=
8
;
int64
expire
=
9
;
}
message
ReplyPrivacyPkPair
{
bool
showSuccessful
=
1
;
// string viewPub = 2;
// string spendPub = 3;
string
pubkeypair
=
4
;
bool
showSuccessful
=
1
;
// string viewPub = 2;
// string spendPub = 3;
string
pubkeypair
=
4
;
}
message
ReqPrivBal4AddrToken
{
string
addr
=
1
;
string
token
=
2
;
string
addr
=
1
;
string
token
=
2
;
}
message
ReplyPrivacyBalance
{
string
onetimeaddr
=
1
;
int64
balance
=
2
;
string
onetimeaddr
=
1
;
int64
balance
=
2
;
}
message
PrivacyDBStore
{
bytes
txhash
=
1
;
string
tokenname
=
2
;
int64
amount
=
3
;
int32
outIndex
=
4
;
bytes
txPublicKeyR
=
5
;
bytes
onetimePublicKey
=
6
;
string
owner
=
7
;
int64
height
=
8
;
int32
txindex
=
9
;
bytes
blockhash
=
10
;
bytes
txhash
=
1
;
string
tokenname
=
2
;
int64
amount
=
3
;
int32
outIndex
=
4
;
bytes
txPublicKeyR
=
5
;
bytes
onetimePublicKey
=
6
;
string
owner
=
7
;
int64
height
=
8
;
int32
txindex
=
9
;
bytes
blockhash
=
10
;
}
message
UTXO
{
int64
amount
=
1
;
UTXOBasic
utxoBasic
=
2
;
int64
amount
=
1
;
UTXOBasic
utxoBasic
=
2
;
}
message
UTXOHaveTxHash
{
int64
amount
=
1
;
string
txHash
=
2
;
UTXOBasic
utxoBasic
=
3
;
int64
amount
=
1
;
string
txHash
=
2
;
UTXOBasic
utxoBasic
=
3
;
}
message
UTXOs
{
repeated
UTXO
utxos
=
1
;
}
message
UTXOs
{
repeated
UTXO
utxos
=
1
;
}
message
UTXOHaveTxHashs
{
repeated
UTXOHaveTxHash
utxoHaveTxHashs
=
1
;
}
message
UTXOHaveTxHashs
{
repeated
UTXOHaveTxHash
utxoHaveTxHashs
=
1
;
}
message
ReqUTXOGlobalIndex
{
string
tokenname
=
1
;
int32
mixCount
=
2
;
repeated
int64
amount
=
3
;
string
tokenname
=
1
;
int32
mixCount
=
2
;
repeated
int64
amount
=
3
;
}
message
UTXOBasic
{
UTXOGlobalIndex
utxoGlobalIndex
=
1
;
bytes
onetimePubkey
=
2
;
UTXOGlobalIndex
utxoGlobalIndex
=
1
;
bytes
onetimePubkey
=
2
;
}
message
UTXOIndex4Amount
{
int64
amount
=
1
;
repeated
UTXOBasic
utxos
=
2
;
int64
amount
=
1
;
repeated
UTXOBasic
utxos
=
2
;
}
message
ResUTXOGlobalIndex
{
string
tokenname
=
1
;
int32
mixCount
=
2
;
repeated
UTXOIndex4Amount
utxoIndex4Amount
=
3
;
string
tokenname
=
1
;
int32
mixCount
=
2
;
repeated
UTXOIndex4Amount
utxoIndex4Amount
=
3
;
}
message
FTXOsSTXOsInOneTx
{
string
tokenname
=
1
;
string
sender
=
2
;
// FTXO的超期,设定原则与Transaction.expire一致
int64
expire
=
3
;
string
txhash
=
4
;
repeated
UTXO
utxos
=
5
;
string
tokenname
=
1
;
string
sender
=
2
;
// FTXO的超期,设定原则与Transaction.expire一致
int64
expire
=
3
;
string
txhash
=
4
;
repeated
UTXO
utxos
=
5
;
}
message
RealKeyInput
{
int32
realinputkey
=
1
;
bytes
onetimeprivkey
=
2
;
int32
realinputkey
=
1
;
bytes
onetimeprivkey
=
2
;
}
message
UTXOBasics
{
repeated
UTXOBasic
utxos
=
1
;
}
message
UTXOBasics
{
repeated
UTXOBasic
utxos
=
1
;
}
message
CreateTransactionCache
{
bytes
key
=
1
;
// 记录创建时间,用以处理过期的交易
int64
createtime
=
2
;
// 记录签名成功的时间,用以处理过期交易
int64
signtime
=
3
;
// 缓存状态
// 0 - 创建状态
// 1 - 已经签名状态
int32
status
=
4
;
//
Transaction
transaction
=
5
;
string
sender
=
6
;
repeated
RealKeyInput
realkeyinput
=
7
;
repeated
UTXOBasics
utxos
=
8
;
string
tokenname
=
9
;
bytes
key
=
1
;
// 记录创建时间,用以处理过期的交易
int64
createtime
=
2
;
// 记录签名成功的时间,用以处理过期交易
int64
signtime
=
3
;
// 缓存状态
// 0 - 创建状态
// 1 - 已经签名状态
int32
status
=
4
;
//
Transaction
transaction
=
5
;
string
sender
=
6
;
repeated
RealKeyInput
realkeyinput
=
7
;
repeated
UTXOBasics
utxos
=
8
;
string
tokenname
=
9
;
}
message
ReqCacheTxList
{
string
addr
=
1
;
string
tokenname
=
2
;
string
addr
=
1
;
string
tokenname
=
2
;
}
message
ReplyCacheTxList
{
repeated
Transaction
txs
=
1
;
}
message
ReplyCacheTxList
{
repeated
Transaction
txs
=
1
;
}
message
ReqPrivacyAccount
{
string
tokenname
=
1
;
string
addr
=
2
;
string
tokenname
=
1
;
string
addr
=
2
;
}
message
ReqPPrivacyAccount
{
string
addr
=
1
;
string
token
=
2
;
// 设定显示的数据类型信息
// 0: 只显示账户的数值信息
// 1: 显示UTXO明细
// 2: 显示FTXO明细
// 3: 全部显示
int32
displaymode
=
3
;
string
addr
=
1
;
string
token
=
2
;
// 设定显示的数据类型信息
// 0: 只显示账户的数值信息
// 1: 显示UTXO明细
// 2: 显示FTXO明细
// 3: 全部显示
int32
displaymode
=
3
;
}
// 请求隐私账户信息的应答
message
ReplyPrivacyAccount
{
// 未花费的UTXO
UTXOs
utxos
=
1
;
// 冻结的UTXO
UTXOs
ftxos
=
2
;
int32
displaymode
=
3
;
// 未花费的UTXO
UTXOs
utxos
=
1
;
// 冻结的UTXO
UTXOs
ftxos
=
2
;
int32
displaymode
=
3
;
}
message
ReqCreateCacheTxKey
{
string
tokenname
=
1
;
bytes
hashkey
=
2
;
string
tokenname
=
1
;
bytes
hashkey
=
2
;
}
// get privacy transaction list in wallet
message
ReqPrivacyTransactionList
{
// support BTY
string
tokenname
=
1
;
// 1:sendtx 2:recvtx
int32
sendRecvFlag
=
2
;
int32
direction
=
3
;
int32
count
=
4
;
string
from
=
5
;
string
address
=
6
;
bytes
seedtxhash
=
7
;
// support BTY
string
tokenname
=
1
;
// 1:sendtx 2:recvtx
int32
sendRecvFlag
=
2
;
int32
direction
=
3
;
int32
count
=
4
;
string
from
=
5
;
string
address
=
6
;
bytes
seedtxhash
=
7
;
}
message
ReqRescanUtxos
{
repeated
string
addrs
=
1
;
int32
flag
=
2
;
repeated
string
addrs
=
1
;
int32
flag
=
2
;
}
message
RepRescanResult
{
string
addr
=
1
;
int32
flag
=
2
;
string
addr
=
1
;
int32
flag
=
2
;
}
message
RepRescanUtxos
{
int32
flag
=
1
;
repeated
RepRescanResult
repRescanResults
=
2
;
int32
flag
=
1
;
repeated
RepRescanResult
repRescanResults
=
2
;
}
message
ReqEnablePrivacy
{
repeated
string
addrs
=
2
;
}
message
ReqEnablePrivacy
{
repeated
string
addrs
=
2
;
}
message
PriAddrResult
{
string
addr
=
1
;
bool
IsOK
=
2
;
string
msg
=
3
;
string
addr
=
1
;
bool
IsOK
=
2
;
string
msg
=
3
;
}
message
RepEnablePrivacy
{
repeated
PriAddrResult
results
=
1
;
}
message
RepEnablePrivacy
{
repeated
PriAddrResult
results
=
1
;
}
// 隐私交易三步发送时,临时存储签名需要的数据信息结构
message
PrivacySignatureParam
{
int32
actionType
=
1
;
repeated
UTXOBasics
utxobasics
=
2
;
repeated
RealKeyInput
realKeyInputs
=
3
;
int32
actionType
=
1
;
repeated
UTXOBasics
utxobasics
=
2
;
repeated
RealKeyInput
realKeyInputs
=
3
;
}
message
WalletAccountPrivacy
{
bytes
viewPubkey
=
1
;
bytes
viewPrivKey
=
2
;
bytes
spendPubkey
=
3
;
bytes
spendPrivKey
=
4
;
bytes
viewPubkey
=
1
;
bytes
viewPrivKey
=
2
;
bytes
spendPubkey
=
3
;
bytes
spendPrivKey
=
4
;
}
service
privacy
{
// Privacy Trading
// 显示指定地址的公钥对信息,可以作为后续交易参数
rpc
ShowPrivacyKey
(
ReqString
)
returns
(
ReplyPrivacyPkPair
)
{}
// 创建一系列UTXO
rpc
CreateUTXOs
(
ReqCreateUTXOs
)
returns
(
Reply
)
{}
// 将资金从公开到隐私转移
rpc
MakeTxPublic2Privacy
(
ReqPub2Pri
)
returns
(
Reply
)
{}
// 将资产从隐私到隐私进行转移
rpc
MakeTxPrivacy2Privacy
(
ReqPri2Pri
)
returns
(
Reply
)
{}
// 将资产从隐私到公开进行转移
rpc
MakeTxPrivacy2Public
(
ReqPri2Pub
)
returns
(
Reply
)
{}
// 扫描UTXO以及获取扫描UTXO后的状态
rpc
RescanUtxos
(
ReqRescanUtxos
)
returns
(
RepRescanUtxos
)
{}
// 使能隐私账户
rpc
EnablePrivacy
(
ReqEnablePrivacy
)
returns
(
RepEnablePrivacy
)
{}
// 创建隐私交易
rpc
CreateRawTransaction
(
ReqCreateTransaction
)
returns
(
Transaction
)
{}
// Privacy Trading
// 显示指定地址的公钥对信息,可以作为后续交易参数
rpc
ShowPrivacyKey
(
ReqString
)
returns
(
ReplyPrivacyPkPair
)
{}
// 创建一系列UTXO
rpc
CreateUTXOs
(
ReqCreateUTXOs
)
returns
(
Reply
)
{}
// 将资金从公开到隐私转移
rpc
MakeTxPublic2Privacy
(
ReqPub2Pri
)
returns
(
Reply
)
{}
// 将资产从隐私到隐私进行转移
rpc
MakeTxPrivacy2Privacy
(
ReqPri2Pri
)
returns
(
Reply
)
{}
// 将资产从隐私到公开进行转移
rpc
MakeTxPrivacy2Public
(
ReqPri2Pub
)
returns
(
Reply
)
{}
// 扫描UTXO以及获取扫描UTXO后的状态
rpc
RescanUtxos
(
ReqRescanUtxos
)
returns
(
RepRescanUtxos
)
{}
// 使能隐私账户
rpc
EnablePrivacy
(
ReqEnablePrivacy
)
returns
(
RepEnablePrivacy
)
{}
// 创建隐私交易
rpc
CreateRawTransaction
(
ReqCreateTransaction
)
returns
(
Transaction
)
{}
}
\ No newline at end of file
plugin/dapp/relay/proto/relay.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/retrieve/proto/retrieve.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/ticket/proto/ticket.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/token/cmd/signatory-server/signatory/config.proto
View file @
820571b3
...
...
@@ -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
;
}
plugin/dapp/token/proto/token.proto
View file @
820571b3
...
...
@@ -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
plugin/dapp/trade/proto/trade.proto
View file @
820571b3
...
...
@@ -7,164 +7,180 @@ package types;
// trade 交易部分
//
message
Trade
{
oneof
value
{
TradeForSell
sellLimit
=
1
;
TradeForBuy
buyMarket
=
2
;
TradeForRevokeSell
revokeSell
=
3
;
TradeForBuyLimit
buyLimit
=
5
;
TradeForSellMarket
sellMarket
=
6
;
TradeForRevokeBuy
revokeBuy
=
7
;
}
int32
ty
=
4
;
oneof
value
{
TradeForSell
sellLimit
=
1
;
TradeForBuy
buyMarket
=
2
;
TradeForRevokeSell
revokeSell
=
3
;
TradeForBuyLimit
buyLimit
=
5
;
TradeForSellMarket
sellMarket
=
6
;
TradeForRevokeBuy
revokeBuy
=
7
;
}
int32
ty
=
4
;
}
// 创建众筹交易,确定一手交易的token的数量,单价以及总共有多少手token可以进行众筹
message
TradeForSell
{
string
tokenSymbol
=
1
;
// 每一手出售的token的数量
int64
amountPerBoardlot
=
2
;
// 起卖手数,必须达到这个门槛才允许进行交易
int64
minBoardlot
=
3
;
// 每一手token的价格
int64
pricePerBoardlot
=
4
;
int64
totalBoardlot
=
5
;
// 此次出售的起始时间,如果非众筹则可以忽略此时间
int64
starttime
=
6
;
int64
stoptime
=
7
;
bool
crowdfund
=
8
;
// 资产来源
string
assetExec
=
9
;
string
tokenSymbol
=
1
;
// 每一手出售的token的数量
int64
amountPerBoardlot
=
2
;
// 起卖手数,必须达到这个门槛才允许进行交易
int64
minBoardlot
=
3
;
// 每一手token的价格
int64
pricePerBoardlot
=
4
;
int64
totalBoardlot
=
5
;
// 此次出售的起始时间,如果非众筹则可以忽略此时间
int64
starttime
=
6
;
int64
stoptime
=
7
;
bool
crowdfund
=
8
;
// 资产来源
string
assetExec
=
9
;
}
// 购买者发起交易用来购买token持有者之前挂单出售的token
// 其中的hash为token出售者发起出售交易的hash
message
TradeForBuy
{
string
sellID
=
1
;
int64
boardlotCnt
=
2
;
string
sellID
=
1
;
int64
boardlotCnt
=
2
;
}
// 允许token的持有者撤销之前未成交出售token的挂单
message
TradeForRevokeSell
{
string
sellID
=
1
;
}
message
TradeForRevokeSell
{
string
sellID
=
1
;
}
// 限价买单构造请求
message
TradeForBuyLimit
{
string
tokenSymbol
=
1
;
int64
amountPerBoardlot
=
2
;
int64
minBoardlot
=
3
;
int64
pricePerBoardlot
=
4
;
int64
totalBoardlot
=
5
;
string
assetExec
=
6
;
string
tokenSymbol
=
1
;
int64
amountPerBoardlot
=
2
;
int64
minBoardlot
=
3
;
int64
pricePerBoardlot
=
4
;
int64
totalBoardlot
=
5
;
string
assetExec
=
6
;
}
// 现价卖单
message
TradeForSellMarket
{
string
buyID
=
1
;
int64
boardlotCnt
=
2
;
string
buyID
=
1
;
int64
boardlotCnt
=
2
;
}
// 撤销买单
message
TradeForRevokeBuy
{
string
buyID
=
1
;
}
message
TradeForRevokeBuy
{
string
buyID
=
1
;
}
// 数据库部分
message
SellOrder
{
string
tokenSymbol
=
1
;
string
address
=
2
;
//每一手出售的token的数量
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
//每一手token的价格
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
soldBoardlot
=
7
;
//此次出售的起始时间,如果非众筹则可以忽略此时间
int64
starttime
=
8
;
int64
stoptime
=
9
;
bool
crowdfund
=
10
;
//此处使用tx的hash来指定
string
sellID
=
11
;
int32
status
=
12
;
int64
height
=
13
;
string
assetExec
=
14
;
string
tokenSymbol
=
1
;
string
address
=
2
;
//每一手出售的token的数量
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
//每一手token的价格
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
soldBoardlot
=
7
;
//此次出售的起始时间,如果非众筹则可以忽略此时间
int64
starttime
=
8
;
int64
stoptime
=
9
;
bool
crowdfund
=
10
;
//此处使用tx的hash来指定
string
sellID
=
11
;
int32
status
=
12
;
int64
height
=
13
;
string
assetExec
=
14
;
}
// 限价买单数据库记录
message
BuyLimitOrder
{
string
tokenSymbol
=
1
;
string
address
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
boughtBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
int64
height
=
10
;
string
assetExec
=
11
;
string
tokenSymbol
=
1
;
string
address
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
boughtBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
int64
height
=
10
;
string
assetExec
=
11
;
}
// 执行器日志部分
message
ReceiptBuyBase
{
string
tokenSymbol
=
1
;
string
owner
=
2
;
string
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
string
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
boughtBoardlot
=
7
;
string
buyID
=
8
;
string
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
assetExec
=
13
;
string
tokenSymbol
=
1
;
string
owner
=
2
;
string
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
string
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
boughtBoardlot
=
7
;
string
buyID
=
8
;
string
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
assetExec
=
13
;
}
message
ReceiptSellBase
{
string
tokenSymbol
=
1
;
string
owner
=
2
;
//每一手出售的token的数量
string
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
//每一手token的价格
string
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
soldBoardlot
=
7
;
//此次出售的起始时间,如果非众筹则可以忽略此时间
int64
starttime
=
8
;
int64
stoptime
=
9
;
bool
crowdfund
=
10
;
//此处使用tx的hash来指定
string
sellID
=
11
;
string
status
=
12
;
// buyid
string
buyID
=
13
;
string
txHash
=
14
;
int64
height
=
15
;
string
assetExec
=
16
;
string
tokenSymbol
=
1
;
string
owner
=
2
;
//每一手出售的token的数量
string
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
//每一手token的价格
string
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
soldBoardlot
=
7
;
//此次出售的起始时间,如果非众筹则可以忽略此时间
int64
starttime
=
8
;
int64
stoptime
=
9
;
bool
crowdfund
=
10
;
//此处使用tx的hash来指定
string
sellID
=
11
;
string
status
=
12
;
// buyid
string
buyID
=
13
;
string
txHash
=
14
;
int64
height
=
15
;
string
assetExec
=
16
;
}
message
ReceiptTradeBuyMarket
{
ReceiptBuyBase
base
=
1
;
}
message
ReceiptTradeBuyMarket
{
ReceiptBuyBase
base
=
1
;
}
message
ReceiptTradeBuyLimit
{
ReceiptBuyBase
base
=
1
;
}
message
ReceiptTradeBuyLimit
{
ReceiptBuyBase
base
=
1
;
}
message
ReceiptTradeBuyRevoke
{
ReceiptBuyBase
base
=
1
;
}
message
ReceiptTradeBuyRevoke
{
ReceiptBuyBase
base
=
1
;
}
message
ReceiptTradeSellLimit
{
ReceiptSellBase
base
=
1
;
}
message
ReceiptTradeSellLimit
{
ReceiptSellBase
base
=
1
;
}
message
ReceiptSellMarket
{
ReceiptSellBase
base
=
1
;
}
message
ReceiptSellMarket
{
ReceiptSellBase
base
=
1
;
}
message
ReceiptTradeSellRevoke
{
ReceiptSellBase
base
=
1
;
}
message
ReceiptTradeSellRevoke
{
ReceiptSellBase
base
=
1
;
}
// 查询部分
message
ReqAddrAssets
{
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
;
}
// 获取Token未完成卖单的交易列表
...
...
@@ -173,100 +189,106 @@ message ReqAddrAssets {
// :获取交易列表的个数。 direction :查找方式;0,上一页;1,下一页。
// 越靠后的也单价越贵
message
ReqTokenSellOrder
{
string
tokenSymbol
=
1
;
string
fromKey
=
2
;
int32
count
=
3
;
int32
direction
=
4
;
int32
status
=
5
;
string
tokenSymbol
=
1
;
string
fromKey
=
2
;
int32
count
=
3
;
int32
direction
=
4
;
int32
status
=
5
;
}
message
ReqTokenBuyOrder
{
string
tokenSymbol
=
1
;
string
fromKey
=
2
;
int32
count
=
3
;
int32
direction
=
4
;
int32
status
=
5
;
string
tokenSymbol
=
1
;
string
fromKey
=
2
;
int32
count
=
3
;
int32
direction
=
4
;
int32
status
=
5
;
}
message
ReplyBuyOrder
{
string
tokenSymbol
=
1
;
string
owner
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
boughtBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
key
=
13
;
string
assetExec
=
14
;
string
tokenSymbol
=
1
;
string
owner
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
boughtBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
key
=
13
;
string
assetExec
=
14
;
}
message
ReplySellOrder
{
string
tokenSymbol
=
1
;
string
owner
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
soldBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
key
=
13
;
string
assetExec
=
14
;
string
tokenSymbol
=
1
;
string
owner
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
soldBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
key
=
13
;
string
assetExec
=
14
;
}
message
ReplySellOrders
{
repeated
ReplySellOrder
sellOrders
=
1
;
}
message
ReplySellOrders
{
repeated
ReplySellOrder
sellOrders
=
1
;
}
message
ReplyBuyOrders
{
repeated
ReplyBuyOrder
buyOrders
=
1
;
}
message
ReplyBuyOrders
{
repeated
ReplyBuyOrder
buyOrders
=
1
;
}
message
ReplyTradeOrder
{
string
tokenSymbol
=
1
;
string
owner
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
tradedBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
key
=
13
;
int64
blockTime
=
14
;
bool
isSellOrder
=
15
;
string
assetExec
=
16
;
string
tokenSymbol
=
1
;
string
owner
=
2
;
int64
amountPerBoardlot
=
3
;
int64
minBoardlot
=
4
;
int64
pricePerBoardlot
=
5
;
int64
totalBoardlot
=
6
;
int64
tradedBoardlot
=
7
;
string
buyID
=
8
;
int32
status
=
9
;
string
sellID
=
10
;
string
txHash
=
11
;
int64
height
=
12
;
string
key
=
13
;
int64
blockTime
=
14
;
bool
isSellOrder
=
15
;
string
assetExec
=
16
;
}
message
ReplyTradeOrders
{
repeated
ReplyTradeOrder
orders
=
1
;
}
message
ReplyTradeOrders
{
repeated
ReplyTradeOrder
orders
=
1
;
}
message
ReqSellToken
{
TradeForSell
sell
=
1
;
string
owner
=
2
;
TradeForSell
sell
=
1
;
string
owner
=
2
;
}
message
ReqRevokeSell
{
TradeForRevokeSell
revoke
=
1
;
string
owner
=
2
;
TradeForRevokeSell
revoke
=
1
;
string
owner
=
2
;
}
message
ReqBuyToken
{
TradeForBuy
buy
=
1
;
string
buyer
=
2
;
TradeForBuy
buy
=
1
;
string
buyer
=
2
;
}
service
trade
{
rpc
CreateRawTradeSellTx
(
TradeForSell
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeBuyTx
(
TradeForBuy
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeRevokeTx
(
TradeForRevokeSell
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeBuyLimitTx
(
TradeForBuyLimit
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeSellMarketTx
(
TradeForSellMarket
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeRevokeBuyTx
(
TradeForRevokeBuy
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeSellTx
(
TradeForSell
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeBuyTx
(
TradeForBuy
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeRevokeTx
(
TradeForRevokeSell
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeBuyLimitTx
(
TradeForBuyLimit
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeSellMarketTx
(
TradeForSellMarket
)
returns
(
UnsignTx
)
{}
rpc
CreateRawTradeRevokeBuyTx
(
TradeForRevokeBuy
)
returns
(
UnsignTx
)
{}
}
\ No newline at end of file
plugin/dapp/valnode/proto/tendermint.proto
View file @
820571b3
...
...
@@ -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
;
}
plugin/dapp/valnode/proto/valnode.proto
View file @
820571b3
...
...
@@ -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
plugin/store/mpt/db/node.proto
View file @
820571b3
...
...
@@ -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
;
}
plugin/store/mpt/mpt.go
View file @
820571b3
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment