graphprotocol / graphprotocol/graph-node

Graph node unable to connect to Anvil

Đang mở
#3,640 6 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

ops Stale
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?
Graph Node is not able to connect to Anvil (Foundry node).

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

Docker compose file:

version: "3.3"

services:
  chain-1337:
    environment:
      - MNEMONIC=$MNEMONIC
    container_name: chain-1337-test
    image: ghcr.io/foundry-rs/foundry:nightly
    entrypoint: 'anvil --chain-id 1337 --mnemonic "$MNEMONIC" --host 0.0.0.0 --block-time 3 --verbosity'
    ports:
      - "8547:8545"

  graph-node-1337:
    container_name: graph-node-1337-test
    image: graphprotocol/graph-node:v0.26.0
    ports:
      - "8010:8000"
      - "8001:8001"
      - "8020:8020"
      - "8030:8030"
      - "8040:8040"
    depends_on:
      - ipfs
      - postgres-1337
      - chain-1337
    environment:
      postgres_host: postgres-1337
      postgres_user: graph-node
      postgres_pass: let-me-in
      postgres_db: graph-node
      ipfs: "ipfs:5001"
      ethereum: "mainnet:http://chain-1337:8545"
      GRAPH_LOG: info

  postgres-1337:
    container_name: postgres-1337-test
    image: postgres
    ports:
      - "5432:5432"
    command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
    environment:
      POSTGRES_USER: graph-node
      POSTGRES_PASSWORD: let-me-in
      POSTGRES_DB: graph-node

  ipfs:
    container_name: ipfs-test
    image: ipfs/go-ipfs:v0.4.23
    ports:
      - "5001:5001"

Run docker compose up then docker logs graph-node-1337-test.

Observe log errors:

Jun 07 20:10:25.324 WARN Trying again after eth_getBlockByNumber(0, false) RPC call failed (attempt #12) with result Err(failed to send request: error sending request for url (http://host.docker.internal:8545/): error trying to connect: tcp connect error: Connection refused (os error 111)), provider: mainnet-rpc-0

What is the expected behavior?

It should work. If I use trufflesuite/ganache-cli instead of Anvil, it works. I expect it to work with both platforms.

I first filed a bug with Foundry, more context here:

https://github.com/foundry-rs/foundry/issues/1868

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy thiết lập Docker Compose được cung cấp và kiểm tra các log của graph-node cho yêu cầu eth_getBlockByNumber bị lỗi. So sánh thiết lập Anvil với thiết lập Ganache đang hoạt động và lần theo endpoint kết nối được graph-node sử dụng. Hoàn tất khi graph-node kết nối được với Anvil và lập chỉ mục chain đã cấu hình mà không có lỗi kết nối.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, docker-compose, rust
Lĩnh vực
backend, blockchain
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
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.