Guides
Versions
Upload a new version of a file. It gets its own CID, links to the old one, and only pays for the blocks that changed.
How it works
- In the Drive, choose New version in a file's details or its right-click menu, then pick the updated file.
- FastCDC keeps chunk boundaries stable across edits, so most blocks of the new version hash the same as the old one. Portaldot already holds them, so the upload skips them. See the measurements.
- The registry records
parentin theRegisteredevent. Versions form a chain you can rebuild from logs, at no storage deposit. - The Drive shows only the latest version in lists, and every version under Versions in the details panel. Each one is still a separate, shareable CID.
From code
new version
const v2 = await prepareFile(bytes, { name: "deck.pdf", parent: v1Root });
await uploadFile({ api, file: v2, owner, registry: REGISTRY });
const history = await readVersions(REGISTRY, contentHash(v2.root)); // newest first