Usage
Start your local indexer and query blockchain data using the Portal API.Starting the Services
1
Set your RPC endpoint
Export the RPC URL as an environment variable:Examples:
- Local devnet:
http://localhost:8545 - Local Hardhat:
http://127.0.0.1:8545 - Remote testnet:
https://sepolia.infura.io/v3/YOUR_KEY
2
Start the services
Launch both services in detached mode:The services will start syncing blocks from your RPC endpoint.
3
Verify services are running
Check the logs to confirm syncing has started:You should see block ingestion activity. Press
Ctrl+C to exit the logs.Look for log entries showing block numbers being processed. This confirms the indexer is working.
Querying Your Data
Once running, the Portal API is available athttp://localhost:8000.
Basic Query Example
Fetch all blocks with their basic information:Query Transactions
Fetch blocks with transaction details:Query Logs
Fetch event logs from specific contracts:Replace
my-devnet in the URL with your dataset name from config.yaml if you used a different name.API Reference
Your local setup exposes the same Portal API endpoints as the public network. For complete endpoint documentation and query options, see the Portal API Reference.Stopping the Services
Stop the services while preserving data:db-data volume and will be available when you restart.
Cleanup
To remove all data and free disk space:Troubleshooting
Services won’t start
Check RPC connectivity:No blocks appearing
Check hotblocks-service logs:Out of disk space
Check volume size:Head retention strategy in config.yaml to limit storage.
Port 8000 already in use
Modify the port mapping indocker-compose.yaml:
http://localhost:8001.
