Code Monkey home page Code Monkey logo

bsc-relayer's Introduction

Relayer service from BBC to BSC

This is an canonical implementation of bsc-relayer service to relay cross chain packages from Binance Chain to Binance Smart Chain. It can also monitor double sign behavior on BSC and submit evidence to Binance Chain. Community members are encouraged to implement more implementations according to their own requirements.

Disclaimer

The software and related documentation are under active development, all subject to potential future change without notification and not ready for production use. The code and security audit have not been fully completed and not ready for any bug bounty. We advise you to be careful and experiment on the network at your own risk. Stay safe out there.

Quick Start

Note: Requires Go 1.13+

Setup config

  1. Edit config/config.json and input your private key to bsc_config.private_key
  2. Transfer enough BNB to this account:
    1. 100:BNB for relayer register
    2. More than 10:BNB for transaction fee.
  3. If you want to monitor double sign behavior on BSC, you need to fill more than 1 endpoints in bsc_config.monitor_data_seed_list, example monitor_data_seed_list for testnet:
    {
      "monitor_data_seed_list": [
          "wss://data-seed-prebsc-1-s1.binance.org:8545",
          "wss://data-seed-prebsc-2-s1.binance.org:8545",
          "wss://data-seed-prebsc-1-s2.binance.org:8545",
          "wss://data-seed-prebsc-2-s2.binance.org:8545",
          "wss://data-seed-prebsc-1-s3.binance.org:8545",
          "wss://data-seed-prebsc-2-s3.binance.org:8545"
        ]
    }
    Besides, you also need to provide proper Binance Chain mnemonic.

Build

Build Binary:

make build

Build Docker Image

  • Please complete configuration setup in config/config.json first, mainly including rpc endpoints, BSC private key and BC mnemonic(if you want to submit double sign evidence)
  • Docker build command:
docker build -t bsc-relayer:latest .

Run

Run locally:

./build/bsc-relayer --config-type local --config-path config/config.json

Run docker:

docker run -e BBC_NETWORK=1 -e CONFIG_TYPE="local" -d -it bsc-relayer

TroubleShooting

  1. Please fill proper bsc private key to bsc_config.private_key, example private key: 5576779EB3F28F1067BE07AC643A81A8C74E6C55EDE38BEEF68BE1E9D4C1CA3C

    panic: privateKey of Binance Smart Chain should not be empty
    
    goroutine 1 [running]:
    
  2. Please fill your mnemonic to bbc_config.mnemonic, example mnemonic: witness pitch peasant bird year sponsor conduct push enhance melt betray spare police region strategy hammer potato lecture cloud business habit student vehicle allow

    ERROR main missing local mnemonic
    

License

The library is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the LICENSE file.

bsc-relayer's People

Contributors

deepsourcebot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.