0

Are there any special steps to connect an web app to the gethrpc?

testing the webapp locally with ganache works fine.

I have an geth Ethereum node running and started the gethRPC. The web app can't connect to the RPC. Are there any special steps which I have to perform for establishing the connection?

chrome console shows:

OPTIONS http://localhost:8545/ net::ERR_CONNECTION_REFUSED
  • What is the complete command that you used to start the geth node? Also, in your webapp, what is the complete URL that you specified for the geth node? (The URL should have the remote server's hostname, and not localhost) – Ajoy Bhatia Jan 24 '18 at 16:58
1

The remote server must be CORS enabled. You can start the geth with the below command.

geth --rpc --rpcapi db,eth,net,web3,personal --cache=2048  --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*"
| improve this answer | |
0

Network creation and connect to same network

  1. networkid 20 mean private network
  2. default port 60303

geth --networkid 20 --port 60303 --rpc --rpccorsdomain "192.168.0.1:8545" --lightkdf --cache 16 --datadir "D:\CHAINDATAFINAL" console

| improve this answer | |
0

Thanks for the input!

This works for me:

geth --rinkeby --rpc --rpcport "8545" --rpcaddr "0.0.0.0" --rpccorsdomain "*" --datadir "/home/Ethereum" console

Just have to read about the Security now.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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