0

I have set up a geth node on an EC2 instance.

I'm running it with tmux to make sure it continues to run after I disconnect from the server.

To make the node remotely accessible I followed this NGINX guide: https://www.nginx.com/resources/wiki/start/topics/recipes/geth/

All the instructions are followed exactly as written, except that some of the referenced commands were deprecated, and I had to update them: geth --syncmode "fast" --http --http.api "eth, net, web3, personal" --ws --ws.origins "*" --ws.api "web3, eth" --maxpeers 100 --ws.addr "127.0.0.1" --http.addr "127.0.0.1" --http.corsdomain "*" --http.vhosts "*".

The NGINX recipe is copied over into a new file in /etc/nginx/conf.d called default.conf.

In the security group used for the instance port 80 is open for IPv3 and IPv4, with no restriction on source.

When I try Public IPv4 DNS as my endpoint when making a request with web3, I get a 404 error.

Is there anything obvious that I should change to make my geth node work with web3?

EDIT: The NGINX welcome screen shows up for my root url at least.

1 Answer 1

1

Set your ws.addr and http.addr to the location you're trying to access from or all locations (0.0.0.0), right now its only allowing localhost to talk to it so and communications from other computers will be blocked

4
  • I changed the commands to the following but still the same error: geth --syncmode "fast" --http --http.api "eth, net, web3, personal" --ws --ws.origins "*" --ws.api "web3, eth" --maxpeers 100 --ws.addr "0.0.0.0" --http.addr "0.0.0.0" --http.corsdomain "*" --http.vhosts "*"
    – committer
    Commented Sep 10, 2021 at 10:45
  • Since you're not specifying the port in your command the http port defaults to 8545, are you sure there is no firewall and your rpc connection is http://${IP_Address}:8545 ? Commented Sep 10, 2021 at 15:37
  • All my ports are open in my security group for testing: screencast.com/t/6hzjfYafsn4 I'm using this example, and I assume if I specify that IP address as --ws.addr and --http.addr it should be correct: nginx.com/resources/wiki/start/topics/recipes/geth
    – committer
    Commented Sep 10, 2021 at 15:43
  • Can you reach your machine in general? Is this the inbound or outbound security group?
    – Donut
    Commented Dec 8, 2021 at 7:27

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.