How often should I re-run ipfs dht provide _____ to keep files available?

If I have an ipfs node running and announce to the network that I have some content pinned to my machine via ā€œipfs dht provide hash keyā€, how long will the network be aware that my node is providing this content?

Iā€™ve noticed that after a few days, ā€œipfs dht findprovs same hash I provided earlierā€ returns nothing. Does terminating the ipfs daemon sort of ā€œeraseā€ that announcement? I would love to read a detailed explaination of DHT, it seems like black magic at the moment.

2 Likes

go-ipfs has a mechanism called reprovider which is supposed do handle providing content over time for you. There are some problems with how it works currently:

  • Itā€™s only running a single provide query, and each query can take a significant amount of time (10-60s)
  • By default itā€™s providing all blocks in the blockstore, which is less than optimal

We are working on improving provider subsystem - https://github.com/ipfs/go-ipfs/issues/5774, this should also address some reprovider issues.

For now what Iā€™d recommend doing is to change Reprovider.Strategy in .ipfs/config to roots (to only reprovide pin roots) or pinned (to provide all pinned blocks).

Iā€™d recommend using the roots strategy and pinning all blocks you think users will try to access directly.

1 Like