I'm using docker-compose to run ethereum node with Docker:

  # ethereum node
    container_name: ethereum-node
    image: ethereum/client-go:v1.8.10
      - "8545:8545"
      - "8546:8546"
      - "30303:30303"
      - "30303:30303/udp"
      - ./ethereum-data/.ethereum:/root/.ethereum
      - ./ethereum-data/keystore:/root/.ethereum/testnet/keystore
      - ./ethereum-data/.ethash:/root/.ethash
    restart: always
    command: -verbosity=4 --fast --cache=512 --testnet

After docker-compose up i can see in the log:

INFO [07-03|11:40:19] IPC endpoint opened url=/root/.ethereum/testnet/geth.ipc

and i'm able to connect to it from the container with

docker exec -ti ethereum-node geth attach ipc:/root/.ethereum/testnet/geth.ipc

Though i've mounted volumes and i can see geth.ipc:

$ls ./ethereum-data/.ethereum/testnet/
.        ..       geth     geth.ipc keystore

i can't connect to from host:

$geth attach ./ethereum-data/.ethereum/testnet/geth.ipc Fatal: Unable to attach to remote geth: dial unix ./ethereum-data/.ethereum/testnet/geth.ipc: connect: connection refused

How can i do it? I'd prefer to use IPC (though i've succeed to connect over HTTP RPC on 8545).

Your Answer

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

Browse other questions tagged or ask your own question.