I have geth running on an AWS EC2 instance. Here is how I started it:

geth --rpc --rpcaddr "" --rpcport "8545"  --rpc --rpccorsdomain "*"

from that same instance I can use python's request.post to issue a RPC request to http://localhost:8545. It works perfectly.

Now I'm trying to do the same request from my local computer by requesting to http://xx.xxx.xxx.xx:8545 but Im getting the error bellow:

HTTPConnectionPool(host='xx.xxx.xxx.xx', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000028F39163438>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

I have added rules on AWS security group to allow all inboud from all IPs. what could I be missing?



To connect to AWS instance via RPC you have to assign the public IP of that instance as the rpc address.

geth --rpc --rpcaddr "Public IP of AWS" --rpcport "8545" --rpccorsdomain "*" console

If it was behind any proxy server then you have to redirect the request from a proxy server to your AWS server through port forwarding.

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.