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
343a51e3
Commit
343a51e3
authored
Dec 17, 2021
by
QM
Committed by
vipwzw
Dec 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add boss4x offline create_file
parent
bc3473ec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
30 additions
and
11 deletions
+30
-11
build.sh
plugin/dapp/bridgevmxgo/cmd/build.sh
+2
-0
dockerRelayerTestEvm.sh
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
+1
-1
deploy_chain33.toml
plugin/dapp/cross2eth/boss4x/chain33/deploy_chain33.toml
+7
-0
deployCrossX2Chain33.go
.../cross2eth/boss4x/chain33/offline/deployCrossX2Chain33.go
+0
-0
offline.go
plugin/dapp/cross2eth/boss4x/chain33/offline/offline.go
+13
-3
deploy.go
plugin/dapp/cross2eth/boss4x/ethereum/deploy.go
+0
-1
deploy_ethereum.toml
plugin/dapp/cross2eth/boss4x/ethereum/deploy_ethereum.toml
+1
-1
deployCrossX2Eth.go
...app/cross2eth/boss4x/ethereum/offline/deployCrossX2Eth.go
+1
-1
deploy_ethereum.md
.../cross2eth/boss4x/ethereum/offline/doc/deploy_ethereum.md
+2
-2
build.sh
plugin/dapp/cross2eth/cmd/build.sh
+2
-0
mainPubilcRelayerTest.sh
.../dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
+1
-1
relayerPublic.sh
plugin/dapp/cross2eth/cmd/build/public/relayerPublic.sh
+0
-1
No files found.
plugin/dapp/bridgevmxgo/cmd/build.sh
View file @
343a51e3
...
@@ -34,6 +34,8 @@ cp ./build/* "${OUT_DIR}"
...
@@ -34,6 +34,8 @@ cp ./build/* "${OUT_DIR}"
cp
./build/abi/
*
"
${
OUT_DIR
}
"
cp
./build/abi/
*
"
${
OUT_DIR
}
"
cp
../../cross2eth/cmd/build/public/
*
"
${
OUT_DIR
}
"
cp
../../cross2eth/cmd/build/public/
*
"
${
OUT_DIR
}
"
cp
../../cross2eth/cmd/build/abi/
*
"
${
OUT_DIR
}
"
cp
../../cross2eth/cmd/build/abi/
*
"
${
OUT_DIR
}
"
cp
../../cross2eth/boss4x/chain33/deploy_chain33.toml
"
${
OUT_DIR
}
"
cp
../../cross2eth/boss4x/ethereum/deploy_ethereum.toml
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
...
...
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
View file @
343a51e3
...
@@ -230,7 +230,7 @@ function get_evm_cli() {
...
@@ -230,7 +230,7 @@ function get_evm_cli() {
CLID
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerd_1 /root/ebcli_A"
CLID
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerd_1 /root/ebcli_A"
docker_ganachetest_ip
=
$(
get_docker_addr
"
${
dockerNamePrefix
}
_ganachetest_1"
)
docker_ganachetest_ip
=
$(
get_docker_addr
"
${
dockerNamePrefix
}
_ganachetest_1"
)
Boss4xCLI
=
"docker exec
${
dockerNamePrefix
}
_ebrelayera_1 /root/boss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --rpc_laddr_ethereum http://
${
docker_ganachetest_ip
}
:8545 --paraName user.p.para. --chainID
${
chain33ID
}
--chainEthId
0
"
Boss4xCLI
=
"docker exec
${
dockerNamePrefix
}
_ebrelayera_1 /root/boss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --rpc_laddr_ethereum http://
${
docker_ganachetest_ip
}
:8545 --paraName user.p.para. --chainID
${
chain33ID
}
--chainEthId
1337
"
EvmxgoBoss4xCLI
=
"./evmxgoboss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --paraName user.p.para. --chainID
${
chain33ID
}
"
EvmxgoBoss4xCLI
=
"./evmxgoboss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --paraName user.p.para. --chainID
${
chain33ID
}
"
}
}
}
}
...
...
plugin/dapp/cross2eth/boss4x/chain33/deploy_chain33.toml
0 → 100644
View file @
343a51e3
# 验证人地址,至少配置3个以上,即大于等于3个
validatorsAddr
=[
"1N6HstkyLFS8QCeVfdvYxx1xoryXoJtvvZ"
,
"155ooMPBTF8QQsGAknkK7ei5D78rwDEFe6"
,
"13zBdQwuyDh7cKN79oT2odkxYuDbgQiXFv"
,
"113ZzVamKfAtGt9dq45fX1mNsEoDiN95HG"
]
# 验证人权重
initPowers
=[
25
,
25
,
25
,
25
]
# 离线多签地址
multisignAddrs
=[
"168Sn1DXnLrZHTcAM9stD6t2P49fNuJfJ9"
,
"13KTf57aCkVVJYNJBXBBveiA5V811SrLcT"
,
"1JQwQWsShTHC4zxHzbUfYQK4kRBriUQdEe"
,
"1NHuKqoKe3hyv52PF8XBAyaTmJWAqA2Jbb"
]
\ No newline at end of file
plugin/dapp/cross2eth/boss4x/chain33/offline/deployCrossX2Chain33.go
View file @
343a51e3
This diff is collapsed.
Click to expand it.
plugin/dapp/cross2eth/boss4x/chain33/offline/offline.go
View file @
343a51e3
...
@@ -3,6 +3,7 @@ package offline
...
@@ -3,6 +3,7 @@ package offline
import
(
import
(
"encoding/json"
"encoding/json"
"fmt"
"fmt"
tml
"github.com/BurntSushi/toml"
"io/ioutil"
"io/ioutil"
"os"
"os"
"time"
"time"
...
@@ -22,6 +23,7 @@ func Boss4xOfflineCmd() *cobra.Command {
...
@@ -22,6 +23,7 @@ func Boss4xOfflineCmd() *cobra.Command {
}
}
cmd
.
AddCommand
(
cmd
.
AddCommand
(
CreateCrossBridgeCmd
(),
CreateCrossBridgeCmd
(),
CreateContractsWithFileCmd
(),
SendSignTxs2Chain33Cmd
(),
SendSignTxs2Chain33Cmd
(),
CreateERC20Cmd
(),
CreateERC20Cmd
(),
ApproveErc20Cmd
(),
ApproveErc20Cmd
(),
...
@@ -107,9 +109,9 @@ func paraseFile(file string, result interface{}) error {
...
@@ -107,9 +109,9 @@ func paraseFile(file string, result interface{}) error {
return
json
.
Unmarshal
(
b
,
result
)
return
json
.
Unmarshal
(
b
,
result
)
}
}
func
createOfflineTx
(
cmd
*
cobra
.
Command
,
para
[]
byte
,
contractAddr
,
name
string
,
interval
time
.
Duration
)
(
*
utils
.
Chain33OfflineTx
,
error
)
{
func
createOfflineTx
(
txCreateInfo
*
utils
.
TxCreateInfo
,
para
[]
byte
,
contractAddr
,
name
string
,
interval
time
.
Duration
)
(
*
utils
.
Chain33OfflineTx
,
error
)
{
action
:=
&
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
name
,
Para
:
para
,
ContractAddr
:
contractAddr
}
action
:=
&
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
name
,
Para
:
para
,
ContractAddr
:
contractAddr
}
content
,
txHash
,
err
:=
utils
.
CallContractAndSign
(
getTxInfo
(
cmd
)
,
action
,
contractAddr
)
content
,
txHash
,
err
:=
utils
.
CallContractAndSign
(
txCreateInfo
,
action
,
contractAddr
)
if
nil
!=
err
{
if
nil
!=
err
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -126,7 +128,7 @@ func createOfflineTx(cmd *cobra.Command, para []byte, contractAddr, name string,
...
@@ -126,7 +128,7 @@ func createOfflineTx(cmd *cobra.Command, para []byte, contractAddr, name string,
}
}
func
callContractAndSignWrite
(
cmd
*
cobra
.
Command
,
para
[]
byte
,
contractAddr
,
name
string
)
{
func
callContractAndSignWrite
(
cmd
*
cobra
.
Command
,
para
[]
byte
,
contractAddr
,
name
string
)
{
Tx
,
err
:=
createOfflineTx
(
cmd
,
para
,
contractAddr
,
name
,
0
)
Tx
,
err
:=
createOfflineTx
(
getTxInfo
(
cmd
)
,
para
,
contractAddr
,
name
,
0
)
if
nil
!=
err
{
if
nil
!=
err
{
fmt
.
Println
(
"CallContractAndSign"
,
"Failed"
,
err
.
Error
(),
"name"
,
name
)
fmt
.
Println
(
"CallContractAndSign"
,
"Failed"
,
err
.
Error
(),
"name"
,
name
)
return
return
...
@@ -145,3 +147,11 @@ func callContractAndSignWrite(cmd *cobra.Command, para []byte, contractAddr, nam
...
@@ -145,3 +147,11 @@ func callContractAndSignWrite(cmd *cobra.Command, para []byte, contractAddr, nam
fmt
.
Printf
(
"Write all the txs to file: %s
\n
"
,
fileName
)
fmt
.
Printf
(
"Write all the txs to file: %s
\n
"
,
fileName
)
utils
.
WriteToFileInJson
(
fileName
,
txs
)
utils
.
WriteToFileInJson
(
fileName
,
txs
)
}
}
func
InitCfg
(
filepath
string
,
cfg
interface
{})
{
if
_
,
err
:=
tml
.
DecodeFile
(
filepath
,
cfg
);
err
!=
nil
{
fmt
.
Println
(
err
)
os
.
Exit
(
-
1
)
}
return
}
plugin/dapp/cross2eth/boss4x/ethereum/deploy.go
View file @
343a51e3
...
@@ -108,7 +108,6 @@ func DeployContrcts(cmd *cobra.Command, args []string) {
...
@@ -108,7 +108,6 @@ func DeployContrcts(cmd *cobra.Command, args []string) {
}
}
func
InitCfg
(
filepath
string
,
cfg
interface
{})
{
func
InitCfg
(
filepath
string
,
cfg
interface
{})
{
if
_
,
err
:=
tml
.
DecodeFile
(
filepath
,
cfg
);
err
!=
nil
{
if
_
,
err
:=
tml
.
DecodeFile
(
filepath
,
cfg
);
err
!=
nil
{
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
os
.
Exit
(
-
1
)
os
.
Exit
(
-
1
)
...
...
plugin/dapp/cross2eth/boss4x/ethereum/deploy.toml
→
plugin/dapp/cross2eth/boss4x/ethereum/deploy
_ethereum
.toml
View file @
343a51e3
...
@@ -3,7 +3,7 @@ operatorAddr="0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
...
@@ -3,7 +3,7 @@ operatorAddr="0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
# 验证人地址,至少配置3个以上,即大于等于3个
# 验证人地址,至少配置3个以上,即大于等于3个
validatorsAddr
=[
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
,
"0x0df9a824699bc5878232c9e612fe1a5346a5a368"
,
"0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1"
,
"0xd9dab021e74ecf475788ed7b61356056b2095830"
]
validatorsAddr
=[
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
,
"0x0df9a824699bc5878232c9e612fe1a5346a5a368"
,
"0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1"
,
"0xd9dab021e74ecf475788ed7b61356056b2095830"
]
# 验证人权重
# 验证人权重
initPowers
=[
96
,
1
,
1
,
1
]
initPowers
=[
25
,
25
,
25
,
25
]
# 主链symbol
# 主链symbol
symbol
=
"ETH"
symbol
=
"ETH"
# 离线多签地址
# 离线多签地址
...
...
plugin/dapp/cross2eth/boss4x/ethereum/offline/deployCrossX2Eth.go
View file @
343a51e3
...
@@ -505,7 +505,7 @@ func CreateWithFileCmd() *cobra.Command {
...
@@ -505,7 +505,7 @@ func CreateWithFileCmd() *cobra.Command {
}
}
func
addCreateWithFileFlags
(
cmd
*
cobra
.
Command
)
{
func
addCreateWithFileFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"conf"
,
"
c
"
,
""
,
"config file"
)
cmd
.
Flags
()
.
StringP
(
"conf"
,
"
f
"
,
""
,
"config file"
)
_
=
cmd
.
MarkFlagRequired
(
"conf"
)
_
=
cmd
.
MarkFlagRequired
(
"conf"
)
}
}
...
...
plugin/dapp/cross2eth/boss4x/ethereum/offline/doc/deploy_ethereum.md
View file @
343a51e3
...
@@ -50,7 +50,7 @@ tx is written to file: deploytxs.txt
...
@@ -50,7 +50,7 @@ tx is written to file: deploytxs.txt
把交易信息写入文件中
把交易信息写入文件中
```
```
##### 文件部署
##### 文件部署
把要部署需要的数据写入 deploy.toml 配置文件
把要部署需要的数据写入 deploy
_ethereum
.toml 配置文件
```
toml
```
toml
# 合约部署人
# 合约部署人
operatorAddr
=
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
operatorAddr
=
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
...
@@ -65,7 +65,7 @@ multisignAddrs=["0x4c85848a7E2985B76f06a7Ed338FCB3aF94a7DCf", "0x6F163E6daf0090D
...
@@ -65,7 +65,7 @@ multisignAddrs=["0x4c85848a7E2985B76f06a7Ed338FCB3aF94a7DCf", "0x6F163E6daf0090D
```
```
命令:
命令:
```
shell
```
shell
./boss4x ethereum offline create_file
-c
deploy.toml
./boss4x ethereum offline create_file
-c
deploy
_ethereum
.toml
```
```
*
离线签名交易
*
离线签名交易
...
...
plugin/dapp/cross2eth/cmd/build.sh
View file @
343a51e3
...
@@ -30,6 +30,8 @@ cp ../ebrelayer/relayer.toml "${OUT_DIR}/relayer.toml"
...
@@ -30,6 +30,8 @@ cp ../ebrelayer/relayer.toml "${OUT_DIR}/relayer.toml"
cp
./build/
*
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
cp
./build/abi/
*
"
${
OUT_DIR
}
"
cp
./build/abi/
*
"
${
OUT_DIR
}
"
cp
./build/public/
*
"
${
OUT_DIR
}
"
cp
./build/public/
*
"
${
OUT_DIR
}
"
cp
../../cross2eth/boss4x/chain33/deploy_chain33.toml
"
${
OUT_DIR
}
"
cp
../../cross2eth/boss4x/ethereum/deploy_ethereum.toml
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
...
...
plugin/dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
View file @
343a51e3
...
@@ -854,7 +854,7 @@ function get_cli() {
...
@@ -854,7 +854,7 @@ function get_cli() {
CLID
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerd_1 /root/ebcli_A"
CLID
=
"docker exec
${
dockerNamePrefix
}
_ebrelayerd_1 /root/ebcli_A"
docker_ganachetest_ip
=
$(
get_docker_addr
"
${
dockerNamePrefix
}
_ganachetest_1"
)
docker_ganachetest_ip
=
$(
get_docker_addr
"
${
dockerNamePrefix
}
_ganachetest_1"
)
Boss4xCLI
=
"docker exec
${
dockerNamePrefix
}
_ebrelayera_1 /root/boss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --rpc_laddr_ethereum http://
${
docker_ganachetest_ip
}
:8545 --paraName user.p.para. --chainID
${
chain33ID
}
--chainEthId
0
"
Boss4xCLI
=
"docker exec
${
dockerNamePrefix
}
_ebrelayera_1 /root/boss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --rpc_laddr_ethereum http://
${
docker_ganachetest_ip
}
:8545 --paraName user.p.para. --chainID
${
chain33ID
}
--chainEthId
1337
"
}
}
}
}
...
...
plugin/dapp/cross2eth/cmd/build/public/relayerPublic.sh
View file @
343a51e3
...
@@ -53,7 +53,6 @@ CLIA="./ebcli_A"
...
@@ -53,7 +53,6 @@ CLIA="./ebcli_A"
CLIB
=
"./ebcli_B"
CLIB
=
"./ebcli_B"
CLIC
=
"./ebcli_C"
CLIC
=
"./ebcli_C"
CLID
=
"./ebcli_D"
CLID
=
"./ebcli_D"
chain33ID
=
0
function
kill_ebrelayerC
()
{
function
kill_ebrelayerC
()
{
kill_ebrelayer ./relayer_C/ebrelayer
kill_ebrelayer ./relayer_C/ebrelayer
...
...
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