Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
524a001b
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
524a001b
编写于
7月 27, 2018
作者:
B
Brian Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Storing off biosNode for cluster to report in status. GH #4903
上级
f681356e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
27 deletion
+28
-27
tests/Cluster.py
tests/Cluster.py
+28
-27
未找到文件。
tests/Cluster.py
浏览文件 @
524a001b
...
...
@@ -180,7 +180,8 @@ class Cluster(object):
return
True
Utils
.
Print
(
"Bootstrap cluster."
)
if
not
Cluster
.
bootstrap
(
totalNodes
,
prodCount
,
Cluster
.
__BiosHost
,
Cluster
.
__BiosPort
,
dontKill
,
onlyBios
):
self
.
biosNode
=
Cluster
.
bootstrap
(
totalNodes
,
prodCount
,
Cluster
.
__BiosHost
,
Cluster
.
__BiosPort
,
dontKill
,
onlyBios
)
if
self
.
biosNode
is
None
:
Utils
.
Print
(
"ERROR: Bootstrap failed."
)
return
False
...
...
@@ -691,13 +692,13 @@ class Cluster(object):
biosNode
=
Node
(
biosHost
,
biosPort
)
if
not
biosNode
.
checkPulse
():
Utils
.
Print
(
"ERROR: Bios node doesn't appear to be running..."
)
return
Fals
e
return
Non
e
producerKeys
=
Cluster
.
parseClusterKeys
(
totalNodes
)
# should have totalNodes node plus bios node
if
producerKeys
is
None
or
len
(
producerKeys
)
<
(
totalNodes
+
1
):
Utils
.
Print
(
"ERROR: Failed to parse private keys from cluster config files."
)
return
Fals
e
return
Non
e
walletMgr
=
WalletMgr
(
True
)
walletMgr
.
killall
()
...
...
@@ -705,7 +706,7 @@ class Cluster(object):
if
not
walletMgr
.
launch
():
Utils
.
Print
(
"ERROR: Failed to launch bootstrap wallet."
)
return
Fals
e
return
Non
e
biosNode
.
setWalletEndpointArgs
(
walletMgr
.
walletEndpointArgs
)
try
:
...
...
@@ -721,7 +722,7 @@ class Cluster(object):
if
not
walletMgr
.
importKey
(
eosioAccount
,
ignWallet
):
Utils
.
Print
(
"ERROR: Failed to import %s account keys into ignition wallet."
%
(
eosioName
))
return
Fals
e
return
Non
e
contract
=
"eosio.bios"
contractDir
=
"contracts/%s"
%
(
contract
)
...
...
@@ -731,7 +732,7 @@ class Cluster(object):
trans
=
biosNode
.
publishContract
(
eosioAccount
.
name
,
contractDir
,
wastFile
,
abiFile
,
waitForTransBlock
=
True
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to publish contract %s."
%
(
contract
))
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
)
...
...
@@ -748,14 +749,14 @@ class Cluster(object):
trans
=
biosNode
.
createAccount
(
initx
,
eosioAccount
,
0
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to create account %s"
%
(
name
))
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
)
accounts
.
append
(
initx
)
transId
=
Node
.
getTransId
(
trans
)
if
not
biosNode
.
waitForTransInBlock
(
transId
):
Utils
.
Print
(
"ERROR: Failed to validate transaction %s got rolled into a block on server port %d."
%
(
transId
,
biosNode
.
port
))
return
Fals
e
return
Non
e
Utils
.
Print
(
"Validating system accounts within bootstrap"
)
biosNode
.
validateAccounts
(
accounts
)
...
...
@@ -772,7 +773,7 @@ class Cluster(object):
myTrans
=
biosNode
.
pushMessage
(
"eosio"
,
"setprods"
,
setProdsStr
,
opts
)
if
myTrans
is
None
or
not
myTrans
[
0
]:
Utils
.
Print
(
"ERROR: Failed to set producers."
)
return
Fals
e
return
Non
e
else
:
counts
=
dict
.
fromkeys
(
range
(
totalNodes
),
0
)
#initialize node prods count to 0
setProdsStr
=
'{"schedule": ['
...
...
@@ -798,54 +799,54 @@ class Cluster(object):
trans
=
biosNode
.
pushMessage
(
"eosio"
,
"setprods"
,
setProdsStr
,
opts
)
if
trans
is
None
or
not
trans
[
0
]:
Utils
.
Print
(
"ERROR: Failed to set producer %s."
%
(
keys
[
"name"
]))
return
Fals
e
return
Non
e
trans
=
trans
[
1
]
transId
=
Node
.
getTransId
(
trans
)
if
not
biosNode
.
waitForTransInBlock
(
transId
):
Utils
.
Print
(
"ERROR: Failed to validate transaction %s got rolled into a block on server port %d."
%
(
transId
,
biosNode
.
port
))
return
Fals
e
return
Non
e
# wait for block production handover (essentially a block produced by anyone but eosio).
lam
=
lambda
:
biosNode
.
getInfo
(
exitOnError
=
True
)[
"head_block_producer"
]
!=
"eosio"
ret
=
Utils
.
waitForBool
(
lam
)
if
not
ret
:
Utils
.
Print
(
"ERROR: Block production handover failed."
)
return
Fals
e
return
Non
e
eosioTokenAccount
=
copy
.
deepcopy
(
eosioAccount
)
eosioTokenAccount
.
name
=
"eosio.token"
trans
=
biosNode
.
createAccount
(
eosioTokenAccount
,
eosioAccount
,
0
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to create account %s"
%
(
eosioTokenAccount
.
name
))
return
Fals
e
return
Non
e
eosioRamAccount
=
copy
.
deepcopy
(
eosioAccount
)
eosioRamAccount
.
name
=
"eosio.ram"
trans
=
biosNode
.
createAccount
(
eosioRamAccount
,
eosioAccount
,
0
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to create account %s"
%
(
eosioRamAccount
.
name
))
return
Fals
e
return
Non
e
eosioRamfeeAccount
=
copy
.
deepcopy
(
eosioAccount
)
eosioRamfeeAccount
.
name
=
"eosio.ramfee"
trans
=
biosNode
.
createAccount
(
eosioRamfeeAccount
,
eosioAccount
,
0
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to create account %s"
%
(
eosioRamfeeAccount
.
name
))
return
Fals
e
return
Non
e
eosioStakeAccount
=
copy
.
deepcopy
(
eosioAccount
)
eosioStakeAccount
.
name
=
"eosio.stake"
trans
=
biosNode
.
createAccount
(
eosioStakeAccount
,
eosioAccount
,
0
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to create account %s"
%
(
eosioStakeAccount
.
name
))
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
)
transId
=
Node
.
getTransId
(
trans
)
if
not
biosNode
.
waitForTransInBlock
(
transId
):
Utils
.
Print
(
"ERROR: Failed to validate transaction %s got rolled into a block on server port %d."
%
(
transId
,
biosNode
.
port
))
return
Fals
e
return
Non
e
contract
=
"eosio.token"
contractDir
=
"contracts/%s"
%
(
contract
)
...
...
@@ -855,7 +856,7 @@ class Cluster(object):
trans
=
biosNode
.
publishContract
(
eosioTokenAccount
.
name
,
contractDir
,
wastFile
,
abiFile
,
waitForTransBlock
=
True
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to publish contract %s."
%
(
contract
))
return
Fals
e
return
Non
e
# Create currency0000, followed by issue currency0000
contract
=
eosioTokenAccount
.
name
...
...
@@ -866,13 +867,13 @@ class Cluster(object):
trans
=
biosNode
.
pushMessage
(
contract
,
action
,
data
,
opts
)
if
trans
is
None
or
not
trans
[
0
]:
Utils
.
Print
(
"ERROR: Failed to push create action to eosio contract."
)
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
[
1
])
transId
=
Node
.
getTransId
(
trans
[
1
])
if
not
biosNode
.
waitForTransInBlock
(
transId
):
Utils
.
Print
(
"ERROR: Failed to validate transaction %s got rolled into a block on server port %d."
%
(
transId
,
biosNode
.
port
))
return
Fals
e
return
Non
e
contract
=
eosioTokenAccount
.
name
Utils
.
Print
(
"push issue action to %s contract"
%
(
contract
))
...
...
@@ -882,7 +883,7 @@ class Cluster(object):
trans
=
biosNode
.
pushMessage
(
contract
,
action
,
data
,
opts
)
if
trans
is
None
or
not
trans
[
0
]:
Utils
.
Print
(
"ERROR: Failed to push issue action to eosio contract."
)
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
[
1
])
Utils
.
Print
(
"Wait for issue action transaction to become finalized."
)
...
...
@@ -892,7 +893,7 @@ class Cluster(object):
timeout
=
.
5
*
12
*
2
*
len
(
producerKeys
)
+
60
if
not
biosNode
.
waitForTransFinalization
(
transId
,
timeout
=
timeout
):
Utils
.
Print
(
"ERROR: Failed to validate transaction %s got rolled into a finalized block on server port %d."
%
(
transId
,
biosNode
.
port
))
return
Fals
e
return
Non
e
expectedAmount
=
"1000000000.0000 {0}"
.
format
(
CORE_SYMBOL
)
Utils
.
Print
(
"Verify eosio issue, Expected: %s"
%
(
expectedAmount
))
...
...
@@ -900,7 +901,7 @@ class Cluster(object):
if
expectedAmount
!=
actualAmount
:
Utils
.
Print
(
"ERROR: Issue verification failed. Excepted %s, actual: %s"
%
(
expectedAmount
,
actualAmount
))
return
Fals
e
return
Non
e
contract
=
"eosio.system"
contractDir
=
"contracts/%s"
%
(
contract
)
...
...
@@ -910,7 +911,7 @@ class Cluster(object):
trans
=
biosNode
.
publishContract
(
eosioAccount
.
name
,
contractDir
,
wastFile
,
abiFile
,
waitForTransBlock
=
True
)
if
trans
is
None
:
Utils
.
Print
(
"ERROR: Failed to publish contract %s."
%
(
contract
))
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
)
...
...
@@ -925,7 +926,7 @@ class Cluster(object):
trans
=
biosNode
.
pushMessage
(
contract
,
action
,
data
,
opts
)
if
trans
is
None
or
not
trans
[
0
]:
Utils
.
Print
(
"ERROR: Failed to transfer funds from %s to %s."
%
(
eosioTokenAccount
.
name
,
name
))
return
Fals
e
return
Non
e
Node
.
validateTransaction
(
trans
[
1
])
...
...
@@ -933,7 +934,7 @@ class Cluster(object):
transId
=
Node
.
getTransId
(
trans
[
1
])
if
not
biosNode
.
waitForTransInBlock
(
transId
):
Utils
.
Print
(
"ERROR: Failed to validate transaction %s got rolled into a block on server port %d."
%
(
transId
,
biosNode
.
port
))
return
Fals
e
return
Non
e
Utils
.
Print
(
"Cluster bootstrap done."
)
finally
:
...
...
@@ -941,7 +942,7 @@ class Cluster(object):
walletMgr
.
killall
()
walletMgr
.
cleanup
()
return
Tru
e
return
biosNod
e
# Populates list of EosInstanceInfo objects, matched to actual running instances
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录