GithubHelp home page GithubHelp logo

transaction-receipt-relayer's Introduction

transaction-receipt-relayer

This repository contains an Ethereum transaction receipt relayer for the GGX network. The relayer verifies finalized blocks using Helios light client. The relayer requires a Beacon and Consensus RPC node, which updates and blocks will be verified. It will relay transaction receipts for the smart contracts list managed by the pallet in this repository.

Install dependencies

sudo apt install libsqlite3-dev

Run

  1. Run 2 nodes
export ETH1_INFURA_API_KEY=$(INFURA_API_KEY)

./target/release/ggxchain-node \
    --alice \
    --chain=dev \
    --port=30333 \
    --rpc-port=9944 \
    --base-path=/tmp/alice \
    --rpc-cors=all \
    --node-key=0000000000000000000000000000000000000000000000000000000000000001 \
    --light-client-relay-config-path eth-relay.toml \
    --light-client-init-pallet-config-path eth-init.toml
./target/release/ggxchain-node \
    --bob \
    --chain=dev \
    --port=30334 \
    --rpc-port=9945 \
    --base-path=/tmp/bob \
    --rpc-cors=all \
    --bootnodes=/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp
  1. Update INFURA_API_KEY and checkpoint in helios.toml

  2. Run transaction-receipt-relayer

RUST_LOG=info cargo run --release -- --network sepolia --database db --helios-config-path helios.toml --substrate-config-path ggxchain-config.toml

How check that it works?

You can see an Ethereum client event in the explorer about 1 time per 10 minutes.

Ethereum client event

Configs

  • GGX config

    Field Definition
    is_dev if set to true the Alice account will be used, and the phrase will be ignored
    ws_url GGX RPC endpoint
    phrase Account for signing transaction.
  • Helios config

Please note that you need to update helios.toml checkpoint from time to time.

Action points to look

  • Check how it works if multiple relayers are working simultaneously.
  • Optimize batch sending of receipts.
  • Remove blocks older than X

transaction-receipt-relayer's People

Contributors

akorchyn avatar obsessed-cake avatar xcthulhu avatar baidang201 avatar

Watchers

 avatar Yehor Butko avatar

transaction-receipt-relayer's Issues

Unified Data Directory Environment Variable

Description

Rather than setting DB_PATH and HELIOS_HOME_PATH, set a single environment variable to be shared for all data gathered by the light client.

Definition of "Done"

Require only one environment variable set to determine where data is stored.

Save block info for light client

Description

We need to change the stored value for our light client db implementation.
The light client should save the following:

  • blocks_table: block_height: u64 -> (execution_payload_hash: H256, execution_payload_header: ExecutionPayloadHeader, queried_for_receipts: bool)
  • latest_seen: (block_height, execution_payload_hash)

Definition of "Done"

  • Light client saves data using below scheme
  • Light client uses latst_seen to bootstrap when it comes online

Useful links

Ethreum Documentation

Continuous Integration

Description

We should run unit upon each PR.

Definition of "Done"

Configure GitHub to run unit tests upon each PR.

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.