Git Product home page Git Product logo

chainbridge-core-example's Introduction

ChainBridge-core example

discord

Sygma example is the repository that show an example of running Bridge with chainbridge-core framework.

UPDATED: This service is used to bridge assets between CPay-Testnet(EVM) and Geth(EVM).

  1. Installation
  2. Global Flags
  3. Usage
  4. Documentation

Installation

Refer to installation guide for assistance in installing.

Prerequisite (UPDATED)

Refer to Go-Ethereum guide for spin-up new local network

Global Flags

Though the EVM-CLI and Celo-CLI may differ in their implementation of subcommands, both modules share global flag values.

These global flags are so-called due to their presence in every sucommand, irrespective of their relevance to the subcommand.

In situations where the global flag values are not needed or are otherwise irrelevant, ie passing a --gasLimit flag when the accounts generate subcommand is invoked, the flag will be ignored.

Global Flags:
      --gasLimit uint               gasLimit used in transactions (default 6721975)
      --gasPrice uint               gasPrice used for transactions (default 20000000000)
      --jsonWallet string           Encrypted JSON wallet
      --jsonWalletPassword string   Password for encrypted JSON wallet
      --networkid uint              networkid
      --privateKey string           Private key to use
      --url string                  node url (default "ws://localhost:8545")

Usage

This section will detail how to properly configure chainbridge-core and get started with a new, more modular chainbridge.

On-Chain Setup

Follow the development & setup scripts inside chainbridge-solidity to deploy, register resource contract on source chain.

Deploy WETH (Optional)

deploy this contract (WETH9.sol or WETH10.sol) on the source chain in case you want to bridge native token.

Configuring chains

After contracts get deployed, we need to set those addresses into its respective chain inside config.

Chains are configured as an array under chains tag inside provided config. Inside example we then go through all chain configs and create an instance of RelayedChain via SetupDefaultEVMChain that registers handlers for provided handler addresses in config (currently supported: erc20, erc721, generic).

Run

Run the chainbridge relayer.

Run example app

Usage:
   run [flags]

Flags:
      --blockstore string   Specify path for blockstore (default "./lvldbdata")
      --config string       Path to JSON configuration file
      --fresh               Disables loading from blockstore at start. Opts will still be used if specified. (default: false)
  -h, --help                help for run
      --keystore string     Path to keystore directory (default "./keys")
      --latest              Overrides blockstore and start block, starts from latest block (default: false)
      --testkey string      Applies a predetermined test keystore to the chains.

Running the relayer with the following flags:

  1. Path to config: JSON config file path
  2. Path to our relayer's keystore: an ethereum keypair used for signing transactions.
  3. Path to our blockstore: used to record the last block the relayer processed, allowing the relayer to pick up where it left off.

example:

./chainbridge-core-example run --config config.json --keystore keys --blockstore blockstore

or

docker compose up

E2E example

docker compose -f docker-compose.e2e.yml up

ChainSafe Security Policy

Reporting a Security Bug

We take all security issues seriously, if you believe you have found a security issue within a ChainSafe project please notify us immediately. If an issue is confirmed, we will take all necessary precautions to ensure a statement and patch release is made in a timely manner.

Please email us a description of the flaw and any related information (e.g. reproduction steps, version) to security at chainsafe dot io.

License

GNU Lesser General Public License v3.0

chainbridge-core-example's People

Contributors

dependabot[bot] avatar hangleang avatar mpetrun5 avatar nmlinaric avatar p1sar avatar vezenovm avatar waymobetta 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.