1

Created a Digital Ocean Ubuntu 20.04 droplet and setup an IPFS server node in it based on this tutorial.

If I run the following command in the server

ipfs swarm peers

I get the expected results

enter image description here

In addition, according to the documentation

Every command usable from the cli is also available through the HTTP API. For example:

ipfs swarm peers

curl -X POST http://127.0.0.1:5001/api/v0/swarm/peers

so, as I try

  • In Postman

Error: connect ECONNREFUSED 164.92.254.19:5001

enter image description here

  • In curl

curl: (7) Failed to connect to 164.92.254.19 port 5001 after 2295 ms: Connection refused

enter image description here


For reference, here's the firewall

enter image description here

and as you can see TCP 5001 is open.

Peter Turner
  • 1,482
  • 4
  • 18
  • 39
Tiago Peres
  • 121
  • 9

1 Answers1

1

Based on a tip from the Reddit user techiesaravana who says

Hi, you have to edit ipfs config file you need to change the Address field to

"/ip4/0.0.0.0/tcp/5001"

I was able to solve the issue. To do so, I ran

ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001

and then

systemctl restart ipfs

Now I get the expected result

enter image description here

enter image description here

Tiago Peres
  • 121
  • 9