This project includes a Docker Compose file and necessary configurations to run an indexer on the Voi network.
The Docker Compose file defines the following servers:
- voi-node: This service connects to the Voi network by running a node.
- conduit: This service retrieves data from the voi-node and stores it in a Postgres database.
- postgres: This service runs the Postgres database to store data processed by the Conduit service. The data is persisted on a Docker volume.
- indexer: This service retrieves data from the Postgres database.
graph LR;
subgraph Internet
VoiBlockchain[Voi Blockchain]
end
subgraph Docker Services
VoiBlockchain -->|Provides Data| VoiNode[voi-node]
Conduit[Conduit] -->|Queries| VoiNode
Conduit -->|Saves Data| PostgresDB[(Postgres DB)]
Indexer[Indexer] -->|Queries| PostgresDB
end
Create a Docker network called indexer
docker network create indexer
docker compose up -d
docker compose down
Once the indexer is up, you can query it via this example command:
curl http://localhost:8980/v2/accounts
The voi-node service will begin syncing with the Voi network. The conduit service will continue advancing the block processing as syncing progresses, which may take some time.
You can check the current sync status with the following command:
docker exec -it indexer-voi-node-1 /node/bin/goal -d /algod/data node status
The voi-node service utilizes two tokens, stored in the following files:
algod-data/algod.token
algod-data/algod.admin.token
These tokens are also referenced in conduit-data/conduit.yml
.
To generate a new token, run this command:
head -c 32 /dev/urandom | shasum -a 256 | cut -d ' ' -f 1
Once generated, be sure to update the corresponding configuration files.
Postgres connection strings and default credentials are located within the docker-compose.yml
file.
Additionally, you can find the Postgres connection settings in conduit-data/conduit.yml
.
Documentation on the conduit configuration can be found here
Documentation on the indexer configuration can be found here
Comprehensive documentation for the Indexer REST API is available here
Remove the named Docker overlay network indexer
docket network rm indexer
Remove the Docker volume that contains the Postgres database
docker volume rm indexer_postgres-data