graphprotocol / graphprotocol/graph-node

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

オープン
#4,077 コメント 6 件 リアクション 16 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

developer experience Stale
主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

説明

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?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

記載されている Ganache、ローカルの IPFS/PostgreSQL、graph-node、--fork-base、--debug-fork コマンドを使って問題を再現し、その後、同じブロックでローカルの GraphQL クエリとホストされたサブグラフを比較します。対応するクエリに対して既存のフォーク済みデータが返され、ローカル Ganache トランザクションのイベントがローカルでインデックス化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
graphql, postgresql, rust
領域
backend-api-design, blockchain, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。