- A running MongoDB instance
-
Install
nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
-
Setup up environment
nvm install 16.0 nvm use 16.0 yarn install
- Update
.env
placed in root of projectMONGODB_URI="mongodb+srv://..." LOG_LEVEL="debug" WEBSOCKET_URL="ws://3.111.45.9:8546" MAX_BLOCK_RANGE=500 # size of window for querying blocks INDEX=TRUE # pick block number lower than the block number at which # either swap or lending are deployed START_BLOCK=220000 # default 0
- Run server
yarn run redo
- Update
.env
placed in root of projectMONGODB_URI="mongodb+srv://..." # connect to same db as indexer PORT=4000
- Server Running at http://localhost:4000
- run the indexer and api separately
- make sure indexer and api servers are connected to same database
- ensure
.env
file in project root with configs like in Section 1.1 - Run Server
2.1 Runs in background 1.2 ~3k blocks/min @
docker compose -f indexer.docker-compose.yml up -d
MAX_BLOCK_RANGE=500
(300k blocks takes ~2hrs) 1.3 if you need to restart. recommend cleaning the database to ensure no corrupted data & incorrect api results
- ensure
.env
file in project root with configs like in Section 1.2 - Run Server
docker compose -f indexer.docker-compose.yml up -d
- Server Running at http://localhost:4000