1

I've my dApp running on AWS and Geth running locally. How am I supposed to connect my hosted dApp with the Geth?

I'm connecting my web3(using web3.py) using my computer's(Windows OS) IP address.

web3 = Web3(Web3.HTTPProvider("http://xx.xx.xx.xx:8545"))

Port 8545 has been also opened via Firewall port.

Running my Geth node using

geth --datadir ./Doc-Nodes --networkid 4780 --rpc --rpcapi "db,personal,eth,net,web3,debug,admin" --rpccorsdomain="*" --rpcaddr="0.0.0.0" --rpcport 8545 --allow-insecure-unlock console  

But I'm always getting the error while sending the request to dApp.

requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='xx.xx.xx.xx', port=8545): Max retries exceeded with url: / (Caused by ConnectTimeoutError(urllib3.connection.HTTPConnection object at)

How am I supposed to connect both? I'm confused about what IP should be provided in the web3 connection as well as rpc address.

Thanks.

2 Answers 2

0

You need to pass --rpcvhosts * too

1
  • It's still not working for me. Nov 6, 2019 at 12:01
0

You can try using a reverse ssh connection on a host with public ip of your property, or otherwise use ngrok for the reverse ssh.

host= public ip

$ssh -R 8545:localhost:<port> user@<host>

$ngrok tcp 8545

web3 = Web3(Web3.HTTPProvider("http://<host>:<port>")) //or ngrok link connection with port

Your Answer

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

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