This forum is a read-only archive. Posting, replying and signing in are disabled.

API Connection Refused

peterd

I keep getting a ‘connection refused’ error when I try to connect to my algorand node (running on Ubuntu 18.04) over my LAN.

So far I have…

  • Checked $ALGORAND_DATA/algod.net to find the API endpoint (Running on 8080)
  • Copied the API key from $ALGORAND_DATA/algod.token to my code
  • Opened port 8080 for all incoming connections
  • Ensured that algod was listening on 8080 using sudo netstat -tulpn

const algosdk = require(‘algosdk’);

const algodToken = ‘API Key’;

const algodServer = ‘http://LAN IP’;

const algodPort = 8080;

const algodClient = new algosdk.Algodv2(algodToken, algodServer, algodPort);

(async () => {

let status = await algodClient.status().do();

console.log('Algorand node status: %o', status);

})();

I am stuck and not sure what to do next to troubleshoot my problem, any advice is much appreciated?

✔ Solved by fabrice in post #5
JasonW

any chance you can run that node code on the server to make sure that is working.

fabrice

Have you changed the EndpointAddress in config.json to allow connections from 0.0.0.0 instead of just localhost?

See

✔ Solution
peterd

No I had not done this step. This fixed my issue, thanks for your help!