When executing my script files from a machine that needs to connect to a remote geth node, I get an "Invalid JSON RPC response: undefined" when using web3.personal.* functions.
In particular I have started geth in one workstation with the following parameters:
> geth --datadir /home/user/eth/ --networkid 123 --rpc --rpcapi "personal,web3,eth,net,db" --rpccorsdomain "*" console 2>>geth.log
Initially I tested the scripts by executing them locally, using the following HttpProvider:
Web3.providers.HttpProvider("http://localhost:8545")
The scripts are executed as expected and all the web3.personal.* functions such as web3.personal.listAccounts and web3.personal.unlockAccount() work well.
However when I execute the exact same script from a remote workstation and thus replace localhost with the IP of the machine running geth I get the following error:
Error: Invalid JSON RPC response: undefined
To be noted that I can execute other functions remotely, such as web3.version.api and web3.eth.contract(abiHEC), etc. So the problem seems to be the web3.personal.*.
I am using web3 version 0.20.6 and geth 1.8.2.
Do you have any suggestions on how to solve this?
Could it be that this is a security feature not allowing the use of personal functions remotely?
If so, do you have any recommendation on how I can invoke a smart contract function remotely? Thank you.