From 02fc8cd1fa908c17456673a7f7f3ea350dea0cdf Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Thu, 24 May 2018 20:20:37 +0300 Subject: [PATCH] support for bridge testbed related parameters in separate file bridge startup script modified to support sourcing of testbed related parameters like config file and database from .env file also, configuration file for local testbed (private local PoA chains) added --- erc20/bridge/local.toml | 35 +++++++++++++++++++++++++++++++++++ erc20/bridge/start_bridge.sh | 9 +++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 erc20/bridge/local.toml diff --git a/erc20/bridge/local.toml b/erc20/bridge/local.toml new file mode 100644 index 0000000..9cea565 --- /dev/null +++ b/erc20/bridge/local.toml @@ -0,0 +1,35 @@ +keystore = "./keys" + +[home] +account = "0xd6d713a71eb3955c680d5967e9bb22298edefcc3" +required_confirmations = 0 +poll_interval = 5 +request_timeout = 360 +rpc_host = "http://127.0.0.1" +rpc_port = 38545 +password = "./keys/d6d713a71eb3955c680d5967e9bb22298edefcc3.pwd" +default_gas_price = 1000000000 + +[foreign] +account = "0xd6d713a71eb3955c680d5967e9bb22298edefcc3" +required_confirmations = 0 +poll_interval = 5 +request_timeout = 360 +rpc_host = "http://127.0.0.1" +rpc_port = 48545 +password = "./keys/d6d713a71eb3955c680d5967e9bb22298edefcc3.pwd" +default_gas_price = 21000000000 +gas_price_oracle_url = "https://gasprice.poa.network/" +gas_price_speed_type = "fast" +gas_price_timeout = 10 + +[authorities] +accounts = [ + "0xd6d713a71eb3955c680d5967e9bb22298edefcc3" +] +required_signatures = 1 + +[transactions] +deposit_relay = { gas = 300000, concurrency = 100 } +withdraw_confirm = { gas = 300000, concurrency = 100 } +withdraw_relay = { gas = 300000, concurrency = 100 } diff --git a/erc20/bridge/start_bridge.sh b/erc20/bridge/start_bridge.sh index 0ed2ff4..cd970fa 100755 --- a/erc20/bridge/start_bridge.sh +++ b/erc20/bridge/start_bridge.sh @@ -3,8 +3,13 @@ BRIDGE_BASE="/home/koal/git-repos/parity-bridge-research/erc20/bridge" TASK="PoA_bridge" BRIDGE_BIN="./bridge" -CONFIG="sokol_ropsten_config_rpc.toml" -DATABASE="sokol_ropsten_db.toml" + +if [ -f "./.env" ]; then + source "./.env" +else + CONFIG="sokol_ropsten_config_rpc.toml" + DATABASE="sokol_ropsten_db.toml" +fi TASK_WORK_DIR="${BRIDGE_BASE}"