github graphprotocol/indexer v0.15.0

latest releases: v0.21.3, indexer-integration-tests@0.0.2, @graphprotocol/indexer-service@0.21.3...
3 years ago

NPM

npm install -g @graphprotocol/indexer-agent@0.15.0
npm install -g @graphprotocol/indexer-cli@0.15.0
npm install -g @graphprotocol/indexer-service@0.15.0

Note: Installing these packages requires Rust and it's package manager cargo to be installed so that the cost model module can be built. Installing the above packages may require passing --unsafe-perm=true to the above install commands.

Docker

docker pull ghcr.io/graphprotocol/indexer-agent:v0.15.0
docker pull ghcr.io/graphprotocol/indexer-service:v0.15.0

Changes (Overview)

Launch of Scalar on Mainnet

The main change in this release is the replacement of State Channels with Scalar (using allocation-base receipts for now). Scalar enables highly scalable micro-transactions for query fees.

At a high level this means:

  • Along with every query, indexers now receive an updated Scalar receipt via the Scalar-Receipt header.
  • Receipts are collected via a /collect-receipts endpoint on the gateways. This will convert them into a signed (query fee) voucher that can then be redeemed via a new AllocationExchange contract on chain.

With this release, the indexer infrastructure changes as follows:

  • A new INDEXER_AGENT_COLLECT_RECEIPTS_ENDPOINT / --collect-receipts-endpoint configuration option is added to Indexer Agent to configure the endpoint that converts bundles of receipts into query fee vouchers.
  • A new INDEXER_SERVICE_CLIENT_SIGNER_ADDRESS / --client-signer-address configuration option is added to Indexer Service to configure the signer of the incoming receipts. For now, this limits indexers to being able to serve a single client, which is considered a temporary measure until the allocation-based receipts are replaced with receipts based on Vector transfers.

Network Subgraph Indexing

So far, indexers had to rely on https://gateway.network.thegraph.com/network to provide network subgraph data like allocations, subgraph deployments and more. With this release, indexers can index this network subgraph themselves and still fall back to https://gateway.network.thegraph.com/network if this subgraph hasn't fully synced yet or has failed locally.

In order to achieve this, the following infrastructure changes need to be applied:

  • Indexer agent now exports an HTTP server at port 8002. This needs to be made available to the indexer service.
  • Indexer agent needs to have the following configuration set:
    • INDEXER_AGENT_NETWORK_SUBGRAPH_ENDPOINT=https://gateway.network.thegraph.com/network (alternative: --network-subgraph-endpoint)
    • INDEXER_AGENT_NETWORK_SUBGRAPH_DEPLOYMENT=QmaUBw7sr8pBrwNgz6JkbmmGoUU7KJSaeRvCaY3NPDbQ7A (alternative: --network-subgraph-deployment)
  • Indexer service needs to have the following configuration set:
    • INDEXER_SERVICE_NETWORK_SUBGRAPH_ENDPOINT=http://indexer-agent:8002/network (alternative: --network-subgraph-endpoint)

This will make the agent index the network subgraph itself and serve it at :8002/network by default (this can be changed with --syncing-port), falling back to the gateway endpoint if there are any problems with the network subgraph. The service will then query the network subgraph through the agent.

Changes (Per Component)

Indexer Agent

Fixed

  • Make receipts table renaming migration more robust

Added

  • Allow network subgraph endpoint to be used as a fallback for the local network subgraph deployment
  • Add allocation exchange contract address for mainnet

Changed

  • Rename query fee related fields in database models

Indexer CLI

Changed

  • Rename query fee related fields in database models

Indexer Common

Fixed

  • Fix bug that could cause AsyncCache to fail perpetually

Indexer Native

No changes

Indexer Service

Changed

  • Rename query fee related fields in database models
  • Only sync database models in the agent to avoid race conditions
  • Rename X-Graph-Payment header to Scalar-Receipt

Don't miss a new indexer release

NewReleases is sending notifications on new releases.