Set up private ipfs

I am creating a private ipfs network for two devices only
I followed the steps in this link
Deploy a private IPFS network in 5 steps | by Sander van Laar | Medium
But unfortunately I am facing the same error on both computers when I run daemon

ipfs daemon
Initializing daemon...
go-ipfs version: 0.12.0
Repo version: 12
System version: amd64/linux
Golang version: go1.16.12
Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: 7755a274fd70862e822ec58c3b59bd43
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.0.105/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.0.105/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/0.0.0.0/tcp/5001
WebUI: http://0.0.0.0:5001/webui
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready

i2022-05-04T16:44:34.402+0200	ERROR	cmd/ipfs	ipfs/daemon.go:567	failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config
2022-05-04T17:00:08.133+0200	ERROR	reprovider.simple	simple/reprovide.go:109	failed to reprovide: failed to find any peer in table

I really donā€™t know the solution
I am new to building networks and I became sane in this problem for a long time. I hope someone can help me.
I donā€™t have much time anymore

You need to populate the bootstrap list for each node. Simply have 1 entry that lists the address of the other node, and theyā€™ll find each other when they start.

1 Like

I applied this link

First, delete all the botstrap list on both devices with a command
Ipfs bootstrap rm --all
Then I write the statement to node 0
ipfs bootstrap add /ipv4/bootnode-ip/tcp/4001/p2p/bootnode peerID
On my main node 0 machine

Then I made an order
ipfs connect /ipv4/bootnode-ip/tcp/4001/p2p/bootnode peerID
on my node 1
But it gives me the error: unknown command " "connect

Is what Iā€™m doing right or not?
Iā€™m really new to this topic and I really hope you can help me

The command is ipfs swarm connect, not ipfs connect.

1 Like

I implemented it like this
But I get another error
I donā€™t know whatā€™s wrong
ipfs swarm connect /ip4/192.168.0.6/tcp/4001/p2p/12D3KooWJxTqvY7Y6ZwquQje98opKJgahhid8fLCQxpR37ufAqFg

Error: connect 12D3KooWJxTqvY7Y6ZwquQje98opKJgahhid8fLCQxpR37ufAqFg failure: failed to dial 12D3KooWJxTqvY7Y6ZwquQje98opKJgahhid8fLCQxpR37ufAqFg:

  • [/ip4/192.168.0.6/tcp/4001] dial tcp4 192.168.0.6:4001: connect: connection refused
    Do you have any idea

Either the node wasnā€™t running, or thereā€™s a firewall in front of it that blocks access to tcp 4001.

P.S. or, the address is wrong. run ipfs id on the target node first, to see what addresses it actually advertises

P.P.S. or, the node you are using isnā€™t on the same private subnet. in that case, the target node has to be publicly reachable (must have a public IP address, not a private one like the one you used). again, check ipfs id to see what it advertises

1 Like

Hi, Iā€™m facing a similar issue. Experimenting with creating a private reverse proxy ipfs gateway with three nodes. I spin up 2 nodes on Digital Ocean, with a private configuration. I set the bootstrap list in each config, before starting the Daemons. The two D.O. nodes see each other, and work fine. However, neither of them see my PC node I have running.

In the above pic, the black terminal is the node I have running on my PC, I notice that it doesnā€™t advertise on my PC public ip, whereas the two D.O. nodes do. Iā€™m kinda stuck at the moment, how can I get the other nodes to see the PC node? I checked the firewall, it looks to me like it doesnā€™t block anything for ipfs.

When I start my PC node, it tells me there are no peers:

Daemon is ready
2022-07-18T20:11:21.405-0700    ā†[31mERRORā†[0m  cmd/ipfs        ipfs/daemon.go:567      failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config

Bootstrap list for PC:

"Bootstrap": [
    "/ip4/159.203.186.131/tcp/4001/ipfs/12D3KooWA88DEoBGMpNsBuXQ42iLrwhk4H4hzVRnsppNQTKvHeEq",
    "/ip4/143.198.116.247/tcp/4001/ipfs/12D3KooWFX7ZbakJGvABndCwZLVsPXs7NHaQUfvnhW5HAzVgvzz6"
  ],

Why does your bootstrap list say /ipfs/ instead of /p2p/?

Hey, thanks for the response :slightly_smiling_face: , Used these tutorials:

https://www.geekdecoder.com/setting-up-a-private-ipfs-network-with-ipfs-and-ipfs-cluster/

Should it be p2p? Iā€™ll try and see if that fixes it.

This is what my node says about bootstrap list.
image

May need the same configuration.

Can you ipfs swarm connect <multiaddress> from your PC at home to the DO nodes?

The /ipfs/ vs /p2p/ thing should not matter. /ipfs/ is a legacy form however.

Hey, Iā€™ve tried ipfs swarm connection both sides:

From PC to DO:

From DO to PC:

Here is what the firewall settings for ipfs on PC look like:

You probably need to configure your DO nodes to be reachable from the internet, because they donā€™t seem to be.

ah ok, I did install firewalls on the DO machines based on this tutorial, and another one I found.
Itā€™s a bit odd, I was actually able to get a connection between all of the nodes when entering the commands manually in some initial tests. I wrote some shell scripts to do the installs, also seemed to work initially. DO has recently done some upgrades, then it stopped working altogether. My understanding on this stuff is a bit rudimentary. Not sure of the best way to debug it, if anyone could point me to a good tutorial Iā€™d be immensely appreciative. Iā€™ll go ahead and post the fire wall settings I installed on the DO machines, in case anyone sees anything that seems off. Itā€™s possible I missed something, or it got messed up in the shell scripts somehow:

Using Config Server, the port configs(5001, I added, since I was running into problems):

Soooo, where are the rules allowing incoming TCP/UDP traffic to 4001?..

and on the flip side, why are you allowing 5001 in?

1 Like

Why oh why indeed lol, I think I added the 5001 based on some post I read along the wayā€¦ itā€™s a bit of a blur now. Still, I updated it adding 4001, with the same result.

I will test shutting down the firewall, determining the DO nodes are not accessible to the internet:

That is based on what ipfs returns right? Is there another way I can test if they are accessible?

Yes. Use nc (or telnet) to connect to TCP/4001 from the outside (from your PC). If it works, it should look like this:

> nc 192.168.2.9 4001
/multistream/1.0.0
^C
> 

of course, use the IP address of what you are trying to test (that was a just a test on my LAN)

2 Likes

image

thatā€™s an interesting responseā€¦ Iā€™ll keep looking for the answer, at least I have a better idea where to look now. Thanks for your help guys :+1:

1 Like