graphprotocol / graphprotocol/graph-node

`--debug-fork` should merge data when querying the subgraph, as well as at indexing time

Offen
#4,077 6 Kommentare 16 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

developer experience Stale
Vorherrschende Sprache
Rust
Sterne
3.2k
Forks
1.1k
Ø Merge
4 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

A graph-node run with --debug-fork returns empty data for all queries

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Providing a short video where I run through all this. See video at timestamp 1:08 for proof of empty query results.

Repro steps:

  1. Run forked mainnet ganache node with:
    npx ganache -h="0.0.0.0" --fork.url="https://eth-mainnet.alchemyapi.io/v2/$ALCHEMY_API_KEY" --fork.deleteCache

  2. Run local ipfs & postgres nodes

  3. Run local graph node with --fork-base ethereum-rpc of local ganache node, like so:
    cargo run -p graph-node --release -- --postgres-url postgresql://graph-node:let-me-in@0.0.0.0:5432/graph-node --ethereum-rpc mainnet:http://0.0.0.0:8545 --ipfs 0.0.0.0:5001 --debug --fork-base https://api.thegraph.com/subgraphs/id/

  4. Create and deploy subgraph to local graph-node
    graph create fiatdao/fiat-subgraph --node http://0.0.0.0:8020
    graph deploy fiatdao/fiat-subgraph --ipfs http://0.0.0.0:5001 --node http://0.0.0.0:8020 --debug-fork QmeHfNKsT8AupfXzpMKnG6k61KNUgm4mghCH827xcprWPA

What is the expected behavior?

When querying graph-node configured to use a forked subgraph and local mainnet forking node, I would expect:

  1. My queries to the local graph-node to return the same value as the hosted node for any given query at the same block

  2. When committing transactions which emit events on my local ganache node, my local graph-node should index those events on my local node

NOTE: The end goal of all this is to create a testing environment extremely close to mainnet for end-to-end testing purposes. Does what I'm trying to do here make sense? Does anyone have suggestions on how to get a close to mainnet environment for e2e tests?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem mit den aufgeführten Ganache-, lokalen IPFS/PostgreSQL-, graph-node-, --fork-base- und --debug-fork-Befehlen und vergleiche anschließend eine lokale GraphQL-Abfrage mit dem gehosteten Subgraphen im selben Block. Als erledigt gilt die Aufgabe, wenn vorhandene geforkte Daten für übereinstimmende Abfragen zurückgegeben werden und Ereignisse aus lokalen Ganache-Transaktionen lokal indiziert werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
graphql, postgresql, rust
Bereich
backend-api-design, blockchain, databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.