Blockchain event indexer powered by @lynx-core/indexer
- Node.js 18+ or Docker
- MongoDB (or use Docker Compose)
- RPC endpoint (Alchemy, Infura, QuickNode)
# 1. Clone/setup repository
git clone <your-repo>
cd my-indexer
# 2. Configure environment
cp .env.example .env
# Edit .env and set your RPC_URL
# 3. Customize config
# Edit config/config.yaml:
# - contractAddress: your contract address
# - startBlock: deployment block number
# - events: list of events to index
# 4. Add your contract ABI
# Replace abi/YourContract.json with your actual ABI
# 5. Start services
docker-compose -f docker/docker-compose.yml up -d
# 6. Check logs
docker-compose -f docker/docker-compose.yml logs -f indexer
# 7. Verify health
curl http://localhost:3000/health# 1. Install dependencies
pnpm install
# 2. Setup environment
cp .env.example .env
# Edit .env with your settings
# 3. Customize config & ABI (same as Docker)
# 4. Start MongoDB & RabbitMQ
# (Use Docker Compose or local installation)
# 5. Run in development mode
pnpm dev
# Or build and run
pnpm build
pnpm startSee CUSTOMIZATION_GUIDE.md for detailed instructions.
-
config/config.yaml
contractAddress: Your contract addressstartBlock: Contract deployment blockevents: Events to indexserviceName: Unique service name
-
abi/YourContract.json
- Replace with your contract ABI
-
.env
RPC_URL: Your WebSocket RPC endpoint
That's it! No code changes needed.
GET http://localhost:3000/healthGET http://localhost:3000/events?fromBlock=18000000&limit=100POST http://localhost:3000/transactions/priority
Content-Type: application/json
{
"txHash": "0xabc...",
"context": { "priority": "high" }
}GET http://localhost:3000/metrics# Docker
docker-compose -f docker/docker-compose.yml logs -f indexer
# Local
pnpm dev- Indexer API: http://localhost:3000
- MongoDB: mongodb://localhost:27017
- RabbitMQ Management: http://localhost:15672 (admin/admin)
curl http://localhost:3000/health | jqAll configuration is in config/config.yaml. No code changes needed!
Key sections:
- Service Info: serviceName, contractName, contractAddress
- Network: chainId, network, startBlock
- RPC: rpcUrl, fallbackRpcUrls
- Events: List of events to index
- Database: MongoDB settings
- Publisher: RabbitMQ/Webhook/None
- Features: priorityLane, crawler
- Performance: polling interval, batch size
See comments in config.yaml for detailed explanations.
- Check RPC_URL is valid WebSocket endpoint
- Verify MongoDB is running:
docker ps - Check logs:
docker-compose logs indexer
- Verify contract address is correct
- Check startBlock is before contract deployment
- Verify events exist in contract ABI
- Check RPC endpoint has archive access (if startBlock is old)
- Increase polling.batchSize in config
- Use faster RPC endpoint
- Check network connectivity
- Reduce crawlerInterval
- Core Package: @lynx-core/indexer docs
- Customization: CUSTOMIZATION_GUIDE.md
- API Reference: See core package README
- Open an issue: GitHub Issues
- Core package issues: Lynx Indexer Issues
MIT