2

I'm using IPFS to host a website and I need a way to keep the website files online all the time.

I know that ipfs has a garbage collector that removes the content after 24 hours.

And that if I pin the content with ipfs pin add <file> then it's like adding the file again so it's not deleted from the network.

Now my question is How do I keep my IPFS files online forever?

Can I create a cron job to keep re-pinning the content every 24 hours? or is there a better way?

  • The problem is that I was using other address when doing ipfs name public <hash> so yeah. It works. – Merunas Grincalaitis Aug 30 '17 at 21:59
2

Once a piece of content is pinned, it is stored forever on your node until you explicitly unpin it. There is no need to pin a file more than once. If you pin a file, it never gets garbage collected like the files that are not pinned do.

From the IPFS Pinning Readme:

A pinned object cannot be garbage collected, if you dont believe me try this:

ipfs add foo
ipfs repo gc
ipfs cat <foo hash>
  • I did pin the item and it doesn't work, the file still gets removed after a while – Merunas Grincalaitis Aug 27 '17 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.