Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
4 views
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 http://127.0.0.1:8543

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

Fatal: Failed to start the JavaScript console: api modules: Post http://127.0.0.1:8543: dial tcp 127.0.0.1:8543: 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 127.0.0.1

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

Browse Categories

...