blockchainremote-accesssia

Sia daemon api: connection refused


I synced a Sia node, but I can't access it from outside:

curl -A "Sia-Agent" -u "":"myPassword" "111.111.111.111:9980"

curl: (7) Failed to connect to 111.111.111.111 port 9980: Connection refused

I also can't access with siac:

./siac -a 111.111.111.111:9980

Could not get consensus status: [request failed; Get http://111.111.111.111:9980/consensus: dial tcp 111.111.111.111:9980: connect: connection refused]

I ran sudo ufw allow 9980 (that's why it didn't showed timeout), but the connection refused. What's the problem?


Solution

  • David Vorick (CEO of SIA) said that by default the siad API only accepts connections over localhost. If you are going over the internet we recommend you use ssh tunneling: https://support.sia.tech/article/ljzu8k4hqn-using-sia-ui-on-a-remote-node

    ssh -f user@domain -L 9980:localhost:9980 -N
    

    (There is an older flag --disable-api-security, but maybe better to not use. WARNING: Running siad with the authenticate-api=false and --disable-api-security is considered DANGEROUS.)