Game Asset Pipeline
Store and serve game assets — sprites, maps, audio, and config files — from decentralized storage for your on-chain game.
Why Decentralized Assets?
On-chain games benefit from having assets stored on Walrus: assets are always accessible, immutable once published, and tied to the same trustless infrastructure as your smart contracts.
Uploading Assets by Tag
Use tags to organize assets by type, so you can fetch them in bulk later:
// Upload a sprite sheet
await tuskr.upload({
file: fs.readFileSync("./sprites/hero.png"),
name: "hero.png",
tag: "sprite",
epochs: 365,
})
// Fetch all sprites at runtime
const sprites = await tuskr.list({ tag: "sprite" })
sprites.files.forEach(f => preloadAsset(f.url))Asset Manifest Pattern
Upload a JSON manifest that references all other assets. Your game client fetches the manifest first, then loads only what it needs:
const manifest = {
version: "1.0.0",
assets: {
heroSprite: "https://cdn.tuskr.dev/abc123",
worldMap: "https://cdn.tuskr.dev/def456",
soundtrack: "https://cdn.tuskr.dev/ghi789",
},
}
const result = await tuskr.upload({
file: Buffer.from(JSON.stringify(manifest)),
name: "manifest.json",
tag: "manifest",
epochs: 365,
})