When adding a pin, we should be able to add a label to it.
ipfs-desktop already does this, but stores the metadata itself. One approach would be to simply store a string tag in the pinset. Another slightly more interesting approach would be to move all pinning to be simply references within mfs, or alternatively mirror all labeled pins in mfs.
We should just use mfs (modify MFS to do everything we need out of pins and then make the pin API use it).
Hrm... ipfs-desktop could just start doing this now. cc @hacdias
Hello! Like store a file on MFS with the references? 馃槃 That's a great idea!
There are some things I have to improve on Desktop. The files pane isn't using MFS and it should too! I'll add this as an issue there.
Like store a file on MFS with the references?
Specifically, add the files to MFS, not just create a file listing the CIDs (note, you'll still need to force IPFS to actually download the file as MFS won't do that). E.g., a directory /.applications/ipfs-desktop/pins/<pinned-files>.
Thanks for the points @Stebalien! It will be useful!
@Stebalien I've got a question in the meanwhile: what's the advantage to save the files on MFS if we pin them through ipfs.pin.add()?
P.S.: Desktop isn't showing previous pins you've made, but it should though.
I've got a question in the meanwhile: what's the advantage to save the files on MFS if we pin them through ipfs.pin.add()
It gives the file a name.
I'd add them to MFS instead of pinning because MFS will give the file a name. Unfortunately, while MFS will prevent downloaded blocks from being garbage collected, it won't trigger a proactive fetch. You'll have to do that by, e.g., calling ipfs refs QmId (to force your node to download the file) or by temporarily pinning and then removing the pin (we should probably add some form of --prefetch flag to MFS).
I'd eventually like to deprecate the pin interface and only use MFS (or, more likely, reimplement the pin interface to use MFS under the covers) because it can be used in a multi-application setting.
I understand your points, but that way, users would start complaining that pins they made through the command line or any other way that uses the pinning service, wouldn't show up in Desktop unless I checked the pins and moved them to MFS.
What I suggest, for now, is to pin them and save the correspondent tags to MFS. And when the pin interface gets deprecated (or changed to use MFS), I'd change it on Desktop.
Most helpful comment
I understand your points, but that way, users would start complaining that pins they made through the command line or any other way that uses the pinning service, wouldn't show up in Desktop unless I checked the pins and moved them to MFS.
What I suggest, for now, is to pin them and save the correspondent tags to MFS. And when the pin interface gets deprecated (or changed to use MFS), I'd change it on Desktop.