Decentralized Storage

IPFS and distributed file storage

Decentralized Storage

Store and retrieve files using IPFS and our distributed storage network.

Uploading Files

// Upload a file
const result = await aethex.storage.upload({
  file: fileBuffer,
  name: 'game-asset.png',
  type: 'image/png'
});

console.log('IPFS CID:', result.cid);
console.log('URL:', result.url);

Retrieving Files

// Get file by CID
const file = await aethex.storage.get('QmXyz...');

// Get file URL for CDN access
const url = aethex.storage.getUrl('QmXyz...');

Pinning

// Pin content to ensure persistence
await aethex.storage.pin('QmXyz...');

// Unpin content
await aethex.storage.unpin('QmXyz...');

// List pinned content
const pins = await aethex.storage.listPins();