firehose-ethereum

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0

README

Ethereum on StreamingFast

reference License

Requirements (clone repos, build stuff...)

Install Geth
git clone git@github.com:streamingfast/go-ethereum.git
cd go-ethereum
git checkout release/geth-1.10.x-dm
go install ./cmd/geth
go install ./cmd/bootnode
Install fireeth
git clone git@github.com:streamingfast/firehose-ethereum.git
cd firehose-ethereum
go install ./cmd/fireeth

Quickstart, connecting to an existing chain

  • Start from a clean folder

  • Create a file named sf.yaml and put the following content:

    start:
    args:
    - merger
    - firehose
    - reader-node
    - relayer
    flags:
      common-chain-id: "1"
      common-network-id: "1"
      reader-node-bootstrap-data-url: ./reader/genesis.json
      reader-node-log-to-zap: false
      reader-node-arguments: "+--bootnodes=enode://<enode1>@<ip>:<port>,enode://<enode2>@<ip>:<port>"
    

    Note Up to date boot nodes info for Geth supported network(s) can be found here.

  • Create a folder reader

  • Copy the genesis.json file of the chain into the reader folder.

    Note It's possible to use geth dumpgenesis to dump actual genesis file to disk

    • Mainnet - geth --mainnet dumpgenesis > ./reader/genesis.json
    • Ropsten - geth --ropsten dumpgenesis > ./reader/genesis.json
    • Goerli - geth --goerli dumpgenesis > ./reader/genesis.json
    • Rinkeby - geth --rinkeby dumpgenesis > ./reader/genesis.json
  • fireeth start -vv

    Note It's recommended to launch with -vv the first time to more easily see what's happening under the hood.

  • Wait around a minute leaving enough time for the Geth process to start the syncing process. You should then have some merged blocks under ./sf-data/storage/merged-blocks. You should also be able to test that Firehose is able to stream some blocks to you.

    `grpcurl -plaintext -import-path ../proto -import-path ./proto -proto sf/ethereum/type/v2/type.proto -proto sf/firehose/v1/firehose.proto -d '{"start_block_num": -1}' localhost:13042 sf.firehose.v1.Stream.Blocks"

    Note You will need to have grpcurl and a clone of https://github.com/streamingfast/proto, we assume they are sibling of the folder you are currently in, adjust -import-path ... flags in the command above to where the files are located.

Release

Use the ./bin/release.sh Bash script to perform a new release. It will ask you questions as well as driving all the required commands, performing the necessary operation automatically. The Bash script runs in dry-mode by default, so you can check first that everything is all right.

Releases are performed using goreleaser.

Docker Bundle Image Building

New version of Ethereum clients means releasing a new version of the full bundled image of firehose-ethereum that contains fireeth binary as well as node instrumented binary to sync with the chain. Doing this is really simple as we will simply ask GitHub to launch an action that will build for us the bundled image with the current up to date version of the Ethereum client.

First, install the GitHub CLI and configure it to be connected with your account.

Run the following commands:

  • Release trunk 0.10.x with Firehose V1 Instrumentation (production builds): gh workflow run docker.yml -f geth_version=fh1 --ref release/v0.10.x
  • Release trunk develop with Firehose V1 Instrumentation (development builds): gh workflow run docker.yml -f geth_version=fh1 --ref develop
  • Release trunk develop with Firehose V2 Instrumentation (development builds): gh workflow run docker.yml -f geth_version=fh2 --ref develop

Contributing

Issues and PR in this repo related strictly to the Ethereum on StreamingFast.

Report any protocol-specific issues in their respective repositories

Please first refer to the general StreamingFast contribution guide, if you wish to contribute to this code base.

This codebase uses unit tests extensively, please write and run tests.

License

Apache 2.0

Directories

Path Synopsis
cmd
types module

Jump to

Keyboard shortcuts

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