Get the TeachLink Indexer running in 5 minutes.
- Docker & Docker Compose
- TeachLink contract deployed on Stellar
cd indexer
cp .env.example .envEdit .env and set your contract ID:
TEACHLINK_CONTRACT_ID=your_contract_id_here# Start in development mode
docker-compose up indexer
# Or start in production mode
docker-compose --profile production up indexer-prodThat's it! The indexer is now running and monitoring the blockchain.
docker-compose logs -f indexerYou should see:
TeachLink Indexer is running on port 3000
Horizon service initialized for testnet network
Starting event stream from ledger...
# Connect to PostgreSQL
docker-compose exec postgres psql -U teachlink -d teachlink_indexer
# List tables
\dt
# Query indexer state
SELECT * FROM indexer_state;- Read the full README for detailed documentation
- Check IMPLEMENTATION.md for architecture details
- Explore the indexed data in PostgreSQL
- Build applications on top of the indexed data
Error: TEACHLINK_CONTRACT_ID is not configured
Solution: Set TEACHLINK_CONTRACT_ID in .env
Error: Connection refused to postgres:5432
Solution: Wait for PostgreSQL to start:
docker-compose up -d postgres
# Wait 10 seconds
docker-compose up indexerReasons:
- Contract not deployed
- No activity on the contract
- Wrong network (testnet vs mainnet)
Solution: Verify contract ID and network in .env
- Node.js 20+
- PostgreSQL 16+
# 1. Install dependencies
npm install
# 2. Configure environment
cp .env.example .env
# Edit .env with your settings
# 3. Create database
createdb teachlink_indexer
# 4. Start the indexer
npm run start:dev# Run tests
npm run test
# Run integration tests
npm run test:e2e
# Lint code
npm run lint
# Format code
npm run format
# Build for production
npm run build# View all services
docker-compose ps
# Stop services
docker-compose down
# Remove volumes (reset database)
docker-compose down -v
# View real-time logs
docker-compose logs -f indexer
# Restart indexer
docker-compose restart indexerFor production deployment:
- Use the production Docker Compose profile
- Set
DB_SYNCHRONIZE=false - Use strong passwords
- Enable SSL for database connections
- Set up monitoring and alerting
- Configure backups
See README.md for full production setup guide.