forked from 0xPolygon/erigon
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
superdev edited this page Nov 7, 2023
·
1 revision
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.
The process to setup the environment and build the project:
- Clone https://github.com/GuardianLabs/erigon and https://github.com/GuardianLabs/erigon-lib
- Checkout
guardian-changedbranch in both - In
go.modfile oferigonadd 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
- 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
- Run the necessary
gocommands to fetch the packages and prepare for the building - Run
make erigonto build the binary
The recommended way to run is to use the run.sh script located in the root of erigon project; most importantly, it specifies:
-
DATA_DIRto 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 byerigonusage 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.
There's a list of things needed to be done in order for this erigon client to work with Guardian:
- Create and populate the
tx_fetched_erigontable; it probably should be done at the same place where we populate thetx_summary_erigontable, but with some tweaks like retrieving the tx signature, etc. - Create and populate the
block_fetchedtable