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
e65db8e6
Commit
e65db8e6
authored
Jun 03, 2019
by
mdj33
Committed by
vipwzw
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add height info
parent
3b74cd7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
query.go
plugin/dapp/paracross/executor/query.go
+3
-3
superaccount.go
plugin/dapp/paracross/executor/superaccount.go
+19
-5
paracross.proto
plugin/dapp/paracross/proto/paracross.proto
+4
-2
No files found.
plugin/dapp/paracross/executor/query.go
View file @
e65db8e6
...
@@ -131,7 +131,7 @@ func (p *Paracross) Query_GetNodeGroupStatus(in *pt.ReqParacrossNodeInfo) (types
...
@@ -131,7 +131,7 @@ func (p *Paracross) Query_GetNodeGroupStatus(in *pt.ReqParacrossNodeInfo) (types
//Query_ListNodeGroupStatus list node info by status
//Query_ListNodeGroupStatus list node info by status
func
(
p
*
Paracross
)
Query_ListNodeGroupStatus
(
in
*
pt
.
ReqParacrossNodeInfo
)
(
types
.
Message
,
error
)
{
func
(
p
*
Paracross
)
Query_ListNodeGroupStatus
(
in
*
pt
.
ReqParacrossNodeInfo
)
(
types
.
Message
,
error
)
{
if
in
==
nil
||
in
.
Status
==
0
{
if
in
==
nil
{
return
nil
,
types
.
ErrInvalidParam
return
nil
,
types
.
ErrInvalidParam
}
}
return
listLocalNodeGroupStatus
(
p
.
GetLocalDB
(),
in
.
Status
)
return
listLocalNodeGroupStatus
(
p
.
GetLocalDB
(),
in
.
Status
)
...
@@ -252,7 +252,7 @@ func listNodeStatus(db dbm.KVDB, prefix []byte) (types.Message, error) {
...
@@ -252,7 +252,7 @@ func listNodeStatus(db dbm.KVDB, prefix []byte) (types.Message, error) {
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
resp
.
Addrs
=
append
(
resp
.
Addr
s
,
&
st
)
resp
.
Ids
=
append
(
resp
.
Id
s
,
&
st
)
}
}
return
&
resp
,
nil
return
&
resp
,
nil
}
}
...
@@ -270,7 +270,7 @@ func listNodeGroupStatus(db dbm.KVDB, prefix []byte) (types.Message, error) {
...
@@ -270,7 +270,7 @@ func listNodeGroupStatus(db dbm.KVDB, prefix []byte) (types.Message, error) {
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
resp
.
Addrs
=
append
(
resp
.
Addr
s
,
&
st
)
resp
.
Ids
=
append
(
resp
.
Id
s
,
&
st
)
}
}
return
&
resp
,
nil
return
&
resp
,
nil
}
}
...
...
plugin/dapp/paracross/executor/superaccount.go
View file @
e65db8e6
...
@@ -236,7 +236,8 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -236,7 +236,8 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
TargetAddr
:
config
.
Addr
,
TargetAddr
:
config
.
Addr
,
FromAddr
:
a
.
fromaddr
,
FromAddr
:
a
.
fromaddr
,
Votes
:
&
pt
.
ParaNodeVoteDetail
{},
Votes
:
&
pt
.
ParaNodeVoteDetail
{},
CoinsFrozen
:
config
.
CoinsFrozen
}
CoinsFrozen
:
config
.
CoinsFrozen
,
Height
:
a
.
height
}
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
nil
,
stat
)
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
nil
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
...
@@ -262,7 +263,8 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -262,7 +263,8 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
TargetAddr
:
config
.
Addr
,
TargetAddr
:
config
.
Addr
,
FromAddr
:
a
.
fromaddr
,
FromAddr
:
a
.
fromaddr
,
Votes
:
&
pt
.
ParaNodeVoteDetail
{},
Votes
:
&
pt
.
ParaNodeVoteDetail
{},
CoinsFrozen
:
config
.
CoinsFrozen
}
CoinsFrozen
:
config
.
CoinsFrozen
,
Height
:
a
.
height
}
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
)
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
...
@@ -304,6 +306,7 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -304,6 +306,7 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
}
stat
.
Status
=
pt
.
ParacrossNodeQuiting
stat
.
Status
=
pt
.
ParacrossNodeQuiting
stat
.
Height
=
a
.
height
stat
.
Votes
=
&
pt
.
ParaNodeVoteDetail
{}
stat
.
Votes
=
&
pt
.
ParaNodeVoteDetail
{}
return
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
),
nil
return
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
),
nil
}
}
...
@@ -321,6 +324,7 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -321,6 +324,7 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
}
stat
.
Status
=
pt
.
ParacrossNodeQuited
stat
.
Status
=
pt
.
ParacrossNodeQuited
stat
.
Height
=
a
.
height
stat
.
Votes
=
&
pt
.
ParaNodeVoteDetail
{}
stat
.
Votes
=
&
pt
.
ParaNodeVoteDetail
{}
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
)
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
...
@@ -465,6 +469,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -465,6 +469,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
}
receipt
=
mergeReceipt
(
receipt
,
r
)
receipt
=
mergeReceipt
(
receipt
,
r
)
stat
.
Status
=
pt
.
ParacrossNodeQuited
stat
.
Status
=
pt
.
ParacrossNodeQuited
stat
.
Height
=
a
.
height
if
!
types
.
IsPara
()
{
if
!
types
.
IsPara
()
{
r
,
err
:=
a
.
nodeGroupCoinsActive
(
stat
.
FromAddr
,
stat
.
CoinsFrozen
,
1
)
r
,
err
:=
a
.
nodeGroupCoinsActive
(
stat
.
FromAddr
,
stat
.
CoinsFrozen
,
1
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -480,6 +485,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -480,6 +485,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return
nil
,
err
return
nil
,
err
}
}
stat
.
Status
=
pt
.
ParacrossNodeJoined
stat
.
Status
=
pt
.
ParacrossNodeJoined
stat
.
Height
=
a
.
height
receipt
=
mergeReceipt
(
receipt
,
r
)
receipt
=
mergeReceipt
(
receipt
,
r
)
}
else
if
stat
.
Status
==
pt
.
ParacrossNodeQuiting
{
}
else
if
stat
.
Status
==
pt
.
ParacrossNodeQuiting
{
r
,
err
:=
unpdateNodeGroup
(
a
.
db
,
config
.
Title
,
stat
.
TargetAddr
,
false
)
r
,
err
:=
unpdateNodeGroup
(
a
.
db
,
config
.
Title
,
stat
.
TargetAddr
,
false
)
...
@@ -487,6 +493,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -487,6 +493,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
return
nil
,
err
return
nil
,
err
}
}
stat
.
Status
=
pt
.
ParacrossNodeQuited
stat
.
Status
=
pt
.
ParacrossNodeQuited
stat
.
Height
=
a
.
height
receipt
=
mergeReceipt
(
receipt
,
r
)
receipt
=
mergeReceipt
(
receipt
,
r
)
if
!
types
.
IsPara
()
{
if
!
types
.
IsPara
()
{
...
@@ -666,7 +673,8 @@ func (a *action) nodeGroupApply(config *pt.ParaNodeGroupConfig) (*types.Receipt,
...
@@ -666,7 +673,8 @@ func (a *action) nodeGroupApply(config *pt.ParaNodeGroupConfig) (*types.Receipt,
CoinsFrozen
:
config
.
CoinsFrozen
,
CoinsFrozen
:
config
.
CoinsFrozen
,
MainHeight
:
a
.
exec
.
GetMainHeight
(),
MainHeight
:
a
.
exec
.
GetMainHeight
(),
EmptyBlockInterval
:
config
.
EmptyBlockInterval
,
EmptyBlockInterval
:
config
.
EmptyBlockInterval
,
FromAddr
:
a
.
fromaddr
}
FromAddr
:
a
.
fromaddr
,
Height
:
a
.
height
}
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
nil
,
stat
)
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
nil
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
...
@@ -682,7 +690,8 @@ func (a *action) nodeGroupModify(config *pt.ParaNodeGroupConfig) (*types.Receipt
...
@@ -682,7 +690,8 @@ func (a *action) nodeGroupModify(config *pt.ParaNodeGroupConfig) (*types.Receipt
Title
:
config
.
Title
,
Title
:
config
.
Title
,
CoinsFrozen
:
config
.
CoinsFrozen
,
CoinsFrozen
:
config
.
CoinsFrozen
,
MainHeight
:
a
.
exec
.
GetMainHeight
(),
MainHeight
:
a
.
exec
.
GetMainHeight
(),
EmptyBlockInterval
:
config
.
EmptyBlockInterval
}
EmptyBlockInterval
:
config
.
EmptyBlockInterval
,
Height
:
a
.
height
}
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
nil
,
stat
)
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
nil
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
receipt
.
Logs
=
append
(
receipt
.
Logs
,
r
.
Logs
...
)
...
@@ -721,6 +730,7 @@ func (a *action) nodeGroupQuit(config *pt.ParaNodeGroupConfig) (*types.Receipt,
...
@@ -721,6 +730,7 @@ func (a *action) nodeGroupQuit(config *pt.ParaNodeGroupConfig) (*types.Receipt,
copyStat
:=
*
status
copyStat
:=
*
status
status
.
Status
=
pt
.
ParacrossNodeGroupQuit
status
.
Status
=
pt
.
ParacrossNodeGroupQuit
status
.
Height
=
a
.
height
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
&
copyStat
,
status
)
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
&
copyStat
,
status
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
...
@@ -744,6 +754,7 @@ func (a *action) nodeGroupApproveModify(config *pt.ParaNodeGroupConfig, modify *
...
@@ -744,6 +754,7 @@ func (a *action) nodeGroupApproveModify(config *pt.ParaNodeGroupConfig, modify *
receipt
:=
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
}
receipt
:=
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
}
copyModify
:=
*
modify
copyModify
:=
*
modify
modify
.
Status
=
pt
.
ParacrossNodeGroupApprove
modify
.
Status
=
pt
.
ParacrossNodeGroupApprove
modify
.
Height
=
a
.
height
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
&
copyModify
,
modify
)
r
:=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
&
copyModify
,
modify
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
...
@@ -756,6 +767,7 @@ func (a *action) nodeGroupApproveModify(config *pt.ParaNodeGroupConfig, modify *
...
@@ -756,6 +767,7 @@ func (a *action) nodeGroupApproveModify(config *pt.ParaNodeGroupConfig, modify *
stat
.
CoinsFrozen
=
modify
.
CoinsFrozen
stat
.
CoinsFrozen
=
modify
.
CoinsFrozen
stat
.
EmptyBlockInterval
=
modify
.
EmptyBlockInterval
stat
.
EmptyBlockInterval
=
modify
.
EmptyBlockInterval
stat
.
MainHeight
=
a
.
exec
.
GetMainHeight
()
stat
.
MainHeight
=
a
.
exec
.
GetMainHeight
()
stat
.
Height
=
a
.
height
r
=
makeParaNodeGroupStatusReceipt
(
config
.
Title
,
a
.
fromaddr
,
&
copyStat
,
stat
)
r
=
makeParaNodeGroupStatusReceipt
(
config
.
Title
,
a
.
fromaddr
,
&
copyStat
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
...
@@ -785,6 +797,7 @@ func (a *action) nodeGroupApproveApply(config *pt.ParaNodeGroupConfig, apply *pt
...
@@ -785,6 +797,7 @@ func (a *action) nodeGroupApproveApply(config *pt.ParaNodeGroupConfig, apply *pt
copyStat
:=
*
apply
copyStat
:=
*
apply
apply
.
Status
=
pt
.
ParacrossNodeGroupApprove
apply
.
Status
=
pt
.
ParacrossNodeGroupApprove
apply
.
MainHeight
=
a
.
exec
.
GetMainHeight
()
apply
.
MainHeight
=
a
.
exec
.
GetMainHeight
()
apply
.
Height
=
a
.
height
r
=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
&
copyStat
,
apply
)
r
=
makeNodeGroupIDReceipt
(
a
.
fromaddr
,
&
copyStat
,
apply
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
...
@@ -850,7 +863,8 @@ func (a *action) nodeGroupCreate(status *pt.ParaNodeGroupStatus) *types.Receipt
...
@@ -850,7 +863,8 @@ func (a *action) nodeGroupCreate(status *pt.ParaNodeGroupStatus) *types.Receipt
TargetAddr
:
addr
,
TargetAddr
:
addr
,
Votes
:
&
pt
.
ParaNodeVoteDetail
{
Addrs
:
[]
string
{
a
.
fromaddr
},
Votes
:
[]
string
{
"yes"
}},
Votes
:
&
pt
.
ParaNodeVoteDetail
{
Addrs
:
[]
string
{
a
.
fromaddr
},
Votes
:
[]
string
{
"yes"
}},
CoinsFrozen
:
status
.
CoinsFrozen
,
CoinsFrozen
:
status
.
CoinsFrozen
,
FromAddr
:
status
.
FromAddr
}
FromAddr
:
status
.
FromAddr
,
Height
:
a
.
height
}
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
nil
,
nil
,
stat
)
r
:=
makeNodeConfigReceipt
(
a
.
fromaddr
,
nil
,
nil
,
stat
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
receipt
.
KV
=
append
(
receipt
.
KV
,
r
.
KV
...
)
...
...
plugin/dapp/paracross/proto/paracross.proto
View file @
e65db8e6
...
@@ -74,6 +74,7 @@ message ParaNodeIdStatus {
...
@@ -74,6 +74,7 @@ message ParaNodeIdStatus {
int64
coinsFrozen
=
5
;
int64
coinsFrozen
=
5
;
ParaNodeVoteDetail
votes
=
6
;
ParaNodeVoteDetail
votes
=
6
;
string
fromAddr
=
7
;
string
fromAddr
=
7
;
int64
height
=
8
;
}
}
...
@@ -116,6 +117,7 @@ message ParaNodeGroupStatus {
...
@@ -116,6 +117,7 @@ message ParaNodeGroupStatus {
uint32
emptyBlockInterval
=
6
;
uint32
emptyBlockInterval
=
6
;
int64
mainHeight
=
7
;
int64
mainHeight
=
7
;
string
fromAddr
=
8
;
string
fromAddr
=
8
;
int64
height
=
9
;
}
}
message
ReceiptParaNodeGroupConfig
{
message
ReceiptParaNodeGroupConfig
{
...
@@ -136,11 +138,11 @@ message ReqParacrossNodeInfo {
...
@@ -136,11 +138,11 @@ message ReqParacrossNodeInfo {
}
}
message
RespParacrossNodeAddrs
{
message
RespParacrossNodeAddrs
{
repeated
ParaNodeIdStatus
addr
s
=
1
;
repeated
ParaNodeIdStatus
id
s
=
1
;
}
}
message
RespParacrossNodeGroups
{
message
RespParacrossNodeGroups
{
repeated
ParaNodeGroupStatus
addr
s
=
1
;
repeated
ParaNodeGroupStatus
id
s
=
1
;
}
}
message
ParaBlock2MainMap
{
message
ParaBlock2MainMap
{
...
...
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