Graph node unable to connect to Anvil

未关闭
#3,640 6 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
docker, docker-compose, rust

调研方向

首先运行提供的 Docker Compose 设置,并检查 graph-node 针对失败的 eth_getBlockByNumber 请求输出的日志。将 Anvil 设置与正常工作的 Ganache 设置进行比较,并跟踪 graph-node 使用的连接端点。当 graph-node 连接到 Anvil,并在没有连接错误的情况下为配置的 chain 建立索引时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

ops Stale

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

主要语言
Rust
星标
3.2k
派生
1.1k
平均合并
4 天 1 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

graphprotocol/graph-node 的其他 Issue

查看 graphprotocol/graph-node 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。