Question about connecting to a node from a different computer - Algorand
Question about connecting to a node from a different computer
post by Allennick on Jul 1, 2021
Hi! Whenever I try to connect to my node (it is running on a ubuntu machine) it gives me the error highlighted in the screenshot. Why is that? I changed the config.json so that connections are accepted from 0.0.0.0:8080 in node config.json file.
post by fabrice on Jul 1, 2021
Did you stop and start the node after changing the config.json file?
Can you show the output of (on the server):
sudo netstat -tulpn | grep algod(you may need to install
netstat:sudo apt install net-tools)Can you check you don’t have any firewall rules blocking it on the server:
sudo ufw status?
post by Allennick on Jul 2, 2021
Hi Fabrice!
1 - yes, I restarted it
2 -
nick@nick-ThinkPad-T530:~/node$ sudo netstat -tulpn | grep algod
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 2929/algod
3 -
nick@nick-ThinkPad-T530:~/node$ sudo ufw status
Status: inactive
post by scholtz on Jul 2, 2021
I guess you need to set it in the config to listen on 0.0.0.0 instead of 127.0.0.1
post by Allennick on Jul 2, 2021
This is what I get now when I try to run the command Fabrice mentioned:
nick@nick-ThinkPad-T530:~/node$ sudo netstat -tulpn | grep algod
[sudo] password for nick:
tcp6 0 0 :::8080 :::* LISTEN 13220/algod
The program still gives me the same error as before, so it refuses to connect
post by scholtz on Jul 2, 2021
Try to access it using ipv6 or disable ipv6 ?
post by tsachi on Jul 2, 2021
I’m going to sound pretty stupid, but I’m going to say it anyway -
try to change the X.X.X.X in the above code with 127.0.0.1; same goes for the token that can be grabbed from algod.token in your data directory.
Also, I’m not sure if the http:// prefix in the algod_address is needed.
post by fabrice on Jul 2, 2021
Can you copy-paste your config.json here?
In your first netstat, you’re only listening on localhost as @scholtz pointed out. So that could not work.
And in the second netstat, you only have ipv6 which is very strange.
post by Allennick on Jul 3, 2021
Yes already done! I was writing X.X.X.X because I thought it was something private. It doesn’t work. Now I’m going to let you see what Fabrice suggested me
post by Allennick on Jul 3, 2021
This is what I have inside the config.json
{
"Version": 16,
... (truncated for brevity)
"VerifiedTranscationsCacheSize": 30000
}
post by fabrice on Jul 3, 2021
- Can you replace your config.json so it only contains the fields that changed, just to be on the safe side.
Something like:
{
"EndpointAddress": "0.0.0.0:8080"
}
Can you check on the algod machine if everything works properly? E.g.:
curl -s -H "X-Algo-API-Token: thetoken" http://127.0.0.1/v2/statusDo the same as above except using the address of the algod machine instead of
127.0.0.1. Does it still work?If the above works and the same command does not work from another machine, the issue is most likely that there is a firewall somewhere on your network.