Portal Community

1. Upload a Generated Report and Pin It Durably

A workflow generates a PDF/CSV report and needs it durably available via IPFS.

  1. Upstream node produces the file bytes in its output.
  2. IPFS node: resource=storage, operation=uploadAndPin, inputDataKey={{upstreamOutputKey}}, fileName=report.pdf, plus clusterBaseUrl if you have a Cluster for replication.
  3. Store the returned cid for later retrieval or for embedding in a notification/email.
Why storage/uploadAndPin instead of content/add: one node call handles both "store it" and "make sure it's pinned (not garbage-collected)" — and transparently uses Cluster replication when configured, without the workflow needing two branches.

2. Build a Directory Tree in MFS, Then Publish It Under a Stable Name

Assemble several files into a directory structure and expose it under one IPNS name that survives future updates.

  1. IPFS node: resource=files, operation=write, mfsPath=/site/index.html, inputDataKey=htmlBytes (repeat per file — parents/create/truncate all default to true).
  2. IPFS node: resource=files, operation=stat, mfsPath=/site → read the resulting cid.
  3. IPFS node: resource=name, operation=publish, targetPath=/ipfs/{{cid}}, keyName=self (or a dedicated key from key/generate).
  4. Downstream consumers fetch /ipns/<peerID> — always the latest version, no link updates required.

3. Guard a Pin-Removal Step With a Verification Check

Before unpinning content, confirm nothing else depends on it being intact first.

  1. IPFS node: resource=pin, operation=verify, verbose=false → check verified and inspect badPins.
  2. Condition node: only proceed if the target cid is not present in badPins.
  3. IPFS node: resource=pin, operation=remove, cid={{targetCid}}.

4. Reclaim Disk Space With a Confirmed Garbage Collection

  1. IPFS node: resource=repo, operation=stat, sizeOnly=true → read repoSizeBytes to decide whether GC is worthwhile.
  2. Condition node: only continue if size exceeds a threshold.
  3. IPFS node: resource=repo, operation=garbageCollect, confirmDestructive=true.
Pin anything you want to keep first. Garbage collection deletes every block that isn't pinned — run pin/add on anything important before this step.

5. Verify Downloaded Content Hasn't Been Corrupted or Tampered With

  1. IPFS node: resource=storage, operation=verifyIntegrity, cid={{expectedCid}}.
  2. Condition node: matches == true.
  3. If false, route to an alert branch instead of trusting the content downstream.

6. Register and Use a Remote Pinning Service

Offload durability to a third-party pinning provider instead of running your own Cluster.

  1. IPFS node: resource=pin, operation=remoteServiceAdd, remoteServiceName=myProvider, remoteServiceEndpoint={{providerUrl}}, remoteServiceApiKey={{secret}} (one-time setup).
  2. IPFS node: resource=pin, operation=remoteAdd, cid={{cid}}, remoteServiceName=myProvider, background=true for a fire-and-forget pin request.
  3. Later, IPFS node: resource=pin, operation=remoteList, remoteServiceName=myProvider, statusFilter=pinned to confirm it landed.