π PoiPal
π Β Blazing fast CLI tool for Proof of Indexing (POI) Investigations on The Graph
A powerful command-line interface for fetching and analyzing Proof of Indexing (POI) data from The Graph Network. PoiPal helps indexers and developers verify POI consistency, detect divergences, and troubleshoot indexing issues with beautiful, table-formatted output.
β¨ Features
- π Multi-threaded POI fetching for blazing-fast performance
- π Table-formatted output grouped by POI hash
- π Binary search divergence detection to find exact divergence points
- π€ Automatic block detection from IPFS manifests and chain head
Prerequisites π οΈ
- Rust - Install Rust
- The Graph API Key (for network subgraph access). You can get it from The Graph Studio
Installation π»
Usage
PoiPal provides two main commands:
1. POI Command - Fetch POIs for a specific block
Example:
2. Check Divergence Command - Find POI divergences using binary search
Example with all parameters:
Example with auto-detection (recommended):
# Auto-detects start block from IPFS manifest and end block from chain head
Environment Variables π§
Set these environment variables to avoid passing them as CLI arguments:
# Required: The Graph API key
# Optional: Trusted indexer for divergence checking
Command Options
POI Command Options
| Option | Description | Required | Environment Variable |
|---|---|---|---|
--deployment |
Deployment ID (IPFS hash) | β | - |
--block |
Block number to fetch POI for | β | - |
--api-key |
The Graph API key | β | GRAPH_API_KEY |
Check Divergence Options
| Option | Description | Required | Default | Environment Variable |
|---|---|---|---|---|
--deployment |
Deployment ID (IPFS hash) | β | - | - |
--start-block |
Start block for binary search | β | Auto-detect from IPFS | - |
--end-block |
End block for binary search | β | Auto-detect from chain | - |
--indexer |
Trusted indexer ID | β | - | TRUSTED_INDEXER |
--api-key |
The Graph API key | β | - | GRAPH_API_KEY |
--ipfs-url |
IPFS gateway URL | β | https://ipfs.thegraph.com |
- |
--max-retries |
Max retries for POI fetching | β | 3 |
- |
Example Output
POI Command Output
================================================================================
POIs for deployment QmYHgc1xGgnGvTx3sxy8FVf7jh4WGiJwS9WfKKDynLCy7 at block 19000000
================================================================================
Found 5 indexers with 1 unique POI(s)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
POI Hash: 0xf0642535812254bb5ec91283a1ec2714546c4dbe199157812f175303c35c6925
Count: 5 indexer(s)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Indexer ID β URL
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
0x63c9dc729ba7a22bb8605216b24a34b902e5fe94 β https://production-indexer.infradao.tech
0x7bb834017672b1135466661d8dd69c5dd0b3bf51 β https://graphprodl2.0xcryptovestor.com
0x9082f497bdc512d08ffde50d6fce28e72c2addcf β https://indexer.holographic.network/
0xedca8740873152ff30a2696add66d1ab41882beb β https://arbitrum.graph.pinax.network/
0xf92f430dd8567b0d466358c79594ab58d919a6d4 β https://graph-l2prod.ellipfra.com/
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Check Divergence Output
================================================================================
POI Divergence Checker
================================================================================
Deployment: QmYHgc1xGgnGvTx3sxy8FVf7jh4WGiJwS9WfKKDynLCy7
Fetching start block from IPFS...
β Fetched start block: 18500000
Fetching network from manifest...
Network: arbitrum-one
Fetching RPC URL from registry...
RPC URL: https://arbitrum-one.publicnode.com
Fetching chain head block...
β Fetched end block: 19250000
Search Range: 18500000 β 19250000
Reference Indexer: 0x63c9dc729ba7a22bb8605216b24a34b902e5fe94
Fetching active indexers...
β Found 5 active indexers
Starting binary search for diverged block...
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Checking block 18875000 (range: 18500000 - 19250000)... β All POIs match
β Checking block 19062500 (range: 18875001 - 19250000)... β Divergence found (2 indexers)
β Checking block 18968750 (range: 18875001 - 19062499)... β All POIs match
β Divergence found at block 19062500
How to Run Locally π
- Clone repository & change directory
- Set up environment variables
- Run the program
# Fetch POIs for a specific block
# Check for divergences
How to Get Your Graph API Key π
- Visit The Graph Studio
- Connect your wallet and create an account
- Go to your dashboard and find the "API Keys" section
- Create a new API key for network subgraph access
- Set it as an environment variable:
export GRAPH_API_KEY="your_key_here"
Contributing π€
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License π
This project is licensed under the MIT License - see the LICENSE file for details.
Support π¬
If you have any questions or need help, please open an issue on GitHub or reach out to the maintainers.