Report this

What is the reason for this report?

IPFS private network on Droplet

Posted on July 20, 2022

Hi, I’ve been trying to create an ipfs private network using droplets, node on the network don’t see each other. I believe the issue is that the ports are not open, even when I set them to using ‘ufw’. For example, in the droplet, I add rules like: ‘ufw allow 4001’, then telnet to <Droplet_IP> 4001, I get a return of gibberish characters:

telnet <Droplet_IP> 4001

▐╒║T╖yc§π∩π┼é═▓╜#↔╡Kê╗óf╥)HªÿÆd
                               ,»b╚$TÜ6á

Connection to host lost.

if I do

root@ubuntu-s-1vcpu-1gb-sfo3-01:~# netstat -plant | grep 4001

tcp        0      0 0.0.0.0:4001            0.0.0.0:*               LISTEN      1005/ipfs
tcp6       0      0 :::4001                 :::*                    LISTEN      1005/ipfs

and ufw status:

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
4001                       ALLOW       Anywhere
9096                       ALLOW       Anywhere
22 (v6)                    ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
4001 (v6)                  ALLOW       Anywhere (v6)
9096 (v6)                  ALLOW       Anywhere (v6)

it looks like the ports are open?

I’ve read that a service must be running and listening on 0.0.0.0, for the port to work. Even when I change the ipfs node, I still get the same result. Other nodes cant see it, and telnet returns gibberish.

What is the correct way to open a port on a droplet, so I can get a good response from telnet?

Initially, when I tested installing ipfs on unbuntu 20.04 droplets. Maybe last month, it was working out of the box. Nodes could see each other, and I could upload files from any machine in the network. Since then, something has changed. Any help you could provide would be greatly appreciated.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

It looks like you’re doing the right steps in opening the ports using ufw. From your netstat and ufw status output, it appears that the ports are open and IPFS is listening on both IPv4 and IPv6 addresses correctly.

The gibberish characters you receive from the telnet command are likely due to IPFS using a binary protocol when communicating over the specified port. So, it’s not an issue, but rather the expected behavior when connecting to an IPFS node using telnet.

To verify that the nodes can communicate with one another and there are no connectivity issues, try using the ipfs swarm peers command on each of your nodes. This command will show you a list of all connected nodes in your IPFS network.

If you still face an issue, review your IPFS configuration files on each node and make sure the settings are correct and consistent across all nodes in your private network. Also, keep in mind to change Swarm.Key and Bootstrap settings to ensure a private and interconnected network between your nodes.

For more information on setting up and troubleshooting IPFS on your Droplets, refer to this IPFS official documentation.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.