Skip to content
superdev edited this page Nov 7, 2023 · 1 revision

Guardian Erigon Wiki

The purpose of this page is to describe how to run the project and what else needs to be done in order to store transactions and blocks.

Building

The process to setup the environment and build the project:

  1. Clone https://github.com/GuardianLabs/erigon and https://github.com/GuardianLabs/erigon-lib
  2. Checkout guardian-changed branch in both
  3. In go.mod file of erigon add this directive to the end of the file; it will allow you to develop the library locally:
replace github.com/ledgerwatch/erigon-lib => $PATH_TO_LOCAL_ERIGON_LIB_FOLDER
  1. After finishing the development and pushing the changes, the path must be set to the github link, specifying the commit version, for example:
replace github.com/ledgerwatch/erigon-lib => github.com/GuardianLabs/erigon-lib v0.0.0-20231010140720-f25ccc34dad8
  1. Run the necessary go commands to fetch the packages and prepare for the building
  2. Run make erigon to build the binary

Running

The recommended way to run is to use the run.sh script located in the root of erigon project; most importantly, it specifies:

  • DATA_DIR to store the data to; as the sync is disabled, the data mostly consists of the keys and some meta
  • the environment variables to connect to the PostgreSQL instance (change them if needed)
  • a long list of bootnodes; the relevant bootnodes' addresses can be obtained by going to https://polygonscan.com/nodetracker/nodes, filtering by erigon usage and copying the addresses of such nodes into this string

If everything's launched successfully, you will see the logs of connections to the nodes and you will get information in the DB.

Future development

There's a list of things needed to be done in order for this erigon client to work with Guardian:

  1. Create and populate the tx_fetched_erigon table; it probably should be done at the same place where we populate the tx_summary_erigon table, but with some tweaks like retrieving the tx signature, etc.
  2. Create and populate the block_fetched table

Clone this wiki locally