Graph node unable to connect to Anvil
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker, docker-compose, rust
- Domain
- backend, blockchain
Research direction
Start by running the provided Docker Compose setup and inspecting the graph-node logs for the failed eth_getBlockByNumber request. Compare the Anvil setup with the working Ganache setup and trace the connection endpoint used by graph-node. Done means graph-node connects to Anvil and indexes through the configured chain without connection errors.
Written by the indexing model from the issue text.
Description
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:
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from graphprotocol/graph-node
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
graphprotocol/graph-node#6719 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
graphprotocol/graph-node#6673 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
graphprotocol/graph-node#6650 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
graphprotocol/graph-node#6722 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
graphprotocol/graph-node#6721 ·
All issues in graphprotocol/graph-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100