rest17
rest17

Reputation: 35

I am getting an error while trying to connect with node using geth tool

I am having an error while trying to attach to the quorum node, using the following command :--

geth attach --datadir new-node-1/geth.ipc

then I get this error


Unable to attach to remote geth: dial unix new-node-1/geth.ipc: connect: no such file or directory

I tried to locate path of geth.ipc but nothing was there. I guess the file is not being created.

any suggestions guys..

Upvotes: 1

Views: 3522

Answers (3)

Patrick Collins
Patrick Collins

Reputation: 6131

When you start your geth node by running geth, it will set a default datadir of:

$HOME/.ethereum

If you specify something else, with the --datadir flag, it will set the data directory to that location.

When you run geth attach you're looking for the geth.ipc that is created in the datadir. So, if your geth command looks like:

/usr/local/bin/geth --datadir /var/lib/geth

Then, you'd attach with:

/usr/local/bin/geth attach /var/lib/geth/geth.ipc

Upvotes: 0

Viraj Shelar
Viraj Shelar

Reputation: 1

Try out below:

geth attach http://127.0.0.1:8545

It worked for me

Upvotes: 0

Satpal Sandhu
Satpal Sandhu

Reputation: 439

You should be running the command like this (without --datadir): geth attach new-node-1/geth.ipc

If that still doesn't work then make sure you have the correct path for the ipc file. Is new-node-1 definitely the same path that was specified to the quorum node when it was started (i.e. with with --datadir new-node-1).

If the path is correct but geth.ipc file doesn't exist then the node hasn't managed to start up. Check the log file to see if there were any errors.

Upvotes: 0

Related Questions