I have some problems with understanding how IPFS works.
I’m using go-ipfsv0.14.1
That’s what I did:
Installed go-ipfs
Initialized repository
Runned ipfs daemon command
Uploaded a file using WebUI
Opened a file on IPFS to check if it’s available
Turned off Daemon
Checked if my file is still available from my another device
And I didn’t know why this file was still available if my node was shut down. As far as I understood IPFS files can be accessed only if a node that has this file is active. Are those files cached for some time? I didn’t pin this file to any pinning service so that’s not the case.
Also I tried to run manually a garbage collection (which as I understood should delete all unpinned files from my repository) but that file was still available.
Next step which I made was to run ipfs dht findprovs <hash> to check which nodes have this file and as a result I’ve got only id of my node - so why this file was available if my node was turned off?
Then I’ve pinned this file to Pinata and runned again ipfs dht findprovs and I was still getting only the id of my node. Why? Shouldn’t I also get the id of Pinata node?
I will be really greatful for a response because I was not able to find answer to those question in the ipfs docs.
Whatever you used to access the file on IPFS cached it the first time and is just returning it from its cache now. It will eventually be GC’d from it, but that can take a while.
This version doesn’t exists yet FYI. (and I probably wont release it anyway since the go1.18.5 changes don’t impact us afait)
Are you sure about that ?
My understanding of the post is that OP accessed the file via his own node and after unpinning the file ran garbage collecting, which would un-chache the file? What else could have cached the file?
The description was imprecise about several of the steps, but it doesn’t matter, I’m simply looking at the problem from the other side:
If you turn off the node that you know has it and you can still find it on the IPFS network, something still has it somewhere. And there are only a few possibilities for how:
you pinned it on a node somewhere and that node is up
you accessed it somewhere, which caused it to get cached, and it’s still up
you used a common file that someone else is already hosting somewhere
Oh, and as far as Pinata is concerned, they don’t announce to the DHT when you pin something with them, which is why they don’t get listed on a findprovs. The only way to retrieve the content from them is with a direct connection, which can exist due to peering, or due to letting your node search for a really long time (it runs into it by chance). Why they don’t provide makes no sense to me; it pretty much defeats the whole point of pinning.