Go to file
Kirill Fedoseev 1ab220caf4 Same private keys in both networks. Implementation modifications 2019-07-15 22:41:02 +03:00
demo Same private keys in both networks. Implementation modifications 2019-07-15 22:41:02 +03:00
src Same private keys in both networks. Implementation modifications 2019-07-15 22:41:02 +03:00
.gitignore Same private keys in both networks. Implementation modifications 2019-07-15 22:41:02 +03:00
.gitmodules Demo of ETH-to-BNC bridge 2019-07-07 22:58:35 +03:00
README.md Same private keys in both networks. Implementation modifications 2019-07-15 22:41:02 +03:00

README.md

Ethereum to Binance Chain bridge demo

https://forum.poa.network/t/ethereum-to-binance-chain-bridge/2696

Demo info

This demo, at the beginning, consists of three validator parties, while only two are enough to sign any transaction in the Binance Chain, confirm token transfer on the Ethereum Side, or vote for state changes.

ERC20 Token is used on the Ethereum side of the bridge. All ERC20 tokens are located on address associated with DEPLOY_PRIVATE_KEY.

BNB Token is used on the Binance Chain side.

Running demo:

  1. Build tss from local source.
    docker build -t tss -f ./src/tss/Dockerfile-local ./src/tss
  2. Run test environment (home and side blockchains, contracts deployment) ./demo/start-environment.sh
  3. Run three validators in separate terminal sessions
    N=1 ./demo/validator-demo.sh
    N=2 ./demo/validator-demo.sh
    N=3 ./demo/validator-demo.sh

Interacting with validators, sending votes, retrieving bridge information

  • For each validator, a specific port is mapped outside of the docker container for listening GET requests
    • 5001 - first validator
    • 5002 - second validator
    • 5003 - third validator
  • Retrieving bridge state
  • Voting for bridge state changes

Tools for sending transactions on both sides of the bridge

Run this scripts from src/oracle dir

  • node testBinanceSend.js TO VALUE_TOKEN [VALUE_BNB]
    • TO - receiver address, current bridge address in the Binance Chain
    • VALUE_TOKEN - amount of tokens to send
    • VALUE_BNB - amount of BNB tokens to send, if present, the transaction is considered as a funding one
  • node testEthereumSend.js TO VALUE
    • Approves specified amount of tokens to the bridge account and calls needed method for starting exchange process
    • TO - receiver address in the Binance Chain
    • VALUE - amount of tokens to transfer and exchange