Deploy the bridge after you have reconfigured your instance.
1) Generate private keys for the following using MetaMask or MyEtherWallet. Save as json keystore file + password. Note the json location, wallet address, and password for each account.
DEPLOYMENT_ACCOUNT
FOREIGN_ADMIN_BRIDGE
FOREIGN_ADMIN_VALIDATOR
FOREIGN_OWNER
HOME_ADMIN_BRIDGE
HOME_ADMIN_VALIDATOR
HOME_OWNER
VALIDATOR
This data can not be recovered through an account after creation, so be sure to store accurately and safely.
You will need tokens for deployment on the Foreign side of the bridge. This means the DEPLOYMENT_ACCOUNT and VALIDATOR accounts will require tokens. The DEPLOYMENT_ACCOUNT will deploy bridge contracts and initialize the bridge, and VALIDATOR accounts use tokens to pay for txs on the foreign side.
2) Add the following addresses to the Certifier contract using the MyCrypto method described previously.
a) Use the Master of Ceremony
address to call the certify
method in the Certifier
Contract. You will certify the following addresses, completing a separate transaction for each:
VALIDATOR
DEPLOYMENT_ACCOUNT
HOME_OWNER
Certifier ABI: https://raw.githubusercontent.com/parity-contracts/name-registry/master/abis/SimpleCertifier.json
git clone -b develop https://github.com/poanetwork/tokenbridge-contracts.gitcd tokenbridge-contracts
If preferred, use Docker to get the latest image.
docker pull poanetwork/tokenbridge-contracts:latest
The example below uses the DAI Stablecoin for the ERC20_Token_Address. Y Mainnet | Kovan You can select your own token if desired.
If using Docker, create a standalone file and name it erc-to-native.config
Replace all variables templated with tags (<>) with actual values. Learn more about variables here
BRIDGE_MODE=ERC_TO_NATIVEDEPLOYMENT_ACCOUNT_PRIVATE_KEY=<DEPLOYMENT_ACCOUNT_PRIVATE_KEY>DEPLOYMENT_GAS_LIMIT_EXTRA=0.2HOME_DEPLOYMENT_GAS_PRICE=0FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000GET_RECEIPT_INTERVAL_IN_MILLISECONDS=3000#long nameBRIDGEABLE_TOKEN_NAME=TEST#short nameBRIDGEABLE_TOKEN_SYMBOL=TestBRIDGEABLE_TOKEN_DECIMALS=18HOME_RPC_URL=https://<url.to.homenet>HOME_BRIDGE_OWNER=<HOME_OWNER>HOME_VALIDATORS_OWNER=<HOME_ADMIN_VALIDATOR>HOME_UPGRADEABLE_ADMIN=<HOME_ADMIN_BRIDGE>HOME_DAILY_LIMIT=30000000000000000000000000HOME_MAX_AMOUNT_PER_TX=1500000000000000000000000HOME_MIN_AMOUNT_PER_TX=500000000000000000HOME_REQUIRED_BLOCK_CONFIRMATIONS=1HOME_GAS_PRICE=0#Added in a later step#BLOCK_REWARD_ADDRESS=<0x_BLOCK_REWARD_HOME>FOREIGN_RPC_URL=https://<url.to.foreignnet>FOREIGN_BRIDGE_OWNER=<FOREIGN_OWNER>FOREIGN_VALIDATORS_OWNER=<FOREIGN_ADMIN_VALIDATOR>FOREIGN_UPGRADEABLE_ADMIN=<FOREIGN_ADMIN_BRIDGE>FOREIGN_DAILY_LIMIT=15000000000000000000000000FOREIGN_MAX_AMOUNT_PER_TX=750000000000000000000000FOREIGN_MIN_AMOUNT_PER_TX=500000000000000000FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=8FOREIGN_GAS_PRICE=18000000000#for bridge erc_to_erc and erc_to_native mode#mainnetERC20_TOKEN_ADDRESS=0x6b175474e89094c44da98b954eedeac495271d0f#kovan#ERC20_TOKEN_ADDRESS=0xc4375b7de8af5a38a93548eb8453a498222c4ff2#validatorsREQUIRED_NUMBER_OF_VALIDATORS=1#If several validators are used, list them separated by space without quotes#E.g. VALIDATORS=0x 0x 0xVALIDATORS=<address of validator>HOME_REWARDABLE=falseFOREIGN_REWARDABLE=falseDEPLOY_REWARDABLE_TOKEN=false
Optional: If you plan to use Etherscan or BlockScout for exploring your chain, find information on the correct parameters to include in the .env file here: https://docs.tokenbridge.net/about-tokenbridge/features/contracts-verification-in-explorers
There are two options to deploy bridge contracts, you can use npm or docker. If using an official release, we recommend Docker.
Deploy with Docker (here we have named the env file erc-to-native.config
rather than .env). More information on Docker deployment is available here.
docker run -it --env-file ./erc-to-native.config poanetwork/tokenbridge-contracts:latest deploy.sh
npm inpm run compilecd deploynpm inode deploy.js
Next: Deploy Consensus Contracts