Skip to content

File Lifecycle

Every file in Tusky moves through a storage pipeline — from fast hot cache to durable decentralized storage on the Walrus network.

When you upload a file, it goes to the hot cache (S3-compatible object storage). It’s immediately available for download at full speed.

A background worker picks up the file and publishes it to the Walrus decentralized storage network. This typically takes seconds to a few minutes. Once confirmed, the status changes to synced.

The file now exists in two places: hot cache (fast) and Walrus (durable). Two identifiers are stored:

  • walrusBlobId — content-addressed hash for retrieval
  • walrusBlobObjectId — Sui object ID for epoch renewals

After the hot retention period expires, the hot eviction worker removes the file from the hot cache. The file is now cold — stored only on Walrus.

When a cold file is needed, Tusky fetches it from Walrus back to the hot cache:

// Trigger rehydration
await tusky.files.rehydrate(file.id);
// Wait for it to be available
const rehydrated = await tusky.files.waitForStatus(file.id, ['hot', 'synced']);

Walrus stores data for a set number of epochs (each ~24 hours). Tusky automatically renews epoch leases before they expire to prevent data loss.

The walrusRenew background worker:

  1. Scans for files approaching epoch expiry
  2. Calls extendBlob() via the Walrus SDK using the walrusBlobObjectId
  3. Pays WAL tokens to extend the storage lease

If Walrus sync fails after retries, the file status is set to error. The file remains in the hot cache and is safe — it just hasn’t been durably stored on Walrus yet.

Monitor errors via webhooks (file.error event) or by listing files filtered by status.

StatusHot cacheWalrusAvailable
uploadingPendingNoNo
hotYesNoYes (fast)
syncedYesYesYes (fast)
coldNoYesAfter rehydration
errorYesFailedYes (fast)