The repository stores three services:
Indexer
collects the blockchain data and put it to MongoDb collections. It's using the Apibara tool.Data transformer
which procces and transform data collected by theindexer
. It creates or updates data in MongoDb so it can be used directly by theserver
app. Services should run periodically to processes the new data.Server
which is used to create a GraphQL APIs. In this stage the service reads data from the DB without any major processing.
- Adjust environment variables in
env-<network>
file - Create an account in Apibara
- Set apibara auth token as env variable
export AUTH_TOKEN=<your_apibara_key>
- Run the indexer
docker compose up
Adjust environment variables in env-<network>
file
poetry run server events
poetry run server positions
Should be run after processing all events and positions by transformers
poetry run server leaderboard
Start the server
poetry run server graphql
Start the server
poetry run server strk-calculation
The output data is saved to server/strk_rewards_data
- Adjust environment variables in
env-<network>
file - Create an account in Apibara
- Set apibara auth token as env variable
export AUTH_TOKEN=<your_apibara_key>
- Set RPC_URL and MONGODB_CONNECTION_STRING as env variable
export RPC_URL=<your_rpc_url>
export MONGODB_CONNECTION_STRING=<your_mongo_url>
- Run
docker-compose.yml
ordocker-compose.prod.yml
docker compose up