Skip to content

Instantly share code, notes, and snippets.

@meiqimichelle
Last active October 8, 2019 19:34
Show Gist options
  • Save meiqimichelle/879a9b7ba89f441880dac656a43d2c61 to your computer and use it in GitHub Desktop.
Save meiqimichelle/879a9b7ba89f441880dac656a43d2c61 to your computer and use it in GitHub Desktop.

IPFS Pinning Entrypoints

What are the places an end user might encounter "pinning to ipfs" as a thing?

IPFS

Commands (CLI)

  • ipfs add pins after adding by default
  • ipfs pin add

APIs

  • HTTP API: POST /v0/api/pin/add, /v0/api/add
  • API Bindings: Pin/Add methods in Go and JS that trigger HTTP API requests
  • Core API: Pin method can be used to pin when programatically running an IPFS node

IPFS Companion

  • Has "Share files via IPFS" in its browser extension pop-up menu. Clicking on this opens a new window where you can upload a file or directory. Doing so adds that item to IPFS (and pins by default unless a somewhat-hidden checkbox is unchecked).
  • This happens more or less in the background to an end user -- the details of adding, pinning, sharing, etc, do not seem intentional right now..
  • See https://gist.github.com/meiqimichelle/1f766a67b338852bde895b9053f14fc6 for walk-thru of the IPFS Companion user experience when given the directive "explore pinning"

IPFS Desktop utility controller

  • The leetle dude in the top bar on Mac does not seem to explore ideas of pinning/adding directly, though the full WebUI/Desktop are a different story. Since those are converging, I'll cover that experience in the next section.
    • Edit: the IPFS Desktop README says that you can drag-and-drop items onto the leetle dude to add them. This is very not obvious.
  • See https://gist.github.com/meiqimichelle/421e5987b9c2e0925742936a7b61e2b6 for a walk-thru of the IPFS Desktop utility controller experience, including the late-discovered drag-and-drop-to-add.

IPFS WebUI/Desktop

The relationship between pinning and MFS

tl;dr: Even though its name makes it sound very low-level, MFS is actually our highest interaction level when it comes to managing files. It should be thought of "IPFS Drive", and could abstract away the need to know what 'pinning' at a low level is or means.

In the short term, the low hanging fruit is to switch our GUI applications and visual language from using the low-level Pin API to adding user data to MFS, where all files are implicitly pinned, and are also much easier to manage via Web UI.

Full notes from convo with @lidel here: https://gist.github.com/meiqimichelle/1e4601b4418bf4f46007f4777aff395d

Convos underway, from @lidel:

  • We should make Web UI more integrated with Companion, and easier to discover. We started addressing this by adding button to "welcome page" (ipfs/ipfs-companion#769 (comment), not released yet)
  • For Pinning, check improvements proposed in ipfs/ipfs-companion#781 and ipfs/ipfs-companion#742:
  • We plan to move "pinning" from using ipfs pin API to copying content to be "pinned" into MFS. This will keep content from being purged by GC (presence in MFS acts as implicit pin) and let user to manage "pinned" content via "Files" screen in Web UI.
  • The usual theme so far had been that low-level pins are hard to manage (no labels) and in GUI apps could be replaced by adding files to "well-known" location in MFS.
  • (PS somewhat related, there is an experiment in MFS-based website cohosting: https://github.com/ipfs-shipyard/cohosting/ -- just a basic spec, not implemented yet, but inital PR had interesting Scope vs. Use Cases analysis, linked in README)

From @hacdias:

  • There is this idea of adding cluster to desktop so you can form clusters with your friends and have pins named. However, that would just benefit cluster pins ipfs/ipfs-desktop#1159

IPFS Cluster

Commands (CLI)

  • ipfs-cluster-ctl pin add
  • ipfs-cluster-ctl add pins after adding
    • Interesting: this command can take a URL and download remote content while adding it

APIs

  • HTTP
    • Rest API: POST /pins/
    • Proxy API: POST /v0/api/pin/add, /v0/api/add
  • API Bindings: Pin/Add methods in Go and JS that trigger Rest API requests
  • Go API: Pin method can be used to pin when programatically running an IPFS Cluster peer

Cluster WebUI

  • Horizon: unclear if it allows pinning, @hsanjuan doesn't think so

[Pinning services/Apps]

  • Coming soon
    • [Pinata, Infura etc: I think they offer HTTP APIs (web dashboards too?)]
    • [3box has developed a pinning service too, developed for OrbitDB use. I guess it has some API.]
    • [https://github.com/olizilla/ipfs-cohost - uses pin API]
    • Pinning service API proposal by @lanzafame: ipfs/notes#378

Pinbots

  • IRC Pinbot
    • !pin <cid>
  • Twitter Pinbot
    • @ipfspin !pin <cid> <name>
    • @ipfspin !add <url> downloads, adds, and pins
    • Any media attached to tweets mentioning @ipfspin gets added

_Thank you, @hsanjuan, for kicking this off. Thanks also to inputs from @momack2 and @warpfork and

and @hacdias._

@momack2
Copy link

momack2 commented Oct 5, 2019

Nice observations re “add” and mfs! I bet those are under communicated and not necessarily intuitive - so a good opportunity to check if they actually match user needs. Henriques points about website cohosting and libels mention of adding to mfs are both areas that could really use “user journey” flows that focus on end user needs.

@meiqimichelle
Copy link
Author

meiqimichelle commented Oct 8, 2019

Added The relationship between pinning and MFS section with link to full notes.

tl;dr: Even though its name makes it sound very low-level, MFS is actually our highest interaction level when it comes to managing files. It should be thought of "IPFS Drive", and could abstract away the need to know what 'pinning' at a low level is or means.

In the short term, the low hanging fruit is to switch our GUI applications and visual language from using the low-level Pin API to adding user data to MFS, where all files are implicitly pinned, and are also much easier to manage via Web UI.

h/t @lidel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment