graphprotocol / graphprotocol/graph-node
`--debug-fork` should merge data when querying the subgraph, as well as at indexing time
まだ誰も着手していません。
- 主要言語
- 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:
-
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 -
Run local ipfs & postgres nodes
-
Run local graph node with
--fork-baseethereum-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/ -
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
- Visit local subgraph query ui. In my case, http://0.0.0.0:8000/subgraphs/name/fiatdao/fiat-subgraph. Query any models, you will see an empty response, rather than the results you would expect from querying the hosted subgraph node at the same block number.
What is the expected behavior?
When querying graph-node configured to use a forked subgraph and local mainnet forking node, I would expect:
-
My queries to the local
graph-nodeto return the same value as the hosted node for any given query at the same block -
When committing transactions which emit events on my local ganache node, my local
graph-nodeshould 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?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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