relayer

command module
v0.0.0-...-8ab0d56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: LGPL-3.0 Imports: 3 Imported by: 0

README

Relayer

Relayer service that streams transactions from blockchain networks, packages data into messages, and sends the packages to the correlated bridge component.

Development

Run mage to see a list of available tasks (building, testing, linting, etc).

To enable revive for linting in VS-code, add the following to your config:

{
    "go.lintTool": "revive",
    "go.lintFlags": [
        "-config=${workspaceFolder}/revive.toml"
    ],
}

Contract Bindings

The relayer relies on dynamically generated bindings for our Ethereum contracts. They need to be updated whenever the contracts change.

Compile the contracts in the contracts directory:

forge build

Generate contract bindings:

go generate ./...

SSZ Encodings

To generate the SSZ encodings:

go install github.com/ferranbt/fastssz/sszgen
sszgen --path relays/beacon/state/beacon.go --objs BeaconStateCapellaMainnet,BlockRootsContainerMainnet,TransactionsRootContainer,BeaconBlockCapellaMainnet,WithdrawalsRootContainerMainnet

Configuration

Note: For local development and testing, we use our E2E test stack described here. It automatically generates suitable relayer configurations for testing.

For an example configuration, please consult the setup script for our local development stack. Specifically the start_relayer bash function.

Tests

To run both unit and integration tests, start a local E2E test stack and run the following command:

mage test

Documentation

Overview

Copyright © 2020 Snowfork <denali@snowfork.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
cmd
run
Package crypto is used to provide functionality to several keypair types.
Package crypto is used to provide functionality to several keypair types.
beacon/state
Code generated by fastssz.
Code generated by fastssz.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL