I am trying to access my Geth node (specifically a smart contract at a particular address) running on a remote server from my UI (Angular JS)
It works perfectly when using localhost or the ipv4 address on the same machine.
When trying to run the same code using the public IP address (ports are open), I am getting an error:
Error: CONNECTION ERROR: Couldn't connect to node http://xxx.xxx.xxx.xx:8585.
My code is as follow:
var Web3 = require('web3'); var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://x.x.x.x:8888'));
I have tried the following:
1) tried with local host or ipv4 at x.x.x.x 2) tried with 0.0.0.0 at x.x.x.x 3) public ip at x.x.x.x
My Geth command is:
geth --rpccorsdomain "*" --rpc --rpcport "8585" --rpcaddr 0.0.0.0 --datadir="myChain" --port "30302" --autodag --networkid 65535 --nat=none -
-rpcapi="db,eth,net,web3,personal,web3" --nodiscover -verbosity 5 --maxpeers 3
console
Any suggestions? Thanks in advance.