Storage Operations
resource: storage — 2 composite operations combining Kubo and Cluster calls
Why composites exist: "upload a file and make sure it's durably pinned" or "confirm
this content is still intact" are common workflow needs that would otherwise take two or three chained
nodes (
content/add + pin/add or cluster/add, or
content/cat + a manual hash check). The storage resource packages each pattern
as a single node call.
uploadAndPin
Binary input. Adds content, then pins it — via the Cluster (replicated) when a Cluster connection is configured, otherwise via Kubo's own local pinset.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
inputDataKey | text | No | data | Key in the upstream node's InputData holding the bytes to store. |
dataMode | select | No | base64 | base64 | text. |
inlineContent | text | No | — | Inline content fallback. |
fileName | text | No | file | File name recorded on the multipart part. |
baseUrl | text | Conditional | — | Required only when not using a Cluster connection (the Kubo-only path). |
clusterBaseUrl | text | No | — | When set, content is added and pinned through the Cluster instead of Kubo directly. |
clusterAuthMode / destinationCredentialID | — | Conditional | — | Required together when pinning via the Cluster with Basic auth. |
Response: { cid, name, size, usedCluster, pinStatus }.
Step-by-step:
- Resolve the upstream binary content (same
inputDataKey/inlineContentpattern ascontent/add). - If
clusterBaseUrlis set: call the Cluster's add-and-replicate-pin endpoint (equivalent tocluster/add). - Otherwise: call Kubo's
content/addwithpin: truedirectly. - Return a unified record regardless of which path was taken.
verifyIntegrity
Kubo-only (no Cluster connection needed). Re-fetches content at a CID and asks Kubo to recompute its CID, then compares the two — a tamper/corruption check without reimplementing hashing client-side.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cid | text | ✓ Yes | — | The expected CID — also the path fetched to verify. |
chunker | text | No | — | Chunker to use when recomputing — should match the original add for a meaningful comparison. |
cidVersion | int | No | inferred | CID version to recompute with. When unset, inferred from the expected CID's own encoding (0 for a Qm…-prefixed v0 CID, otherwise 1) so the comparison is apples-to-apples. |
Missing cid → CFG_MISSING_CID. Response: { matches, expectedCid,
computedCid, size }.
Step-by-step:
- Fetch the content at
cidvia Kubo's cat endpoint. - Re-add the fetched bytes with Kubo's
only-hashflag (recompute the CID, no datastore write). - Compare the recomputed CID against the expected
cidstring-for-string. matches: falseis a legitimate result, not an execution error — it still routes to the success output port.
The CIDv1 inference fix: an earlier version of this operation always recomputed using
CIDv0, which produced a false mismatch for any content that was originally added as CIDv1. The fix
infers the version from the expected CID's own prefix by default — pass
cidVersion
explicitly only if you need to override that inference.