0

I have an issue of connecting Ethereum private node on that particular Ip server in which I setup the ethereum node.I create a gui of server enbale json rpc client on 127.0.0.1:8545.When I connect this address with web3 on my server gui I open browser and hit my address "3.10.9.248/index.php" It shows connected with this "127.0.0.1:8545" and I am getting my ethereum node address and balance.When I hit this address outside the GUI of server 3.10.9.248/index.php then its shows nothing.

Its shows private node is running only in node GUI browser not in any other browser.I want to create an API for ethereum node and provide access to another website to use that API.

Thanks

2

Take a look at the settings of your node.

Most likely your rpcaddr is 127.0.0.1. This means only the server/local machine can access this node/blockchain.

So you need to make a change in order to allow external connections.

The easy way to do this is with rpcaddr 0.0.0.0. But this is very insecure. Now everyone can access your node. So you should specify which IP can access your node.

Either manually input your device IP which wants access or build an API around it which handles this stuff for you.

  • Thanks for your response.I tried to run geth with specific IP with this command "geth --allow-insecure-unlock --datadir ethchain --networkid 1 --rpcport 8545 --port 30303 --rpcapi="db,eth,net,web3,personal,admin,txpool,debug" --rpc --maxpeers 0 --nodiscover --rpccorsdomain "3.10.9.248" --rpcaddr "3.10.9.248" console" then It returns error "Fatal: Error starting protocol stack: listen tcp 3.10.9.248:8545: bind: cannot assign requested address" When I added 127.0.0.1 this IP then it is working fine. – Nandni Sep 18 at 3:49
  • cannot assign requested address means 3.10.9.248:8545 is used by another process. Please check lsof -i TCP| fgrep LISTEN – Md Rayhanul Masud Saom Sep 18 at 4:03
  • @MdRayhanulMasudSaom I checked. It is not used by any other process – Nandni Sep 18 at 5:08
  • I think the address you are assigning is wrong. My ip is ..*.202 but I tried ..*.201. That time i got the same error. As your port is not used, the address might be wrong. Please check your assigned address. – Md Rayhanul Masud Saom Sep 18 at 6:14
  • Maybe firewall or something blocks your blockchain from opening a connection to 3.10.9.248. Or as other guy mentioned you already have something running on this port. – Niklas Feurstein Sep 18 at 13:32

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.