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
0af74d03
Commit
0af74d03
authored
Dec 21, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'withdraw_opt_1217' of github.com:zhengjunhe/plugin into withdraw_opt_1217
parents
e4c0fd52
87de8e4d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
235 additions
and
52 deletions
+235
-52
createERC20.go
plugin/dapp/cross2eth/boss4x/chain33/offline/createERC20.go
+2
-2
deploy_chain33.md
...pp/cross2eth/boss4x/chain33/offline/doc/deploy_chain33.md
+0
-4
docker-compose-cross2eth.yml
plugin/dapp/cross2eth/cmd/build/docker-compose-cross2eth.yml
+1
-1
dockerRelayerTest.sh
plugin/dapp/cross2eth/cmd/build/dockerRelayerTest.sh
+175
-1
mainPubilcRelayerTest.sh
.../dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
+26
-21
offlinePublic.sh
plugin/dapp/cross2eth/cmd/build/public/offlinePublic.sh
+18
-10
publicTest.sh
plugin/dapp/cross2eth/cmd/build/public/publicTest.sh
+3
-3
relayerPublic.sh
plugin/dapp/cross2eth/cmd/build/public/relayerPublic.sh
+9
-9
contracts_test.go
...s2eth/ebrelayer/relayer/ethereum/ethtxs/contracts_test.go
+1
-1
No files found.
plugin/dapp/cross2eth/boss4x/chain33/offline/createERC20.go
View file @
0af74d03
...
...
@@ -239,8 +239,8 @@ func SetWithdrawProxy(cmd *cobra.Command, _ []string) {
parameter
:=
fmt
.
Sprintf
(
"setWithdrawProxy(%s)"
,
withdrawAddr
)
_
,
packData
,
err
:=
evmAbi
.
Pack
(
parameter
,
generated
.
BridgeBankABI
,
false
)
if
nil
!=
err
{
fmt
.
Println
(
"
configOfflineSaveAccount
"
,
"Failed to do abi.Pack due to:"
,
err
.
Error
())
fmt
.
Println
(
"
setWithdrawProxy
"
,
"Failed to do abi.Pack due to:"
,
err
.
Error
())
return
}
callContractAndSignWrite
(
cmd
,
packData
,
contract
,
"
create_bridge_token
"
)
callContractAndSignWrite
(
cmd
,
packData
,
contract
,
"
set_withdraw_proxy
"
)
}
plugin/dapp/cross2eth/boss4x/chain33/offline/doc/deploy_chain33.md
View file @
0af74d03
...
...
@@ -146,10 +146,6 @@ multisignAddrs=["168Sn1DXnLrZHTcAM9stD6t2P49fNuJfJ9", "13KTf57aCkVVJYNJBXBBveiA5
15XsGjTbV6SxQtDE1SC5oaHx8HbseQ4Lf9 -- bridge_token 地址
```
***
***
#### 离线多签设置
*
离线创建交易
...
...
plugin/dapp/cross2eth/cmd/build/docker-compose-cross2eth.yml
View file @
0af74d03
...
...
@@ -5,7 +5,7 @@ services:
entrypoint
:
[
"
node"
,
"
/app/ganache-core.docker.cli.js"
,
"
-a"
,
"
20"
,
"
-b"
,
"
2"
,
"
--debug"
,
"
-m"
,
"
coast
bar
giraffe
art
venue
decide
symbol
law
visual
crater
vital
fold"
,
"
-e"
,
"
1000"
]
image
:
trufflesuite/ganache-cli:latest
ebrelayer
P
roxy
:
ebrelayer
p
roxy
:
build
:
context
:
.
dockerfile
:
Dockerfile-cross2eth
...
...
plugin/dapp/cross2eth/cmd/build/dockerRelayerTest.sh
View file @
0af74d03
...
...
@@ -8,6 +8,179 @@ set +e
source
"./mainPubilcRelayerTest.sh"
function
start_docker_ebrelayerProxy
()
{
updata_toml proxy
# 代理转账中继器中的标志位ProcessWithDraw设置为true
sed
-i
's/^ProcessWithDraw=.*/ProcessWithDraw=true/g'
"./relayerproxy.toml"
# shellcheck disable=SC2154
docker
cp
"./relayerproxy.toml"
"
${
dockerNamePrefix
}
_ebrelayerproxy_1"
:/root/relayer.toml
start_docker_ebrelayer
"
${
dockerNamePrefix
}
_ebrelayerproxy_1"
"/root/ebrelayer"
"./ebrelayerproxy.log"
sleep
1
# shellcheck disable=SC2154
init_validator_relayer
"
${
CLIP
}
"
"
${
validatorPwd
}
"
"
${
chain33ValidatorKeyp
}
"
"
${
ethValidatorAddrKeyp
}
"
}
#strle18="000000000000000000"
#strle6="000000"
function
setWithdraw
()
{
result
=
$(${
CLIP
}
ethereum cfgWithdraw
-f
1
-s
ETH
-a
"500000000000000000000"
)
cli_ret
"
${
result
}
"
"cfgWithdraw"
result
=
$(${
CLIP
}
ethereum cfgWithdraw
-f
1
-s
USDT
-a
"500000000"
)
cli_ret
"
${
result
}
"
"cfgWithdraw"
# 在chain33上的bridgeBank合约中设置proxyReceiver
# shellcheck disable=SC2154
${
Boss4xCLI
}
chain33 offline set_withdraw_proxy
-c
"
${
chain33BridgeBank
}
"
-a
"
${
chain33Validatorsp
}
"
-k
"
${
chain33DeployKey
}
"
-n
"set_withdraw_proxy:
${
chain33Validatorsp
}
"
chain33_offline_send
"set_withdraw_proxy.txt"
}
# eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn
function
TestETH2Chain33Assets_proxy
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum lock
-m
0.002
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
sleep
4
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0.002"
# shellcheck disable=SC2086
sleep
"
${
maturityDegree
}
"
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
# shellcheck disable=SC2154
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# is_equal "${result}" "2000000000000000"
# 原来的数额
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
)
echo
'#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum'
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
chain33 withdraw
-m
0.0003
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
"
${
maturityDegree
}
"
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# is_equal "${result}" "1700000000000000"
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
# cli_ret "${result}" "balance" ".balance" "0.0017"
echo
'#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum 6'
result
=
$(${
CLIA
}
chain33 burn
-m
0.0017
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
"
${
maturityDegree
}
"
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# is_equal "${result}" "0"
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
# cli_ret "${result}" "balance" ".balance" "0"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
)
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
TestETH2Chain33USDT_proxy
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定 USDT 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
# 查询 ETH 这端 bridgeBank 地址原来是 0
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# ETH 这端 lock 12个 USDT
result
=
$(${
CLIA
}
ethereum lock
-m
12
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
sleep
4
# 查询 ETH 这端 bridgeBank 地址 12 USDT
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"12"
sleep
"
${
maturityDegree
}
"
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
# shellcheck disable=SC2154
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 12 * le8
is_equal
"
${
result
}
"
"1200000000"
# 原来的数额 0
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
'#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum'
result
=
$(${
CLIA
}
chain33 burn
-m
5
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USDTBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
"
${
maturityDegree
}
"
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 12-5 * le8
is_equal
"
${
result
}
"
"700000000"
# 查询 ETH 这端 bridgeBank 地址 7
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"7"
# 更新后的金额 5
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
echo
'#5.burn USDT from Chain33 USDT(Chain33)-----> Ethereum'
result
=
$(${
CLIA
}
chain33 burn
-m
7
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USDTBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
"
${
maturityDegree
}
"
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
is_equal
"
${
result
}
"
"0"
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# 更新后的金额 12
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"12"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
TestRelayerProxy
()
{
# start_docker_ebrelayerProxy
setWithdraw
TestETH2Chain33Assets_proxy
# TestETH2Chain33USDT_proxy
}
function
AllRelayerMainTest
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
set
+e
...
...
@@ -34,9 +207,10 @@ function AllRelayerMainTest() {
initPara
StartDockerRelayerDeploy
test_all
TestRelayerProxy
echo_addrs
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
plugin/dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
View file @
0af74d03
...
...
@@ -23,9 +23,6 @@ source "./offlinePublic.sh"
ethereumUSDTERC20TokenAddr
=
""
chain33USDTBridgeTokenAddr
=
""
chain33ID
=
0
maturityDegree
=
10
# ETH 部署合约者的私钥 用于部署合约时签名使用
ethDeployAddr
=
"0x8AFDADFC88a1087c9A1D6c0F5Dd04634b87F303a"
ethDeployKey
=
"0x8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230"
...
...
@@ -70,6 +67,18 @@ source "./offlinePublic.sh"
chain33ReceiverAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
chain33ReceiverAddrKey
=
"4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01"
ethValidatorAddrp
=
"0x0c05ba5c230fdaa503b53702af1962e08d0c60bf"
ethValidatorAddrKeyp
=
"9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
chain33Validatorp
=
"1GTxrmuWiXavhcvsaH5w9whgVxUrWsUMdV"
chain33ValidatorKeyp
=
"0xd627968e445f2a41c92173225791bae1ba42126ae96c32f28f97ff8f226e5c68"
chain33Validatorsp
=
"1Hf1wnnr6XaYy5Sf3HhAfT4N8JYV4sMh9J"
chain33ValidatorKeysp
=
"0x1dadb7cbad8ea3f968cfad40ac32981def6215690618e62c48e816e7c732a8c2"
chain33ID
=
0
maturityDegree
=
10
validatorPwd
=
"123456fzm"
}
function
start_docker_ebrelayerA
()
{
...
...
@@ -79,10 +88,9 @@ function start_docker_ebrelayerA() {
sleep
5
}
# start ebrelayer B C D
function
updata_toml_start_bcd
()
{
for
name
in
b c d
;
do
local
file
=
"./relayer
$name
.toml"
function
updata_toml
()
{
local
name
=
$1
local
file
=
"./relayer
$name
.toml"
cp
'./relayer.toml'
"
${
file
}
"
# 删除配置文件中不需要的字段
...
...
@@ -98,26 +106,23 @@ function updata_toml_start_bcd() {
line
=
$(
delete_line_show
"
${
file
}
"
"pushBind"
)
sed
-i
''
"
${
line
}
"
' a pushBind="'
"
${
pushHost
}
"
':20000"'
"
${
file
}
"
}
# start ebrelayer B C D
function
updata_toml_start_bcd
()
{
for
name
in
b c d
;
do
updata_toml
$name
local
file
=
"./relayer
$name
.toml"
docker
cp
"
${
file
}
"
"
${
dockerNamePrefix
}
_ebrelayer
${
name
}
_1"
:/root/relayer.toml
start_docker_ebrelayer
"
${
dockerNamePrefix
}
_ebrelayer
${
name
}
_1"
"/root/ebrelayer"
"./ebrelayer
${
name
}
.log"
# shellcheck disable=SC2034
CLI
=
"docker exec
${
dockerNamePrefix
}
_ebrelayer
${
name
}
_1 /root/ebcli_A"
result
=
$(${
CLI
}
set_pwd
-p
123456hzj
)
cli_ret
"
${
result
}
"
"set_pwd"
result
=
$(${
CLI
}
unlock
-p
123456hzj
)
cli_ret
"
${
result
}
"
"unlock"
eval
chain33ValidatorKey
=
\$
chain33ValidatorKey
${
name
}
# shellcheck disable=SC2154
result
=
$(${
CLI
}
chain33 import_privatekey
-k
"
${
chain33ValidatorKey
}
"
)
cli_ret
"
${
result
}
"
"chain33 import_privatekey"
eval
ethValidatorAddrKey
=
\$
ethValidatorAddrKey
${
name
}
# shellcheck disable=SC2154
result
=
$(${
CLI
}
ethereum import_privatekey
-k
"
${
ethValidatorAddrKey
}
"
)
cli_ret
"
${
result
}
"
"ethereum import_privatekey"
init_validator_relayer
"
${
CLI
}
"
"
${
validatorPwd
}
"
"
${
chain33ValidatorKey
}
"
"
${
ethValidatorAddrKey
}
"
done
}
...
...
@@ -127,7 +132,7 @@ function restart_ebrelayerA() {
sleep
1
start_docker_ebrelayerA
result
=
$(${
CLIA
}
unlock
-p
123456hzj
)
result
=
$(${
CLIA
}
unlock
-p
"
${
validatorPwd
}
"
)
cli_ret
"
${
result
}
"
"unlock"
}
...
...
@@ -252,7 +257,6 @@ function TestChain33ToEthAssets() {
#}
# eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn
function
TestETH2Chain33Assets
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
...
...
@@ -841,6 +845,7 @@ function get_cli() {
Para8801Cli
=
"./chain33-cli --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --paraName user.p.para."
Para8901Cli
=
"./chain33-cli --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --paraName user.p.para."
CLIP
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerproxy_1 /root/ebcli_A"
CLIA
=
"docker exec
${
dockerNamePrefix
}
_ebrelayera_1 /root/ebcli_A"
CLIB
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerb_1 /root/ebcli_A"
CLIC
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerc_1 /root/ebcli_A"
...
...
plugin/dapp/cross2eth/cmd/build/public/offlinePublic.sh
View file @
0af74d03
...
...
@@ -73,23 +73,31 @@ function OfflineDeploy() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
# shellcheck disable=SC2120
function
InitRelayerA
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
result
=
$(${
CLIA
}
set_pwd
-p
123456hzj
)
# init $1 CLI $2 pwd $3 chain33ValidatorKey $4 ethValidatorAddrKey
function
init_validator_relayer
()
{
local
CLI
=
$1
local pwd
=
$2
local
chain33ValidatorKey
=
$3
local
ethValidatorAddrKey
=
$4
result
=
$(${
CLI
}
set_pwd
-p
"
${
pwd
}
"
)
cli_ret
"
${
result
}
"
"set_pwd"
result
=
$(${
CLI
A
}
unlock
-p
123456hzj
)
result
=
$(${
CLI
}
unlock
-p
"
${
pwd
}
"
)
cli_ret
"
${
result
}
"
"unlock"
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
chain33 import_privatekey
-k
"
${
chain33ValidatorKeya
}
"
)
result
=
$(${
CLI
}
chain33 import_privatekey
-k
"
${
chain33ValidatorKey
}
"
)
cli_ret
"
${
result
}
"
"chain33 import_privatekey"
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum import_privatekey
-k
"
${
ethValidatorAddrKeya
}
"
)
result
=
$(${
CLI
}
ethereum import_privatekey
-k
"
${
ethValidatorAddrKey
}
"
)
cli_ret
"
${
result
}
"
"ethereum import_privatekey"
}
# shellcheck disable=SC2120
function
InitRelayerA
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# shellcheck disable=SC2154
init_validator_relayer
"
${
CLIA
}
"
"
${
validatorPwd
}
"
"
${
chain33ValidatorKeya
}
"
"
${
ethValidatorAddrKeya
}
"
${
CLIA
}
chain33 multisign set_multiSign
-a
"
${
multisignChain33Addr
}
"
...
...
plugin/dapp/cross2eth/cmd/build/public/publicTest.sh
View file @
0af74d03
...
...
@@ -202,7 +202,7 @@ function start_ebrelayer_and_unlock() {
local
CLI
=
"./ebcli_
$1
"
local
count
=
0
while
true
;
do
result
=
$(${
CLI
}
relayer unlock
-p
123456hzj
| jq
-r
.isOK
)
result
=
$(${
CLI
}
relayer unlock
-p
${
validatorPwd
}
| jq
-r
.isOK
)
if
[[
${
result
}
==
"true"
]]
;
then
break
fi
...
...
@@ -225,7 +225,7 @@ function start_ebrelayer_and_setpwd_unlock() {
local
CLI
=
"./ebcli_
$1
"
local
count
=
0
while
true
;
do
result
=
$(${
CLI
}
relayer set_pwd
-p
123456hzj
| jq
-r
.isOK
)
result
=
$(${
CLI
}
relayer set_pwd
-p
${
validatorPwd
}
| jq
-r
.isOK
)
if
[[
${
result
}
==
"true"
]]
;
then
break
fi
...
...
@@ -241,7 +241,7 @@ function start_ebrelayer_and_setpwd_unlock() {
count
=
0
while
true
;
do
result
=
$(${
CLI
}
relayer unlock
-p
123456hzj
| jq
-r
.isOK
)
result
=
$(${
CLI
}
relayer unlock
-p
${
validatorPwd
}
| jq
-r
.isOK
)
if
[[
${
result
}
==
"true"
]]
;
then
break
fi
...
...
plugin/dapp/cross2eth/cmd/build/public/relayerPublic.sh
View file @
0af74d03
...
...
@@ -66,7 +66,7 @@ function kill_ebrelayerD() {
function
start_ebrelayerC
()
{
nohup
./relayer_C/ebrelayer ./relayer_C/relayer.toml
>
./relayer_C/cross2eth_C.log 2>&1 &
sleep
2
${
CLIC
}
unlock
-p
123456hzj
${
CLIC
}
unlock
-p
${
validatorPwd
}
${
Chain33Cli
}
send coins transfer
-a
1
-n
note
-t
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
${
Chain33Cli
}
send coins transfer
-a
1
-n
note
-t
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
sleep
${
maturityDegree
}
...
...
@@ -76,7 +76,7 @@ function start_ebrelayerC() {
function
start_ebrelayerD
()
{
nohup
./relayer_D/ebrelayer ./relayer_D/relayer.toml
>
./relayer_D/cross2eth_D.log 2>&1 &
sleep
2
${
CLID
}
unlock
-p
123456hzj
${
CLID
}
unlock
-p
${
validatorPwd
}
${
Chain33Cli
}
send coins transfer
-a
1
-n
note
-t
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
${
Chain33Cli
}
send coins transfer
-a
1
-n
note
-t
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
sleep
${
maturityDegree
}
...
...
@@ -86,10 +86,10 @@ function start_ebrelayerD() {
function
InitAndDeploy
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
result
=
$(${
CLIA
}
set_pwd
-p
123456hzj
)
result
=
$(${
CLIA
}
set_pwd
-p
${
validatorPwd
}
)
cli_ret
"
${
result
}
"
"set_pwd"
result
=
$(${
CLIA
}
unlock
-p
123456hzj
)
result
=
$(${
CLIA
}
unlock
-p
${
validatorPwd
}
)
cli_ret
"
${
result
}
"
"unlock"
# shellcheck disable=SC2154
...
...
@@ -287,10 +287,10 @@ function updata_toml_start_BCD() {
sleep
2
CLI
=
"./ebcli_
$name
"
result
=
$(${
CLI
}
set_pwd
-p
123456hzj
)
result
=
$(${
CLI
}
set_pwd
-p
${
validatorPwd
}
)
cli_ret
"
${
result
}
"
"set_pwd"
result
=
$(${
CLI
}
unlock
-p
123456hzj
)
result
=
$(${
CLI
}
unlock
-p
${
validatorPwd
}
)
cli_ret
"
${
result
}
"
"unlock"
eval
chain33ValidatorKey
=
\$
chain33ValidatorKey
${
name
}
...
...
@@ -358,7 +358,7 @@ function StartRelayerAndDeploy() {
kill_ebrelayer ebrelayer
start_ebrelayerA
result
=
$(${
CLIA
}
unlock
-p
123456hzj
)
result
=
$(${
CLIA
}
unlock
-p
${
validatorPwd
}
)
cli_ret
"
${
result
}
"
"unlock"
# start ebrelayer B C D
...
...
@@ -424,7 +424,7 @@ function InitChain33Validator() {
}
# 导入 chain33Validators 私钥生成地址
for
name
in
a b c d
;
do
for
name
in
a b c d
p sp
;
do
eval
chain33ValidatorKey
=
\$
chain33ValidatorKey
${
name
}
eval
chain33Validator
=
\$
chain33Validator
${
name
}
result
=
$(${
Chain33Cli
}
account import_key
-k
"
${
chain33ValidatorKey
}
"
-l
validator
$name
)
...
...
@@ -526,7 +526,7 @@ function StartOneRelayer() {
kill_ebrelayer ebrelayer
start_ebrelayerA
result
=
$(${
CLIA
}
unlock
-p
123456hzj
)
result
=
$(${
CLIA
}
unlock
-p
${
validatorPwd
}
)
cli_ret
"
${
result
}
"
"unlock"
# 设置 token 地址
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethtxs/contracts_test.go
View file @
0af74d03
...
...
@@ -29,7 +29,7 @@ import (
var
(
chain33Addr
=
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
//ethAddr = "0x92C8b16aFD6d423652559C6E266cBE1c29Bfd84f"
EthNullAddr
=
"0x0000000000000000000000000000000000000000"
//
EthNullAddr = "0x0000000000000000000000000000000000000000"
)
type
suiteContracts
struct
{
...
...
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