graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

[Bug] Cannot support multiple chains

Open ziyiyu opened this issue 11 months ago • 3 comments

Bug report

I want to listen to multiple chains within a single graph node, and I noticed the description in the docker/Dockerfile file is as follows: # The etherum network(s) to connect to. Set this to a space-separated list of the networks where each entry has the form NAME:URL ENV ethereum="" This seems to imply support for multi-chain.But when I use multiple chains in docker/docker-compose.yml ethereum: 'mainnet:http://host.docker.internal:8545 polygon:http://host.docker.internal:8545' The following error will occur.

I'm not sure if this is a bug or if multi-chain monitoring is currently not supported.

Relevant log output

graph-node-1  | Waiting for Postgres (postgres:5432)
graph-node-1  | error: unexpected argument 'polygon:http://host.docker.internal:8545' found
graph-node-1  | 
graph-node-1  | Usage: graph-node [OPTIONS]
graph-node-1  | 
graph-node-1  | For more information, try '--help

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out

  • [ ] Tick this box if this bug is caused by a regression found in the latest release.
  • [ ] Tick this box if this bug is specific to the hosted service.
  • [X] I have searched the issue tracker to make sure this issue is not a duplicate.

OS information

Linux

ziyiyu avatar Dec 29 '24 13:12 ziyiyu

I have the same problem, when will resolve this? @Jannis

ootiger avatar Jan 22 '25 14:01 ootiger

Encountered the same issue, and seems like the only working solution is to pass the config via config.toml like

[store]
primary = { connection = "postgresql://${postgres_user}:${postgres_pass}@${postgres_host}:${postgres_port}/${postgres_db}", pool_size = 50 }

[deployment]
[[deployment.rule]]
indexers = ["default"]

[chains]
ingestor = "block_ingestor_node"

[chains.mainnet]
shard = "primary"
provider = [
    { label = "mainnet", url = "http://mainnet:8545", features = [
        "archive",
        "traces",
    ] },
]

[chains.testnet]
shard = "primary"
provider = [
    { label = "testnet", url = "http://testnet:8545", features = [
        "archive",
        "traces",
    ] },
]

where testnet:8545 and mainnet:8545 are the addresses or the RPC nodes you want to connect to

akanoce avatar Mar 02 '25 10:03 akanoce

If you want multiple chains on 1 graph node, e.g. base and avalanche, use this in the docker-compose.yml:

ethereum: 'base:https://mainnet.base.org --ethereum-rpc avalanche:https://api.avax.network/ext/bc/C/rpc'

This is tricky but works for me

apeview avatar May 15 '25 07:05 apeview