I have just finished syncing to the testnet, but I'm having trouble running geth console on it.

Storing the blockchain on an external usb drive, this is the command I used to start geth on the testnet $ geth --testnet --datadir /media/removable/Lexar/ethereum/ --ipcpath ~/.ethereum/geth.ipc

and attempting to attach to the network with geth console geth --testnet attach gave me this error:

Fatal: Failed to start the JavaScript console: api modules: Post dial tcp getsockopt: connection refused

I read this answer here, but even with the --ipcpath flag as suggested, it doesn't work.

Please advise. Any help would be appreciated.

1 Answer 1


Once a geth node is already running on your machine then to attach you don't need to give rpcaddr once again, you can use below command to attach console to your already running geth node -

geth attach ipc://path/to/ipc/datadir/geth.ipc

You just need to know your IPC file and then you can attach it using above command.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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