chainlens-free icon indicating copy to clipboard operation
chainlens-free copied to clipboard

Impossible to connect to local EVM network instance

Open lucianoacsilva opened this issue 10 months ago • 1 comments

Hello,

When trying to run the services described in docker-compose file, the ingestion service does not recognize the local EVM network running at port 8545. I passed the en variable NODE_ENDPOINT as described in the README.md file, but the logs of the service return "Connection Refused", as shown below:

java.net.ConnectException: Failed to connect to /172.16.239.1:8545

Someone know how could I solve these issue?

I am running the command as follows:

NODE_ENDPOINT=http://172.16.239.1:8545 docker-compose up

I am running both the explorer and the local EVM network on a WSL 2 distribution.

lucianoacsilva avatar Apr 02 '24 14:04 lucianoacsilva

I had a similar error. What fixed it for me was changing NODE_ENDPOINT to http://host.docker.internal:8545 instead of http://localhost:8545. My Besu network was hosted on Docker, don't know if yours is.

vikipedia48 avatar Apr 04 '24 07:04 vikipedia48

I am also getting the same error any solutions or fix for this ???

Vishva066 avatar Feb 07 '25 11:02 Vishva066

I solved this problem You have to allow the requests coming from any node. Not just localhost.

Initially when you start hardhat with the command

npx hardhat node

It will allow communication only within the localhost.

So to allow communication inside the docker network you can enter the following command like

npx hardhat node --hostname 0.0.0.0

After this you can set the node endpoint to the following"

http://172.16.239.1:8545

Vishva066 avatar Feb 09 '25 03:02 Vishva066