graphprotocol / graphprotocol/graph-node
`--debug-fork` should merge data when querying the subgraph, as well as at indexing time
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Rust
- Star
- 3.2k
- Fork
- 1.1k
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện sự cố bằng cách sử dụng các lệnh Ganache, IPFS/PostgreSQL cục bộ, graph-node, --fork-base và --debug-fork được liệt kê, sau đó so sánh một truy vấn GraphQL cục bộ với subgraph được lưu trữ tại cùng một block. Được xem là hoàn tất khi dữ liệu fork hiện có được trả về cho các truy vấn tương ứng và các sự kiện từ các giao dịch Ganache cục bộ được lập chỉ mục cục bộ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- graphql, postgresql, rust
- Lĩnh vực
- backend-api-design, blockchain, databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100