Portal Community

Shared Input Pattern

Every operation takes resource and operation as the top-level config keys that select the DTO, plus the Kubo connection fields (and, for some, the Cluster connection fields) — see Configuration. Everything else is specific to the chosen resource + operation pair.

Shared Output Shape

Every operation writes an outputData object with:

FieldPresent OnDescription
statusAll"success" on the success path.
resourceAllEchoes the operation's resource.
operationAllEchoes the operation's operation.
countList-shaped operations onlyNumber of items in the list (e.g. pin/list, swarm/peers, bootstrap/list).
itemsAllAn array wrapping the result record(s) — a single-object result uses WrapSingleObjectIntoItems, a list result uses WrapListIntoItems.

Binary I/O

Operations that move raw bytes follow one of two symmetric patterns:

DirectionOperationsMechanism
Input (upload)content/add, dag/put, dag/import, block/put, files/write, key/import, cluster/add, storage/uploadAndPinBytes resolved from the upstream node's InputData[inputDataKey] (already-byte[] passes through as-is; a string is decoded per dataMode), falling back to inlineContent when the input key is empty.
Output (download)content/cat, content/get, block/get, files/read, dag/exportThe raw byte[] is placed directly under data in the items record for downstream nodes to consume.

Binary-Input Error Codes

CodeMeaning
MISSING_CONTENT / MISSING_FILE_DATANothing found under InputData[inputDataKey] and no inlineContent fallback provided.
INVALID_CONTENT_ENCODING / INVALID_FILE_DATA_ENCODINGThe resolved string content could not be decoded per dataMode (e.g. malformed base64).

How Errors Surface

SituationWhat happens
Missing required config fieldA CFG_MISSING_* (or CFG_CONFIRM_*) validation error, routed to the error output port before any network call.
Missing/malformed binary contentMISSING_CONTENT/INVALID_CONTENT_ENCODING (see above), also before any network call.
Kubo/Cluster returns a non-2xx responseSurfaces as "<resource>/<operation> failed: <message> (<code>)" on the error port.
Kubo returns 200 with an embedded per-item error (e.g. block/remove)Surfaces as an ok: false/similar field in a successful response — see the operation's own page.
Transient network failure or 408/429/5xxRetried automatically (up to 3 attempts, exponential backoff) before surfacing as an error — see Connecting.
Idempotent-by-design retries: because retried operations are either idempotent (pin/unpin/stat/list) or content-addressed (identical bytes always yield the identical CID), a transparent retry never produces a divergent result — you don't need to build your own dedup logic around network blips.