About Hash deletion and data replication

There are two scenarios that I’m struggling to understand.

#1 Data Replication
Say I upload a file on my local node (ipfs add ..) and then, I execute ipfs bootstrap add … and ipfs swarm connect ... to connect my node to a remote bootstrap node. Then I can access the uploaded file remotely like this http://remoteip:port/ipfs/hash ...

But then after a while that is no longer the case, and I need to re-execute ipfs connect ... on my local node so that the file is again accessible. Is it normal? Is there way to keep the nodes connected? I would think that ipfs bootstrap add .. would resolve this, but it doesn’t.

#2 Deleting a hash
I understand that to keep a file on a given node I need to pin it, otherwise the garbage collector will remove it the next time it’s executed. Say I pin a given file to several nodes. And then I wish to remove that file from all nodes. Do I need to connect to each node and unpin the file on each node? Can I unpin a file from a remote node?

For now, I’m working with very small files, but in the future, I will need to work with large files and I wasn’t able to find a command or something that could tell me “replication progress” or something similar to get to know whether a file is being transferred to a node when is requested. Anyway, this is a side comment, I’m more interested in any feedback related to the first 2 scenarios.

Thanks in advance!

#1 The network isn’t really designed to work with just two nodes. You need at least some that are running a DHT server (which can be used as bootstraps as well). Then you can add one or more clients to the mix. Yes, nodes will not stay connected, but they will reconnect on demand (based on the info in the DHT). You can force two nodes to stay connected using peering (make sure they both peer with each other, or that causes problems). However, using peering does not ensure that the client will use that specific node to retrieve the data (it used to do that, but these days it looks it up in the DHT and then connects to those, which might include the one you are peered to).

2# Yes, you do need to connect to each and issue the pin rm command. No, you cannot unpin from a remote node (without either an ssh connection to issue commands or using the RPC API).

I think you need to look at: https://ipfscluster.io

1 Like

Great feedback, thank you!