Not able to connect to Ethereum node in web browser

0 votes

I am running geth on my VM. Everything runs fine on my machine but I am facing issues while connecting it to Web browser

I used this command to launch the nodes but I cannot connect to them through my browser

geth --networkid 8545 --genesis ~/genesis_block.json --datadir ~/.ethereum_sample console

I'm getting this error:

CONNECTION ERROR: Couldn't connect to node http://localhost:8545, is it running?

This is what I use to set the provider in the browser console:

web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));

Jan 16 in Blockchain by slayer
• 29,040 points
39 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

By default, geth listens only to localhost. You might want to try binding it to all addresses with --rpcaddr "0.0.0.0":

geth --rpc --rpcaddr "0.0.0.0" --rpcport 8545 --nodiscover --networkid "$NETWORKID" --datadir ~/.ethereum_sample --genesis ~/genesis_block.json
answered Jan 16 by Omkar
• 67,000 points

Related Questions In Blockchain

0 votes
1 answer

Not able to pull any events in ethereum

You need to catch the even emitted ...READ MORE

answered Dec 31, 2018 in Blockchain by Omkar
• 67,000 points
16 views
0 votes
1 answer

Not able to send ethers in private ethereum network

Your account is locked by default due ...READ MORE

answered Jan 9 in Blockchain by Omkar
• 67,000 points
14 views
0 votes
1 answer

Not able to create new account in geth for private ethereum blockchain

personal.newAccount() is not a default geth method. This ...READ MORE

answered Jan 17 in Blockchain by Omkar
• 67,000 points
93 views
0 votes
1 answer
0 votes
0 answers

Error: Unexpected token o in JSON at position 1

I have been working with Interacting a ...READ MORE

Mar 6 in Blockchain by saeedi
• 120 points

edited Mar 6 by Omkar 174 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
88 views
0 votes
1 answer
0 votes
1 answer

Not able to invoke a contract in Ethereum Private chain using geth

Hope this helps: contract mortal { /* ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 67,000 points
32 views
0 votes
1 answer

Not able to create new account in geth for private ethereum network

Looks like the account you are trying ...READ MORE

answered Dec 6, 2018 in Blockchain by Omkar
• 67,000 points
50 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.