/polkadot-skills:product-sdk-cloud-storagefrom polkadot-skills
Uploads and retrieves data via CloudStorageClient SDK for CID-based decentralized storage. Covers store() upload builder, chunked uploads, container-only reads (fetch/query), CID helpers, and authorization.
Ships in polkadot-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
@parity/product-sdk-cloud-storage is a TypeScript SDK for uploading and retrieving data via Cloud Storage -- a purpose-built parachain for decentralized data storage. Data is content-addressed using CIDv1 (blake2b-256 hash, raw codec). It wraps @parity/bulletin-sdk (chunking, DAG-PB manifests, CID calculation, progress events) and routes reads through the host's preimage subscription.
store(...) submits a TransactionStorage.store extrinsic, so create(...) requires a signer. In-container vs standalone only changes where the signer comes from (the account of the host vs a CommonSignerTxCreator you supply). There is no signer-less host upload path.fetchBytes/fetchJson/queryBytes resolve content through the host's preimage subscription and require a host container. Outside a container they return err(CloudStorageHostUnavailableError) -- the SDK does not fall back to a public IPFS gateway. A product that needs a standalone read path must branch on isInsideContainer() and perform its own gateway fetch.Result, not thrown errors: queryBytes/queryJson/executeQuery/checkAuthorization/verifyStored and their CloudStorageClient method equivalents (fetchBytes/fetchJson/checkAuthorization/verifyStored), plus the free authorizeAccount, return Result<T, E> = { ok: true; value: T } | { ok: false; error: E }. Check res.ok and read res.value (or res.error) -- they do not throw. (Upstream .send() builder results and the sync CID helpers are unchanged.)create({ environment }) accepts "paseo" (Paseo Next v2) and "devnet" (public Paseo testnet) -- the CloudStorageEnvironment presets, keys of CloudStorageNetworks; both currently available. "polkadot"/"kusama" are not yet available (compile error, and getChainAPI throws).import { CloudStorageClient, createLazySigner } from "@parity/product-sdk-cloud-storage";
// Create a client for the Paseo test network. A signer is REQUIRED -- every
// store() submits a transaction. createLazySigner defers signer resolution so
// you can build the client before an account is selected.
const cloudStorage = await CloudStorageClient.create({
environment: "paseo",
// getCurrentSigner returns the active `CommonSignerTxCreator | null`
// (e.g. wrap your signer manager / host account here).
signer: createLazySigner(() => getCurrentSigner()),
});
// Upload data (MUST be Uint8Array, not a string) via the store() builder
const data = new TextEncoder().encode(JSON.stringify({ title: "Hello Cloud Storage" }));
const result = await cloudStorage.store(data).send();
console.log("CID:", result.cid?.toString()); // result.cid is a CID object (undefined for chunked-without-manifest)
console.log("block:", result.blockNumber, "size:", result.size);
// Fetch it back as JSON (requires a host container -- returns err(CloudStorageHostUnavailableError) standalone).
// fetchJson returns a Result, so check .ok before reading .value.
const content = await cloudStorage.fetchJson<{ title: string }>(result.cid!.toString());
if (!content.ok) throw content.error;
console.log(content.value.title); // "Hello Cloud Storage"
WARNING:
store()expectsUint8Array, not strings. Always convert withnew TextEncoder().encode(...).
The CloudStorageClient wraps the upstream @parity/bulletin-sdk client and adds network presets, container-routed read helpers, and a pre-flight authorization check.
import { CloudStorageClient, CloudStorageNetworks, createLazySigner } from "@parity/product-sdk-cloud-storage";
// Environment shorthand (signer required)
const client = await CloudStorageClient.create({ environment: "paseo", signer });
// Explicit network / BYOD -- spread a preset (or supply your own genesisHash + descriptor)
const custom = await CloudStorageClient.create({
...CloudStorageNetworks.paseo,
signer,
config: { defaultChunkSize: 1 << 20 },
});
// From a pre-built AsyncBulletinClient + typed API (you own the connection lifecycle)
const fromInner = CloudStorageClient.from(inner, api);
| Method | When to use |
|---|---|
create({ environment, signer }) | Quick start against a preset network |
create({ ...descriptor, signer }) | Custom / BYOD network (explicit genesisHash + descriptor) |
from(inner, api) | You already own the AsyncBulletinClient and its connection lifecycle |
Uploads use the fluent store(data) builder (re-exported from @parity/bulletin-sdk):
const data = new TextEncoder().encode("raw file content");
// Simple signed upload
const result = await client.store(data).send();
// result.cid (CID | undefined), result.size, result.blockNumber, result.extrinsicIndex
// Chained options
const result2 = await client
.store(data)
.withWaitFor("finalized") // "in_block" | "finalized"
.send();
// Pre-authorized content can be stored fee-free by anyone via an unsigned tx
await client.authorizePreimage(contentHash, BigInt(data.length));
const result3 = await client.store(data).sendUnsigned();
There is no batchUpload. For large files, force the chunked path with withChunkSize -- a DAG-PB manifest (default) ties the chunks together and result.cid is the manifest CID:
const result = await client
.store(largeFile)
.withChunkSize(1 << 20) // 1 MiB chunks
.withCallback((evt) => console.log(evt)) // progress events
.send();
fetchBytes/fetchJson are instance methods and container-only (host preimage lookup; return err(CloudStorageHostUnavailableError) standalone). Both return a Result -- check .ok before reading .value:
// Raw bytes -- fetchBytes returns Result<Uint8Array, ProductCloudStorageError>
const res = await client.fetchBytes(cid);
if (!res.ok) return handle(res.error);
const bytes = res.value;
// Parsed JSON -- fetchJson returns Result<T, ProductCloudStorageError>
const meta = await client.fetchJson<{ name: string }>(cid);
if (!meta.ok) return handle(meta.error);
const metadata = meta.value;
import { calculateCid } from "@parity/product-sdk-cloud-storage";
// Compute a CID without uploading (standalone helper -- async, returns a CID object)
const cid = await calculateCid(data);
// Confirm a CID landed on-chain at a known block (pass the block from a store() receipt).
// verifyStored returns Result<ChainStoredEntry | null, ProductCloudStorageError>; ok(null) = not recorded at that block.
const verified = await client.verifyStored(result.cid!.toString(), { block: result.blockNumber! });
if (!verified.ok) throw verified.error;
const entry = verified.value; // ChainStoredEntry | null
// Pre-flight authorization check -- returns Result<AuthorizationStatus, CloudStorageAuthorizationError>
const authResult = await client.checkAuthorization(address);
if (!authResult.ok) throw authResult.error;
const auth = authResult.value;
// Estimate the authorization (transactions + bytes) a payload needs
const need = client.estimateAuthorization(data.length);
For advanced use cases:
import {
cidToPreimageKey,
hashToCid,
calculateCid, // async; returns a CID object
queryBytes, // container-only read (host preimage); returns Result, err(CloudStorageHostUnavailableError) standalone
queryJson, // container-only read (host preimage); returns Result, err(CloudStorageHostUnavailableError) standalone
executeQuery, // container-only read; returns Result<Uint8Array, ProductCloudStorageError>
resolveQueryStrategy,
} from "@parity/product-sdk-cloud-storage";
upload,batchUpload,cidExists,gatewayUrl,getGateway, and staticcomputeCid/hashToCidno longer exist. Uploads go through thestore(...)builder; CID computation is the standalone asynccalculateCid;fetchBytes/fetchJsonareCloudStorageClientinstance methods (container-only, no gateway argument).
store() instead of Uint8Array - convert with new TextEncoder().encode(...).create() requires a signer - every store() submits a transaction; use createLazySigner if no account is selected yet.result.cid as a string - it's a CID object (or undefined for chunked-without-manifest); call .toString().fetchBytes/fetchJson/queryBytes are container-only and return err(CloudStorageHostUnavailableError) outside a host.fetchBytes/fetchJson/queryBytes/queryJson/checkAuthorization/verifyStored (and authorizeAccount) return Result<T, E>. Check res.ok and read res.value -- they do not throw.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 plugins in 2 repositories ship this exact skill · first indexed Oct 14, 2026
11 skills in this plugin
/migrating-to-product-sdkUse when migrating a product codebase to @parity/product-sdk — detects legacy stacks (polkadot-apps, novasamatech, hand-rolled crypto/IPFS, polkadot-api 1.x) in the target repo, decides which migration areas apply, writes a per-repo migration spec, then hands off to writing-plans.
/product-sdk-app-builderEnd-to-end scaffolding and implementation of Polkadot applications using @parity/product-sdk packages. Use when: creating a new Polkadot project, building a dApp, scaffolding chain interactions, choosing which @parity/product-sdk packages to install, or when a user says "build me a Polkadot app". Handles both developer-guided and fully autonomous (non-developer) workflows.
/Generated from the plugin's indexed repository (polkadot-community-foundation/polkadot-skills) — no native marketplace selected
npx claudepluginhub p/polkadot-community-foundation-polkadot-skillsOther plugins' skills for the same job