All Projects → ChainSafe → Chainbridge

ChainSafe / Chainbridge

Licence: lgpl-3.0
🌉 Modular Multi-Directional Blockchain Bridge to interact with Multiple Networks; Ethereum, Ethereum Classic, Substrate, based chains.

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Chainbridge

Gnome Feeder
Profit Trailer Feeder Full Build with Settings
Stars: ✭ 122 (-4.69%)
Mutual labels:  ethereum
Py Solc
Python wrapper around the solc Solidity compiler.
Stars: ✭ 126 (-1.56%)
Mutual labels:  ethereum
Hanzo.js
🚀 Hanzo JavaScript SDK. Develop cutting-edge decentralized applications.
Stars: ✭ 128 (+0%)
Mutual labels:  ethereum
Ethvtx
🌀🛰 ethereum-ready & framework-agnostic redux store configuration
Stars: ✭ 125 (-2.34%)
Mutual labels:  ethereum
Mythril
Security analysis tool for EVM bytecode. Supports smart contracts built for Ethereum, Hedera, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains.
Stars: ✭ 1,968 (+1437.5%)
Mutual labels:  ethereum
Hs Web3
Web3 API for Haskell.
Stars: ✭ 127 (-0.78%)
Mutual labels:  ethereum
Remix Ide
Documentation for Remix IDE
Stars: ✭ 1,768 (+1281.25%)
Mutual labels:  ethereum
Elm Ethereum
dApps in Elm
Stars: ✭ 129 (+0.78%)
Mutual labels:  ethereum
Cyb
Immortal robot for the Great Web
Stars: ✭ 126 (-1.56%)
Mutual labels:  ethereum
Deltabalances.github.io
The Ethereum decentralized exchange assistant. Check token balances, transaction details & trade history.
Stars: ✭ 128 (+0%)
Mutual labels:  ethereum
Ethereum Security
Security issues in Ethereum demonstrated in mocha tests. The fix is also demonstrated
Stars: ✭ 124 (-3.12%)
Mutual labels:  ethereum
Ethereum Wallet
Native Ethereum Wallet - iOS
Stars: ✭ 125 (-2.34%)
Mutual labels:  ethereum
Hive
Ethereum end-to-end test harness
Stars: ✭ 127 (-0.78%)
Mutual labels:  ethereum
Bitcoinwallet
Bitcoin and ETH wallet
Stars: ✭ 124 (-3.12%)
Mutual labels:  ethereum
Typescript Solidity Dev Starter Kit
Starter kit for smart contract development using Typescript
Stars: ✭ 127 (-0.78%)
Mutual labels:  ethereum
Ion
General interoperability framework for trustless cross-system interaction
Stars: ✭ 122 (-4.69%)
Mutual labels:  ethereum
Hadoopcryptoledger
Hadoop Crypto Ledger - Analyzing CryptoLedgers, such as Bitcoin Blockchain, on Big Data platforms, such as Hadoop/Spark/Flink/Hive
Stars: ✭ 126 (-1.56%)
Mutual labels:  ethereum
Augur.js
Augur JavaScript API
Stars: ✭ 129 (+0.78%)
Mutual labels:  ethereum
Hashed Timelock Contract Ethereum
Hashed Timelock Contracts for ETH, ERC20 and ERC721 on Ethereum
Stars: ✭ 128 (+0%)
Mutual labels:  ethereum
Binance Quantization
虚拟货币(BTC、ETH)炒币量化系统项目。币安交易所-量化交易-网格策略实践。火币、OKEX热门交易所未来都支持。最简单收益最靠谱的项目,包教包会。
Stars: ✭ 128 (+0%)
Mutual labels:  ethereum

ChainBridge

discord build status

Contents

Getting Started

Installation

Dependencies

  • Subkey: Used for substrate key management. Only required if connecting to a substrate chain.

Building

make build: Builds chainbridge in ./build.

or

make install: Uses go install to add chainbridge to your GOBIN.

Docker

The official ChainBridge Docker image can be found here.

To build the Docker image locally run:

docker build -t chainsafe/chainbridge .

To start ChainBridge:

docker run -v ./config.json:/config.json chainsafe/chainbridge

Configuration

Note: TOML configs have been deprecated in favour of JSON

A chain configurations take this form:

{
    "name": "eth",                      // Human-readable name
    "type": "ethereum",                 // Chain type (eg. "ethereum" or "substrate")
    "id": "0",                          // Chain ID
    "endpoint": "ws://<host>:<port>",   // Node endpoint
    "from": "0xff93...",                // On-chain address of relayer
    "opts": {},                         // Chain-specific configuration options (see below)
}

See config.json.example for an example configuration.

Ethereum Options

Ethereum chains support the following additional options:

{
    "bridge": "0x12345...",          // Address of the bridge contract (required)
    "erc20Handler": "0x1234...",     // Address of erc20 handler (required)
    "erc721Handler": "0x1234...",    // Address of erc721 handler (required)
    "genericHandler": "0x1234...",   // Address of generic handler (required)
    "maxGasPrice": "0x1234",         // Gas price for transactions (default: 20000000000)
    "gasLimit": "0x1234",            // Gas limit for transactions (default: 6721975)
    "gasMultiplier": "1.25",         // Multiplies the gas price by the supplied value (default: 1)
    "http": "true",                  // Whether the chain connection is ws or http (default: false)
    "startBlock": "1234",            // The block to start processing events from (default: 0)
    "blockConfirmations": "10"       // Number of blocks to wait before processing a block
    "useExtendedCall": "true"        // Extend extrinsic calls to substrate with ResourceID. Used for backward compatibility with example pallet. *Default: false*
}

Substrate Options

Substrate supports the following additonal options:

{
    "startBlock": "1234" // The block to start processing events from (default: 0)
}

Blockstore

The blockstore is used to record the last block the relayer processed, so it can pick up where it left off.

If a startBlock option is provided (see Configuration), then the greater of startBlock and the latest block in the blockstore is used at startup.

To disable loading from the blockstore specify the --fresh flag. A custom path for the blockstore can be provided with --blockstore <path>. For development, the --latest flag can be used to start from the current block and override any other configuration.

Keystore

ChainBridge requires keys to sign and submit transactions, and to identify each bridge node on chain.

To use secure keys, see chainbridge accounts --help. The keystore password can be supplied with the KEYSTORE_PASSWORD environment variable.

To import external ethereum keys, such as those generated with geth, use chainbridge accounts import --ethereum /path/to/key.

To import private keys as keystores, use chainbridge account import --privateKey key.

For testing purposes, chainbridge provides 5 test keys. The can be used with --testkey <name>, where name is one of Alice, Bob, Charlie, Dave, or Eve.

Metrics

See metrics.md.

Chain Implementations

  • Ethereum (Solidity): chainbridge-solidity

    The Solidity contracts required for chainbridge. Includes deployment and interaction CLI.

    The bindings for the contracts live in bindings/. To update the bindings modify scripts/setup-contracts.sh and then run make clean && make setup-contracts

  • Substrate: chainbridge-substrate

    A substrate pallet that can be integrated into a chain, as well as an example pallet to demonstrate chain integration.

Docs

MKdocs will generate static HTML files for Chainsafe markdown files located in Chainbridge/docs/

make install-mkdocs: Pull the docker image MkDocs

make mkdocs: Run MkDoc's docker image, building and hosting the html files on localhost:8000

Testing

Unit tests require an ethereum node running on localhost:8545 and a substrate node running on localhost:9944. E2E tests require an additional ethereum node on localhost:8546.

A docker-compose file is provided to run two Geth nodes and a chainbridge-substrate-chain node in isolated environments:

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

See chainbridge-solidity and chainbridge-substrate-chain for more information on testing facilities.

All Go tests can be run with:

$ make test

Go tests specifically for ethereum, substrate and E2E can be run with

$ make test-eth
$ make test-sub
$ make test-e2e

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].