0

I have installed a geth-node on raspberry pie. Raspberry pie is connected via Ethernet. Now I am trying to connect to this node via web3.js

    var ethWeb3 = new Web3(new Web3.providers.HttpProvider('http://192.168.0.220:8042'));

192.168.0.220 ->is the address of device. (I connect so via terminal)

But if I check ethWeb3.isConnected(), it returns false.

My geth script is:

geth --identity "node1" --fast --networkid 42 --datadir /home/pi/ChainSkills/node --nodiscover --rpc --rpcport "8042" --port "30303" --unlock 0 --password "/home/pi/ChainSkills/node/password.sec" --ipcpath /home/pi/.ethereum/geth.ipc --dev

Where can be a mistake?

  • I connect to web application, where I try to run web3.js, so: localhost:9999 – Lena Jul 22 '18 at 15:25
0

Try adding when starting geth

--rpcaddr 0.0.0.0

Otherwise it's listening only on the localhost

geth --identity "node1" --fast --networkid 42 --datadir /home/pi/ChainSkills/node --nodiscover --rpc --rpcaddr 0.0.0.0 --rpcport "8042" --port "30303" --unlock 0 --password "/home/pi/ChainSkills/node/password.sec" --ipcpath /home/pi/.ethereum/geth.ipc --dev
| 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.