In my AWS ec2 instance, I run geth and specify --rpcport and --rpcaddr using "Public DNS" like this:

geth --datadir "./signer1/data" --networkid 55661 --port 2000 --rpc --rpcport 5566 --rpcaddr "ec2-13-114-49-66.ap-northeast-1.compute.amazonaws.com" --rpcapi "eth,personal,web3,net,db" --mine

It will work fine, but if I specify --rpcaddr as "Public IP":

geth --datadir "./signer1/data" --networkid 55661 --port 2000 --rpc --rpcport 5566 --rpcaddr "" --rpcapi "eth,personal,web3,net,db" --mine

I will get Error: Invalid JSON RPC response: "" when I try to deploy the contract through web3.

What's the reason causes this different behavior?

  • Did you find a solution?
    – jolly
    Aug 10, 2020 at 2:56

1 Answer 1


Untested on my end. However, I think there is a reasonable chance the answer may be CORS. When your RPC client attempts to send a request, your geth may be replying that the response is coming from a different host (address vs. IP) than the one you are accessing your geth through. If this is the case, you'll need to set one of the CORS command line options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.