Search…
Deploy Relays

1. Create configuration files

    Generate configuration file of BMR from ICON --> Moonriver
1
cd $PROJECT_DIR/btp
2
3
make btpsimple
4
# Output binaries of `btpsimple` is placed under bin/ directory.
5
# Add /bin directory to PATH environment variable
6
export BTPSIMPLE=$PROJECT_DIR/btp/bin
7
export PATH=$PATH:$BTPSIMPLE
8
9
chmod +x ./entrypoint.sh
10
11
BTPSIMPLE_CONFIG=$CONFIG_DIR/moon.config.json \
12
BTPSIMPLE_SRC_ADDRESS=$(cat $CONFIG_DIR/btp.icon) \
13
BTPSIMPLE_SRC_ENDPOINT=http://127.0.0.1:9080/api/v3/icon \
14
BTPSIMPLE_DST_ADDRESS=$(cat $CONFIG_DIR/bmc_perif.btp.addr) \
15
BTPSIMPLE_DST_ENDPOINT=ws://localhost:9944 \
16
BTPSIMPLE_OFFSET=$(cat $CONFIG_DIR/moon.offset) \
17
BTPSIMPLE_KEY_STORE=$CONFIG_DIR/moon-bmr.keystore.json \
18
BTPSIMPLE_KEY_SECRET=$CONFIG_DIR/moon-bmr.secret \
19
BTPSIMPLE_LOG_WRITER_FILENAME=$CONFIG_DIR/moon-bmr.log \
20
./entrypoint.sh
Copied!
    Generate configuration file of BMR from Moonriver --> ICON
1
BTPSIMPLE_CONFIG=$CONFIG_DIR/icon.config.json \
2
BTPSIMPLE_SRC_ADDRESS=$(cat $CONFIG_DIR/bmc_perif.btp.addr) \
3
BTPSIMPLE_SRC_ENDPOINT=ws://localhost:9944 \
4
BTPSIMPLE_DST_ADDRESS=$(cat $CONFIG_DIR/btp.icon) \
5
BTPSIMPLE_DST_ENDPOINT=http://127.0.0.1:9080/api/v3/icon \
6
BTPSIMPLE_OFFSET=$(cat $CONFIG_DIR/icon.offset) \
7
BTPSIMPLE_KEY_STORE=$CONFIG_DIR/icon-bmr.keystore.json \
8
BTPSIMPLE_KEY_SECRET=$CONFIG_DIR/icon-bmr.secret \
9
BTPSIMPLE_LOG_WRITER_FILENAME=$CONFIG_DIR/icon-bmr.log \
10
./entrypoint.sh
Copied!
Add "options": {"stepLimit": 50000000000000} into $CONFIG_DIR/icon.config.json. For Example:
1
"dst": {
2
"address": "btp://0x3.icon/cxbcad01c6b50459f0e2110fb90507f30d59f95579",
3
"endpoint": "http://127.0.0.1:9080/api/v3/icon",
4
"options": {
5
"stepLimit": 50000000000000
6
}
7
},
Copied!

2. Start BMRs

Before starting the BMRs, we have to add some "fuels"
    Adding funds to Moonbeam-BMR
1
export MOON_BMR=$(cat $CONFIG_DIR/moon-bmr.addr)
2
cd $PROJECT_DIR/btp/build/contracts/solidity/bmc
3
4
truffle exec $SCRIPT_DIR/mb_fund_bmr.js --network moonbeamlocal
Copied!
    Add funds to ICON-BMR
1
cd $PROJECT_DIR/btp
2
3
AMOUNT=1000000000000000000000000
4
goloop rpc --uri http://127.0.0.1:9080/api/v3/icon sendtx transfer \
5
--to $(cat $CONFIG_DIR/icon-bmr.addr) --value $AMOUNT \
6
--key_store $CONFIG_DIR/goloop.keystore.json \
7
--key_password $(cat $CONFIG_DIR/goloop.keysecret) \
8
--nid $(cat $CONFIG_DIR/nid.icon) \
9
--step_limit 10000000000
10
11
# Check the balance of ICON-BMR
12
goloop rpc --uri http://127.0.0.1:9080/api/v3/icon balance $(cat $CONFIG_DIR/icon-bmr.addr)
Copied!
Now, let start the BMRs
    Start BMR from ICON --> Moonriver
1
$PROJECT_DIR/btp/bin/btpsimple start --config $CONFIG_DIR/moon.config.json
Copied!
    Start BMR from Moonriver --> ICON
1
$PROJECT_DIR/btp/bin/btpsimple start --config $CONFIG_DIR/icon.config.json
Copied!
Last modified 1mo ago