Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
08a09e35
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,发现更多精彩内容 >>
提交
08a09e35
编写于
1月 10, 2018
作者:
C
Ciju John
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved scripts to correct directory. Created path variables for the various executables
上级
0ef7d707
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
47 deletion
+53
-47
tests/CMakeLists.txt
tests/CMakeLists.txt
+5
-3
tests/distributed-transactions-test.py
tests/distributed-transactions-test.py
+0
-0
tests/eosd_run_test.py
tests/eosd_run_test.py
+0
-0
tests/restart-scenarios-test.py
tests/restart-scenarios-test.py
+0
-0
tests/testUtils.py
tests/testUtils.py
+48
-44
未找到文件。
tests/CMakeLists.txt
浏览文件 @
08a09e35
...
...
@@ -61,6 +61,8 @@ endif()
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosd_run_test.sh ${CMAKE_CURRENT_BINARY_DIR}/eosd_run_test.sh COPYONLY)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosd_run_mongodb_test.sh ${CMAKE_CURRENT_BINARY_DIR}/eosd_run_mongodb_test.sh COPYONLY)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_tests/sync/test.sh ${CMAKE_CURRENT_BINARY_DIR}/p2p_tests/sync/test.sh COPYONLY)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run_tests.sh ${CMAKE_CURRENT_BINARY_DIR}/run_tests.sh COPYONLY)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/trans_sync_across_mixed_cluster_test.sh ${CMAKE_CURRENT_BINARY_DIR}/trans_sync_across_mixed_cluster_test.sh COPYONLY)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/run_tests.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/run_tests.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/trans_sync_across_mixed_cluster_test.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/trans_sync_across_mixed_cluster_test.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/distributed-transactions-test.py
${
CMAKE_CURRENT_BINARY_DIR
}
/distributed-transactions-test.py COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/restart-scenarios-test.py
${
CMAKE_CURRENT_BINARY_DIR
}
/restart-scenarios-test.py COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/testUtils.py
${
CMAKE_CURRENT_BINARY_DIR
}
/testUtils.py COPYONLY
)
distributed-transactions-test.py
→
tests/
distributed-transactions-test.py
浏览文件 @
08a09e35
文件已移动
eosd_run_test.py
→
tests/
eosd_run_test.py
浏览文件 @
08a09e35
文件已移动
restart-scenarios-test.py
→
tests/
restart-scenarios-test.py
浏览文件 @
08a09e35
文件已移动
testUtils.py
→
test
s/test
Utils.py
浏览文件 @
08a09e35
...
...
@@ -20,6 +20,10 @@ import json
class
Utils
:
Debug
=
False
FNull
=
open
(
os
.
devnull
,
'w'
)
EosClientPath
=
"programs/eosc/eosc"
EosWalletPath
=
"programs/eos-walletd/eos-walletd"
EosServerPath
=
"programs/eosiod/eosiod"
EosLauncherPath
=
"programs/launcher/launcher"
@
staticmethod
def
Print
(
*
args
,
**
kwargs
):
...
...
@@ -99,7 +103,7 @@ class Node(object):
self
.
endpointArgs
=
"--host %s --port %d %s"
%
(
self
.
host
,
self
.
port
,
args
)
def
getBlock
(
self
,
blockNum
,
silent
=
False
):
cmd
=
"
programs/eosc/eosc %s get block %s"
%
(
self
.
endpointArgs
,
blockNum
)
cmd
=
"
%s %s get block %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
blockNum
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
try
:
retStr
=
Node
.
__checkOutput
(
cmd
.
split
())
...
...
@@ -128,7 +132,7 @@ class Node(object):
return
False
Utils
.
Debug
and
Utils
.
Print
(
"Request transation id %s from node on port %d"
%
(
transId
,
self
.
port
))
cmd
=
"
programs/eosc/eosc %s get transaction %s"
%
(
self
.
endpointArgs
,
transId
)
cmd
=
"
%s %s get transaction %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
transId
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
if
0
!=
subprocess
.
call
(
cmd
.
split
(),
stdout
=
Utils
.
FNull
,
stderr
=
Utils
.
FNull
):
Utils
.
Debug
and
Utils
.
Print
(
"Transaction id %s request failed: "
%
(
transId
))
...
...
@@ -141,7 +145,7 @@ class Node(object):
def
createAccount
(
self
,
account
,
creatorAccount
,
waitForTransBlock
=
False
):
transId
=
None
p
=
re
.
compile
(
'
\n
\s+
\"
transaction_id
\"
:\s+
\"
(\w+)
\"
,
\n
'
,
re
.
MULTILINE
)
cmd
=
"
programs/eosc/eosc %s create account %s %s %s %s"
%
(
self
.
endpointArgs
,
cmd
=
"
%s %s create account %s %s %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
creatorAccount
.
name
,
account
.
name
,
account
.
ownerPublicKey
,
account
.
activePublicKey
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
...
...
@@ -166,7 +170,7 @@ class Node(object):
def
verifyAccount
(
self
,
account
):
try
:
cmd
=
"
programs/eosc/eosc %s get account %s"
%
(
self
.
endpointArgs
,
account
.
name
)
cmd
=
"
%s %s get account %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
account
.
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
ret
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print ("ret:", ret)
...
...
@@ -227,8 +231,8 @@ class Node(object):
def
transferFunds
(
self
,
source
,
destination
,
amount
,
memo
=
"memo"
,
force
=
False
):
transId
=
None
p
=
re
.
compile
(
'
\n
\s+
\"
transaction_id
\"
:\s+
\"
(\w+)
\"
,
\n
'
,
re
.
MULTILINE
)
cmd
=
"
programs/eosc/eosc
%s transfer %s %s %d"
%
(
self
.
endpointArgs
,
source
.
name
,
destination
.
name
,
amount
)
cmd
=
"
%s
%s transfer %s %s %d"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
source
.
name
,
destination
.
name
,
amount
)
cmdArgs
=
cmd
.
split
()
cmdArgs
.
append
(
memo
)
if
force
:
...
...
@@ -276,7 +280,7 @@ class Node(object):
def
getAccountsByKey
(
self
,
key
):
try
:
cmd
=
"
programs/eosc/eosc %s get accounts %s"
%
(
self
.
endpointArgs
,
key
)
cmd
=
"
%s %s get accounts %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
key
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print ("getAccountDetails> %s"% retStr)
...
...
@@ -295,7 +299,7 @@ class Node(object):
def
getServants
(
self
,
name
):
try
:
cmd
=
"
programs/eosc/eosc %s get servants %s"
%
(
self
.
endpointArgs
,
name
)
cmd
=
"
%s %s get servants %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print ("getAccountDetails> %s"% retStr)
...
...
@@ -314,7 +318,7 @@ class Node(object):
def
getEosAccount
(
self
,
name
):
try
:
cmd
=
"
programs/eosc/eosc %s get account %s"
%
(
self
.
endpointArgs
,
name
)
cmd
=
"
%s %s get account %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
Node
.
__checkOutput
(
cmd
.
split
())
#Utils.Print ("getEosAccount> %s"% retStr)
...
...
@@ -336,7 +340,7 @@ class Node(object):
def
getTransactionDetails
(
self
,
transId
):
try
:
cmd
=
"
programs/eosc/eosc %s get transaction %s"
%
(
self
.
endpointArgs
,
transId
)
cmd
=
"
%s %s get transaction %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
transId
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
ret
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print ("getAccountDetails> %s"% ret)
...
...
@@ -370,7 +374,7 @@ class Node(object):
def
getTransactionsByAccount
(
self
,
name
):
try
:
cmd
=
"
programs/eosc/eosc %s get transactions %s"
%
(
self
.
endpointArgs
,
name
)
cmd
=
"
%s %s get transactions %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print ("getAccountDetails> %s"% retStr)
...
...
@@ -394,7 +398,7 @@ class Node(object):
def
getAccountCodeHash
(
self
,
account
):
try
:
cmd
=
"
programs/eosc/eosc %s get code %s"
%
(
self
.
endpointArgs
,
account
)
cmd
=
"
%s %s get code %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
account
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print ("get code> %s"% retStr)
...
...
@@ -419,7 +423,7 @@ class Node(object):
return
retStr
def
publishContract
(
self
,
account
,
wastFile
,
abiFile
,
waitForTransBlock
=
False
,
shouldFail
=
False
):
cmd
=
"
programs/eosc/eosc %s set contract %s %s %s"
%
(
self
.
endpointArgs
,
account
,
wastFile
,
abiFile
)
cmd
=
"
%s %s set contract %s %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
account
,
wastFile
,
abiFile
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
trans
=
None
try
:
...
...
@@ -451,7 +455,7 @@ class Node(object):
return
trans
def
createProducer
(
self
,
account
,
ownerPublicKey
,
waitForTransBlock
=
False
):
cmd
=
"
programs/eosc/eosc %s create producer %s %s"
%
(
self
.
endpointArgs
,
account
,
ownerPublicKey
)
cmd
=
"
%s %s create producer %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
account
,
ownerPublicKey
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
trans
=
None
try
:
...
...
@@ -477,7 +481,7 @@ class Node(object):
def
getTable
(
self
,
account
,
contract
,
table
):
try
:
cmd
=
"
programs/eosc/eosc %s get table %s %s %s"
%
(
self
.
endpointArgs
,
account
,
contract
,
table
)
cmd
=
"
%s %s get table %s %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
account
,
contract
,
table
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
Node
.
__checkOutput
(
cmd
.
split
())
#Utils.Print ("getAccountDetails> %s"% retStr)
...
...
@@ -512,7 +516,7 @@ class Node(object):
def
pushMessage
(
self
,
contract
,
action
,
data
,
opts
):
try
:
cmd
=
"
programs/eosc/eosc %s push message %s %s"
%
(
self
.
endpointArgs
,
contract
,
action
)
cmd
=
"
%s %s push message %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
contract
,
action
)
cmdArgs
=
cmd
.
split
()
if
data
is
not
None
:
cmdArgs
.
append
(
data
)
...
...
@@ -536,8 +540,8 @@ class Node(object):
return
transId
def
setPermission
(
self
,
account
,
code
,
pType
,
requirement
,
waitForTransBlock
=
False
):
cmd
=
"
programs/eosc/eosc
%s set action permission %s %s %s %s"
%
(
self
.
endpointArgs
,
account
,
code
,
pType
,
requirement
)
cmd
=
"
%s
%s set action permission %s %s %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
account
,
code
,
pType
,
requirement
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
trans
=
None
try
:
...
...
@@ -556,7 +560,7 @@ class Node(object):
return
trans
def
getInfo
(
self
):
cmd
=
"
programs/eosc/eosc %s get info"
%
(
self
.
endpointArgs
)
cmd
=
"
%s %s get info"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
try
:
retStr
=
Node
.
__checkOutput
(
cmd
.
split
())
...
...
@@ -608,8 +612,8 @@ class WalletMgr(object):
Utils
.
Print
(
"ERROR: Wallet Manager wasn't configured to launch walletd"
)
return
False
cmd
=
"
programs/eos-walletd/eos-walletd
--data-dir %s --http-server-address=%s:%d"
%
(
WalletMgr
.
__walletDataDir
,
self
.
host
,
self
.
port
)
cmd
=
"
%s
--data-dir %s --http-server-address=%s:%d"
%
(
Utils
.
EosWalletPath
,
WalletMgr
.
__walletDataDir
,
self
.
host
,
self
.
port
)
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
with
open
(
WalletMgr
.
__walletLogFile
,
'w'
)
as
sout
,
open
(
WalletMgr
.
__walletLogFile
,
'w'
)
as
serr
:
popen
=
subprocess
.
Popen
(
cmd
.
split
(),
stdout
=
sout
,
stderr
=
serr
)
...
...
@@ -625,7 +629,7 @@ class WalletMgr(object):
Utils
.
Debug
and
Utils
.
Print
(
"Wallet
\"
%s
\"
already exists. Returning same."
%
name
)
return
wallet
p
=
re
.
compile
(
'
\n\"
(\w+)
\"\n
'
,
re
.
MULTILINE
)
cmd
=
"
programs/eosc/eosc %s wallet create --name %s"
%
(
self
.
endpointArgs
,
name
)
cmd
=
"
%s %s wallet create --name %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print("create: %s" % (retStr))
...
...
@@ -642,8 +646,8 @@ class WalletMgr(object):
def
importKey
(
self
,
account
,
wallet
):
#Utils.Print("Private: ", key.private)
warningMsg
=
"This key is already imported into the wallet"
cmd
=
"
programs/eosc/eosc
%s wallet import --name %s %s"
%
(
self
.
endpointArgs
,
wallet
.
name
,
account
.
ownerPrivateKey
)
cmd
=
"
%s
%s wallet import --name %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
wallet
.
name
,
account
.
ownerPrivateKey
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
try
:
retStr
=
subprocess
.
check_output
(
cmd
.
split
(),
stderr
=
subprocess
.
STDOUT
).
decode
(
"utf-8"
)
...
...
@@ -658,8 +662,8 @@ class WalletMgr(object):
if
account
.
activePrivateKey
is
None
:
Utils
.
Print
(
"WARNING: Active private key is not defined for account
\"
%s
\"
"
%
(
account
.
name
))
else
:
cmd
=
"
programs/eosc/eosc
%s wallet import --name %s %s"
%
(
self
.
endpointArgs
,
wallet
.
name
,
account
.
activePrivateKey
)
cmd
=
"
%s
%s wallet import --name %s %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
wallet
.
name
,
account
.
activePrivateKey
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
try
:
retStr
=
subprocess
.
check_output
(
cmd
.
split
(),
stderr
=
subprocess
.
STDOUT
).
decode
(
"utf-8"
)
...
...
@@ -675,7 +679,7 @@ class WalletMgr(object):
return
True
def
lockWallet
(
self
,
wallet
):
cmd
=
"
programs/eosc/eosc %s wallet lock --name %s"
%
(
self
.
endpointArgs
,
wallet
.
name
)
cmd
=
"
%s %s wallet lock --name %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
wallet
.
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
if
0
!=
subprocess
.
call
(
cmd
.
split
(),
stdout
=
Utils
.
FNull
):
Utils
.
Print
(
"ERROR: Failed to lock wallet %s."
%
(
wallet
.
name
))
...
...
@@ -684,7 +688,7 @@ class WalletMgr(object):
return
True
def
unlockWallet
(
self
,
wallet
):
cmd
=
"
programs/eosc/eosc %s wallet unlock --name %s"
%
(
self
.
endpointArgs
,
wallet
.
name
)
cmd
=
"
%s %s wallet unlock --name %s"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
,
wallet
.
name
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
popen
=
subprocess
.
Popen
(
cmd
.
split
(),
stdout
=
Utils
.
FNull
,
stdin
=
subprocess
.
PIPE
)
popen
.
communicate
(
input
=
wallet
.
password
.
encode
(
"utf-8"
))
...
...
@@ -695,7 +699,7 @@ class WalletMgr(object):
return
True
def
lockAllWallets
(
self
):
cmd
=
"
programs/eosc/eosc %s wallet lock_all"
%
(
self
.
endpointArgs
)
cmd
=
"
%s %s wallet lock_all"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
if
0
!=
subprocess
.
call
(
cmd
.
split
(),
stdout
=
Utils
.
FNull
):
Utils
.
Print
(
"ERROR: Failed to lock all wallets."
)
...
...
@@ -707,7 +711,7 @@ class WalletMgr(object):
wallets
=
[]
p
=
re
.
compile
(
'\s+
\"
(\w+)\s\*
\"
,?
\n
'
,
re
.
MULTILINE
)
cmd
=
"
programs/eosc/eosc %s wallet list"
%
(
self
.
endpointArgs
)
cmd
=
"
%s %s wallet list"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print("retStr: %s" % (retStr))
...
...
@@ -723,7 +727,7 @@ class WalletMgr(object):
keys
=
[]
p
=
re
.
compile
(
'
\n
\s+
\"
(\w+)
\"\n
'
,
re
.
MULTILINE
)
cmd
=
"
programs/eosc/eosc %s wallet keys"
%
(
self
.
endpointArgs
)
cmd
=
"
%s %s wallet keys"
%
(
Utils
.
EosClientPath
,
self
.
endpointArgs
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
retStr
=
subprocess
.
check_output
(
cmd
.
split
()).
decode
(
"utf-8"
)
#Utils.Print("retStr: %s" % (retStr))
...
...
@@ -805,8 +809,8 @@ class Cluster(object):
if
len
(
self
.
nodes
)
>
0
:
raise
RuntimeError
(
"Cluster already running."
)
cmd
=
"
programs/launcher/launcher
-p %s -n %s -s %s -d %s"
%
(
pnodes
,
total_nodes
,
topo
,
delay
)
cmd
=
"
%s
-p %s -n %s -s %s -d %s"
%
(
Utils
.
EosLauncherPath
,
pnodes
,
total_nodes
,
topo
,
delay
)
cmdArr
=
cmd
.
split
()
if
not
self
.
walletd
:
cmdArr
.
append
(
"--eosd"
)
...
...
@@ -884,7 +888,7 @@ class Cluster(object):
p
=
re
.
compile
(
'Private key: (.+)
\n
Public key: (.+)
\n
'
,
re
.
MULTILINE
)
for
i
in
range
(
0
,
count
):
try
:
cmd
=
"
programs/eosc/eosc create key"
cmd
=
"
%s create key"
%
(
Utils
.
EosClientPath
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
keyStr
=
subprocess
.
check_output
(
cmd
.
split
(),
stderr
=
subprocess
.
STDOUT
).
decode
(
"utf-8"
)
m
=
p
.
match
(
keyStr
)
...
...
@@ -895,7 +899,7 @@ class Cluster(object):
ownerPrivate
=
m
.
group
(
1
)
ownerPublic
=
m
.
group
(
2
)
cmd
=
"
programs/eosc/eosc create key"
cmd
=
"
%s create key"
%
(
Utils
.
EosClientPath
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
keyStr
=
subprocess
.
check_output
(
cmd
.
split
(),
stderr
=
subprocess
.
STDOUT
).
decode
(
"utf-8"
)
m
=
p
.
match
(
keyStr
)
...
...
@@ -973,14 +977,14 @@ class Cluster(object):
# # Initialize wallet and import account keys
# def createWallet_old(self, accounts):
# cmd="
programs/eosc/eosc wallet create --name %s" % (
self.__WalletName)
# cmd="
%s wallet create --name %s" % (Utils.EosClientPath,
self.__WalletName)
# Utils.Debug and Utils.Print("cmd: %s" % (cmd))
# if 0 != subprocess.call(cmd.split(), stdout=Utils.FNull):
# Utils.Print("ERROR: Failed to create wallet.")
# return False
# cmd="
programs/eosc/eosc
wallet import --name %s %s" % (
# self.__WalletName, Cluster.initaAccount.ownerPrivateKey)
# cmd="
%s
wallet import --name %s %s" % (
#
Utils.EosClientPath,
self.__WalletName, Cluster.initaAccount.ownerPrivateKey)
# Utils.Debug and Utils.Print("cmd: %s" % (cmd))
# if 0 != subprocess.call(cmd.split(), stdout=Utils.FNull):
# Utils.Print("ERROR: Failed to import account inita key.")
...
...
@@ -992,13 +996,13 @@ class Cluster(object):
# self.accounts=accounts
# for account in self.accounts:
# #Utils.Print("Private: ", key.private)
# cmd="
programs/eosc/eosc wallet import --name %s %s" % (
self.__WalletName, account.ownerPrivateKey)
# cmd="
%s wallet import --name %s %s" % (Utils.EosClientPath,
self.__WalletName, account.ownerPrivateKey)
# Utils.Debug and Utils.Print("cmd: %s" % (cmd))
# if 0 != subprocess.call(cmd.split(), stdout=Utils.FNull):
# Utils.Print("ERROR: Failed to import account owner key.")
# return False
# cmd="
programs/eosc/eosc wallet import --name %s %s" % (
self.__WalletName, account.activePrivateKey)
# cmd="
%s wallet import --name %s %s" % (Utils.EosClientPath,
self.__WalletName, account.activePrivateKey)
# Utils.Debug and Utils.Print("cmd: %s" % (cmd))
# if 0 != subprocess.call(cmd.split(), stdout=Utils.FNull):
# Utils.Print("ERROR: Failed to import account active key.")
...
...
@@ -1126,8 +1130,8 @@ class Cluster(object):
# def createAccount(self, accountInfo):
# transId=None
# p = re.compile('\n\s+\"transaction_id\":\s+\"(\w+)\",\n', re.MULTILINE)
# cmd="
programs/eosc/eosc
create account %s %s %s %s" % (
# Cluster.initaAccount.name, accountInfo.name, accountInfo.ownerPublicKey,
# cmd="
%s
create account %s %s %s %s" % (
#
Utils.EosClientPath,
Cluster.initaAccount.name, accountInfo.name, accountInfo.ownerPublicKey,
# accountInfo.activePublicKey)
# Utils.Debug and Utils.Print("cmd: %s" % (cmd))
# try:
...
...
@@ -1145,7 +1149,7 @@ class Cluster(object):
# return None
# try :
# cmd="
programs/eosc/eosc get account %s" % (
accountInfo.name)
# cmd="
%s get account %s" % (Utils.EosClientPath,
accountInfo.name)
# Utils.Debug and Utils.Print("cmd: %s" % (cmd))
# ret=subprocess.check_output(cmd.split()).decode("utf-8")
# #Utils.Print ("ret:", ret)
...
...
@@ -1260,7 +1264,7 @@ class Cluster(object):
shutil
.
copyfileobj
(
f
,
sys
.
stdout
)
def
killall
(
self
):
cmd
=
"
programs/launcher/launcher -k 15"
cmd
=
"
%s -k 15"
%
(
Utils
.
EosLauncherPath
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: %s"
%
(
cmd
))
if
0
!=
subprocess
.
call
(
cmd
.
split
(),
stdout
=
Utils
.
FNull
):
Utils
.
Print
(
"Launcher failed to shut down eos cluster."
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录