Explore Courses Blog Tutorials Interview Questions
+1 vote
in Blockchain by (47.6k points)

I started Ethereum Blockchain using this command:

geth --datadir ./myDataDir --networkid 1114geth --datadir ./myDataDir --networkid 1114

and then from a different terminal, I am trying to connect to this using the following command:

geth attach

But I am not able to attach geth. I am getting the following error:

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

1 Answer

0 votes
by (106k points)
edited by

The error you are getting because you have not specified a port and address for geth process to connect. So what it is doing is, when you are using geth attach, get is not able to find the address and port mentioned in the command. You can solve this error, as you have mentioned the address and port while starting the Blockchain.

Follow the below-mentioned step:

geth --datadir ./myDataDir --networkid 1114 console 2 --rpc --rpcport 8543 --rpcaddr

There is a lot more to learn than this. Enroll now in Blockchain Online Course to learn more.

Browse Categories