Skip to main content

No project description provided

Project description

Graphprotocol Public POI Tool

A command-line tool for analyzing and reporting on Proof of Indexing (POI) data across Graph Protocol indexers. This tool helps monitor subgraph deployment health, compare POI values between indexers, and identify divergence points.

Features

  • Health Reports: Generate comprehensive health reports for subgraph deployments across all allocated indexers
  • POI Analysis: Compare proof-of-indexing values between indexers at specific block numbers
  • Bisection Analysis: Efficiently find the exact block where two indexers' POI values first diverge
  • Indexer State Hash: Generate hashes of indexer states for finding indexers sharing graph-node

Installation

Prerequisites

  • Python 3.10 or higher

Install from PyPI

pip install graph-poitool

Install from source

git clone https://github.com/graphprotocol/graphprotocol-public-poi-tool.git
cd graphprotocol-public-poi-tool
uv sync

Configuration

The tool requires access to Graph Protocol subgraph endpoints. Configure these via environment variables or command-line options:

export POITOOL_NETWORK_SUBGRAPH_ENDPOINT="https://gateway.network.thegraph.com/api/subgraphs/id/..."
export POITOOL_EBO_SUBGRAPH_ENDPOINT="https://gateway.network.thegraph.com/api/subgraphs/id/..."
export POITOOL_GATEWAY_API_TOKEN="secret" # optional if not pointing to gateway

Usage

Health Reports

Generate a health report for a subgraph deployment:

poitool health <IPFS_HASH>

This command:

  • Queries all indexers with allocations to the deployment
  • Displays health status, latest block, and error information
  • Shows results in a real-time updating table

Proof of Indexing Reports

Generate POI reports for specific blocks:

# Use current epoch's latest valid block
poitool poi report <IPFS_HASH>

# Use specific block number
poitool poi report <IPFS_HASH> <BLOCK_NUMBER>

Features:

  • Collects POI values from all allocated indexers
  • Compares POI consistency across the network
  • Identifies indexers with matching/divergent POI values

POI Bisection

Find the exact block where two indexers' POI values diverge:

poitool poi bisect <IPFS_HASH> <LEFT_INDEXER_ID> <RIGHT_INDEXER_ID>

This uses binary search to efficiently locate divergence points, useful for:

  • Debugging indexing discrepancies
  • Identifying when indexers went out of agreement
  • Root cause analysis of POI mismatches

Indexer State Hashing

Generate a hash of an indexer's synced subgraph identifiers:

poitool indexer hash <INDEXER_ID>

Useful for:

  • Finding indexers that are sharing graph-node

Architecture

Core Components

  • Network Client: Interfaces with the Graph Network subgraph
  • EBO Client: Interfaces with Epoch Block Oracle for valid block numbers
  • Indexer Status Client: Communicates with individual indexer status endpoints
  • Report Service: Generates health and POI reports across multiple indexers
  • Bisector Service: Performs binary search to find POI divergence points

Services

  • ReportService: Orchestrates data collection from multiple indexers
  • BisectorService: Implements efficient bisection algorithm for POI analysis

Clients

  • NetworkClient: Queries network subgraph for allocations, indexer info, and manifests
  • EBOClient: Retrieves epoch and block validation data
  • IndexerStatusClient: Queries individual indexer endpoints for status and POI data

Command Reference

Global Options

  • --network-subgraph-endpoint: Graph Network subgraph endpoint
  • --ebo-subgraph-endpoint: EBO subgraph endpoint
  • --gateway-api-token: Graph Gateway API token

Commands

health <IPFS_HASH>

Generate health report for a subgraph deployment.

poi report <IPFS_HASH> [BLOCK_NUMBER]

Generate POI report. Block number defaults to current epoch's latest valid block.

poi bisect <IPFS_HASH> <LEFT_INDEXER_ID> <RIGHT_INDEXER_ID>

Find first divergent block between two indexers using binary search.

indexer hash <INDEXER_ID>

Generate SHA-256 hash of indexer's synced subgraphs and their health status.

Development

Setup Development Environment

uv sync

Code Generation

The project uses GraphQL code generation for type-safe client interactions:

# Generate client code from GraphQL schemas
make codegen

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

  • Open an issue on GitHub
  • Check existing documentation and code comments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graph_poitool-0.1.2-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file graph_poitool-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: graph_poitool-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for graph_poitool-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58f9061897240442b2294eddfd51079f095309febc1a4d961f73017093b94cf2
MD5 4b05fa1aa668ab4366a498299577647a
BLAKE2b-256 e9d37675f9bbb3f0321601b4fedb72d1253b78f28a9b9124c1a0135716a8021f

See more details on using hashes here.

Provenance

The following attestation bundles were made for graph_poitool-0.1.2-py3-none-any.whl:

Publisher: release-pypi.yml on p2p-org/graphprotocol-public-poi-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page