Storage Canister
The storage canister is responsible for K-V storage and retrieval of blobs.
Canister Types
/// Storage Canister
// Canister Get Blob Types
struct Blob {
data: Vec<u8>, // blob data
next: Option<usize>, // next slice index: u64
}
/// Save Blob Argument
/// To manage subnet storage pressure, blobs are uploaded serially in slices.
struct BlobChunk {
index: usize, // Segmented upload index
digest: [u8; 32], // Sha256 digest of the blob in hex format
timestamp: u128, // Time since epoch in nanoseconds
total: usize, // Total blob size in bytes
data: Vec<u8>, // Blob slice (a piece of the Blob)
}
// Storage Canister Configuration
struct Config {
signature_canister: Principal, // Principal authorized to upload blobs
owner: Principal, // Principal managing confirmations and signatures
query_response_size: usize, // Adjusted for efficient blob retrieval
canister_storage_threshold: u32, // Maximum blobs stored (7-day period recommended)
}
enum Result {
Ok(),
Err(String),
}Canister Services
Candid Interfaces
Last updated