I tried apirus to connect to local ganache node.

Ganache node is running on localhost:7545.

git clone https://github.com/blk-io/epirus-free.git
cd epirus-free
docker-compose pull
NODE_ENDPOINT=http://docker0:7545 docker-compose up

But couldn't connect. Error log says docker0 is unknowHost.

api_1      | 2020-03-26 07:05:52.323 ERROR 1 --- [   scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task.
api_1      | 
api_1      | java.util.concurrent.CompletionException: java.net.UnknownHostException: docker0
api_1      |    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
api_1      |    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
api_1      |    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
api_1      |    at java.base/java.lang.Thread.run(Unknown Source)
api_1      | Caused by: java.net.UnknownHostException: docker0
api_1      |    at java.base/java.net.InetAddress$CachedAddresses.get(Unknown Source)
api_1      |    at java.base/java.net.InetAddress.getAllByName0(Unknown Source)
api_1      |    at java.base/java.net.InetAddress.getAllByName(Unknown Source)
api_1      |    at java.base/java.net.InetAddress.getAllByName(Unknown Source)
api_1      |    at okhttp3.Dns$Companion$DnsSystem.lookup(Dns.kt:49)
api_1      |    at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:160)
api_1      |    at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:125)
api_1      |    at okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:7

How to connect to local ganache node from docker container ??

  • Please elaborate on "But couldn't connect". Also, why have you tagged this question under truffle? Mar 26 '20 at 6:55
  • Thank you for your comment. I fix my question. Mar 26 '20 at 7:05

As per the steps in blk-io/epirus/README

Note that if setting NODE_ENDPOINT to a local Ethereum instance, you may need to use the IP address associated with the Docker bridged interface, often denoted by docker0.

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet  netmask  broadcast

Instead of

NODE_ENDPOINT=http://docker0:7545 docker-compose up

it should be

NODE_ENDPOINT= docker-compose up

i.e. in place of docker0 the inet value for docker0 has to be placed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.