docker/README.indexer-test.md
This Docker Compose setup provides all components needed to test the Linera indexer and block processor in a containerized environment. It will start storage service, single-validator network (with a faucet), block exporter and an indexer destination.
NOTE: Currently, all components are packaged into the same docker image called linera-all-test.
The setup includes the following services in startup order:
cd docker
./make-all-build.sh
# in /docker directory
./make-all-up.sh
curl http://localhost:1235curl http://localhost:8081curl http://localhost:8882
curl http://localhost:9091/metricscurl http://localhost:8080# in /docker directory
./make-all-down.sh
All ports and paths are configurable via environment variables in .env.indexer-test:
LINERA_STORAGE_SERVICE_PORT (default: 1235) - Storage service portINDEXER_PORT (default: 8081) - Indexer gRPC portINDEXER_DATABASE_PATH (default: /data/indexer.db) - Indexer database pathBLOCK_EXPORTER_PORT (default: 8882) - Block exporter portMETRICS_PORT (default: 9091) - Metrics endpoint portFAUCET_PORT (default: 8080) - Faucet service portLINERA_INDEXER_IMAGE (default: linera-all-test) - Docker image nameTo override default settings:
.env.indexer-test to .env.local.env.localdocker-compose -f docker-compose.indexer-test.yml --env-file .env.local upThe services start in the correct order with health checks:
The following volumes are created for data persistence:
indexer-data - Indexer database files
./indexer-data contains an indexer.db file which is an SQLite db file of the indexer. It can be used for viewing the current state of the database.exporter-data - Block exporter logs and data
./exporter-data contains linera-exporter.log file which is a destination for "log exporter" part of the block exporter. It contains a record of all blocks and blobs processed by it.network-data - Network configuration and state# All services
docker-compose -f docker-compose.indexer-test.yml logs
# Specific service
docker-compose -f docker-compose.indexer-test.yml logs linera-indexer
docker-compose -f docker-compose.indexer-test.yml ps
docker-compose -f docker-compose.indexer-test.yml down -v
After code changes, rebuild and restart:
docker build -f Dockerfile.indexer-test -t linera-all-test ..
docker-compose -f docker-compose.indexer-test.yml up --force-recreate
To access a service container:
docker-compose -f docker-compose.indexer-test.yml exec linera-indexer bash