Skip to content

Latest commit

 

History

History
 
 

relayer

Golang Relayer

Relayer

A relayer for the Bridge to watch and sync event between Layer 1 and Taiko Layer 2.

Running the app

run cp .default.env .env, and add your own private key as RELAYER_ECDSA_KEY in .env. You need to be running a MySQL instance, and replace all the MYSQL_ env vars with yours.

Run go run cmd/main.go --help to see a list of possible configuration flags, or go run cmd/main.go to run with defaults, which will process messages from L1 to L2, and from L2 to L1, and start indexing blocks from 0.

Project structure

bin

Executable binary, built it with go build cmd/main.go {options}.

cli

Command line interface execution folder, intended to instantiate all app dependencies and start them.

cmd

Entry point to the application. There are possible flag configurations for the app. Run go run cmd/main.go -h to see possible options, or go run cmd/main.go to run it with sensible defaults.

contracts

Autogenerated smart contract bindings with abigen. Use ./abigen.sh to generate the bindings.

encoding

Encoding helpers for packing abi structs or converting types.

indexer

A block indexing service that watches for events happening in batches.

message

A message processor that can act on a specific event and attempt to process them via bridge.processMessage call.

migrations

Contains database migrations. They are created and ran with the goose binary.

Install goose: go install github.com/pressly/goose/v3/cmd/goose@latest

Then: cd migrations

GOOSE_DRIVER=mysql GOOSE_DBSTRING="username:password@/dbname" goose up

mock

Mocked structs for testing.

proof

Proof generator, uses eth_getProof call under the hood.

repo

Database repositories implementing domain Repository interfaces with a concrete MySQL implementation.