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
52d25840
Commit
52d25840
authored
Dec 21, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add shell
parent
d63b29b1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
43 deletions
+98
-43
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
+26
-0
mainPubilcRelayerTest.sh
.../dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
+27
-16
offlinePublic.sh
plugin/dapp/cross2eth/cmd/build/public/offlinePublic.sh
+32
-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
No files found.
plugin/dapp/cross2eth/boss4x/chain33/offline/doc/deploy_chain33.md
View file @
52d25840
...
...
@@ -146,10 +146,6 @@ multisignAddrs=["168Sn1DXnLrZHTcAM9stD6t2P49fNuJfJ9", "13KTf57aCkVVJYNJBXBBveiA5
15XsGjTbV6SxQtDE1SC5oaHx8HbseQ4Lf9 -- bridge_token 地址
```
***
***
#### 离线多签设置
*
离线创建交易
...
...
plugin/dapp/cross2eth/cmd/build/docker-compose-cross2eth.yml
View file @
52d25840
...
...
@@ -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 @
52d25840
...
...
@@ -8,6 +8,32 @@ set +e
source
"./mainPubilcRelayerTest.sh"
function
start_docker_ebrelayerProxy
()
{
# shellcheck disable=SC2154
cp
'./relayer.toml'
"./relayerproxy.toml"
# 删除配置文件中不需要的字段
for
deleteName
in
"deploy4chain33"
"deployerPrivateKey"
"operatorAddr"
"validatorsAddr"
"initPowers"
"deploy"
"deployerPrivateKey"
"operatorAddr"
"validatorsAddr"
"initPowers"
;
do
delete_line
"./relayerproxy.toml"
"
${
deleteName
}
"
done
pushNameChange
"./relayerproxy.toml"
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
}
"
}
function
setWithdraw
()
{
start_docker_ebrelayerProxy
}
function
AllRelayerMainTest
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
set
+e
...
...
plugin/dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
View file @
52d25840
...
...
@@ -23,9 +23,6 @@ source "./offlinePublic.sh"
ethereumUSDTERC20TokenAddr
=
""
chain33USDTBridgeTokenAddr
=
""
chain33ID
=
0
maturityDegree
=
10
# ETH 部署合约者的私钥 用于部署合约时签名使用
ethDeployAddr
=
"0x8AFDADFC88a1087c9A1D6c0F5Dd04634b87F303a"
ethDeployKey
=
"0x8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230"
...
...
@@ -70,6 +67,15 @@ source "./offlinePublic.sh"
chain33ReceiverAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
chain33ReceiverAddrKey
=
"4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01"
chain33Validatorp
=
"1GTxrmuWiXavhcvsaH5w9whgVxUrWsUMdV"
chain33ValidatorKeyp
=
"0xd627968e445f2a41c92173225791bae1ba42126ae96c32f28f97ff8f226e5c68"
ethValidatorAddrp
=
"0x0c05ba5c230fdaa503b53702af1962e08d0c60bf"
ethValidatorAddrKeyp
=
"9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
chain33ID
=
0
maturityDegree
=
10
validatorPwd
=
"123456"
}
function
start_docker_ebrelayerA
()
{
...
...
@@ -102,22 +108,26 @@ function updata_toml_start_bcd() {
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
}
"
# result=$(${CLI} set_pwd -p 123456hzj)
# cli_ret "${result}" "set_pwd"
#
# result=$(${CLI} unlock -p 123456hzj)
# cli_ret "${result}" "unlock"
#
# # shellcheck disable=SC2154
# result=$(${CLI} chain33 import_privatekey -k "${chain33ValidatorKey}")
# cli_ret "${result}" "chain33 import_privatekey"
#
# # shellcheck disable=SC2154
# result=$(${CLI} ethereum import_privatekey -k "${ethValidatorAddrKey}")
# cli_ret "${result}" "ethereum import_privatekey"
done
}
...
...
@@ -127,7 +137,7 @@ function restart_ebrelayerA() {
sleep
1
start_docker_ebrelayerA
result
=
$(${
CLIA
}
unlock
-p
123456hzj
)
result
=
$(${
CLIA
}
unlock
-p
"
${
validatorPwd
}
"
)
cli_ret
"
${
result
}
"
"unlock"
}
...
...
@@ -841,6 +851,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 @
52d25840
...
...
@@ -73,23 +73,45 @@ 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
"
${
CLI
}
"
"
${
validatorPwd
}
"
"
${
chain33ValidatorKeya
}
"
"
${
ethValidatorAddrKeya
}
"
# result=$(${CLIA} set_pwd -p 123456hzj)
# cli_ret "${result}" "set_pwd"
#
# result=$(${CLIA} unlock -p 123456hzj)
# cli_ret "${result}" "unlock"
#
# # shellcheck disable=SC2154
# result=$(${CLIA} chain33 import_privatekey -k "${chain33ValidatorKeya}")
# cli_ret "${result}" "chain33 import_privatekey"
#
# # shellcheck disable=SC2154
# result=$(${CLIA} ethereum import_privatekey -k "${ethValidatorAddrKeya}")
# cli_ret "${result}" "ethereum import_privatekey"
${
CLIA
}
chain33 multisign set_multiSign
-a
"
${
multisignChain33Addr
}
"
...
...
plugin/dapp/cross2eth/cmd/build/public/publicTest.sh
View file @
52d25840
...
...
@@ -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 @
52d25840
...
...
@@ -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
;
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 地址
...
...
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