graphprotocol / graphprotocol/indexer

Indexer-agent supports operating on multiple Graph Network protocol chains

Open
#631 3 comments 1 reaction 1 assignee View on GitHub

@tilacog is already working on this.

Since Mar 28, 2023.

Dominant language
TypeScript
Stars
262
Forks
148
PR merge metrics
No merged PRs in 30d

Description

In order to support smooth subgraph deployment migrations from the L1 network to the L2 network the indexer-agent will need to be able to operate for both an L1 and L2 indexer account but use a single, shared graph-node backend.

Changes

  • Query multiple network subgraphs for potential subgraph allocations and update SubgraphDeployment to include a protocolNetwork property
  • Add a protocolNetwork property to indexing rules.
    • In the case of a deployment specific rule it will consider this the preferred network; if the deployment doesn't exist on the preferred network it will use the other.
    • In the case of a global rule consider the protocolNetwork absolute not just preference, never use this rule on the other network
  • When comparing indexing rules and potential subgraphs the output should include the protocol network where the allocation will be created
  • Actions get queued with protocolNetwork specified
  • Actions worker will read in the protocolNetwork when taking actions, sending transactions to the appropriate network's contracts
  • Update Network.create() to support creating multiple Network class instances; it will now return a map containing all the networks the indexer has passed in.
  • Use default allocationAmount for the new rule on L2 created during migration

Interface updates

  • Allow n number of chains:
    • Provide multiple values to --network, --networkSubgraphDeployment, and --networkSubgraphEndpointAdd
  • Add L2 RPC provider endpoint,
  • Add protocolNetwork to indexing rules
  • Add protocolNetwork to actions queue

Examples of passing in network params to indexer-agent

Multi-network scenario

--network-rpc goerli:http://rpc-endpoint, mainnet:http://rpc-endpoint
--networkSubgraphDeployment goerli:Qm..., mainnet:Qm...
--networkSubgraphEndpoint goerli:http:..., mainnet:http://

Single-network scenario

--ethereum or --network http://rpc-endpoint
--networkSubgraphDeployment Qm..

Open questions

  • Do we need to any changes to indexer-service? Might not need to make changes; there will need to be an indexer-service running for each network.

Next steps

  • Turn this into a milestone
    • Break out the tasks into their own issues under the milestone

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.