Skip to main content

Module keyless

Module keyless 

Source
Expand description

The Keyless qmdb allows for append-only storage of data that can later be retrieved by its location. Both fixed-size and variable-size values are supported via the fixed and variable submodules.

§Examples

// Simple mode: apply a batch, then durably commit it.
let batch = db.new_batch().append(value);
let merkleized = batch.merkleize(&db, None, db.inactivity_floor_loc()).await;
let (db, _) = db.apply_batch(merkleized).await?;
let db = db.commit().await?;
// Batches can still fork before you apply them.
let floor = db.inactivity_floor_loc();
let parent = db.new_batch().append(value_a);
let parent = parent.merkleize(&db, None, floor).await;

let child_a = parent.new_batch();
let child_a = child_a.append(value_b);
let child_a = child_a.merkleize(&db, None, floor).await;

let child_b = parent.new_batch();
let child_b = child_b.append(value_c);
let child_b = child_b.merkleize(&db, None, floor).await;

let (db, _) = db.apply_batch(child_a).await?;
let db = db.commit().await?;
// Sequential commit: apply parent then child.
let floor = db.inactivity_floor_loc();
let parent = db.new_batch().append(value_a);
let parent_m = parent.merkleize(&db, None, floor).await;
let child = parent_m.new_batch().append(value_b);
let child_m = child.merkleize(&db, None, floor).await;

let (db, _) = db.apply_batch(parent_m).await?;
let (db, _) = db.apply_batch(child_m).await?;
let db = db.commit().await?;

Modules§

batch
Batch mutation API for Keyless QMDBs.
fixed
A keyless authenticated database for fixed-size data.
variable
A keyless authenticated database for variable-length data.

Structs§

CompactConfig
Configuration for a compact authenticated db.
CompactDb
A keyless authenticated db that discards historical operations, retaining only a witness for each applied batch.
CompactMerkleizedBatch
A speculative batch whose root digest has been computed.
CompactUnmerkleizedBatch
A speculative batch for a compact keyless db.
Config
Configuration for a Keyless authenticated db.
Keyless
A keyless authenticated database.

Enums§

Operation
Operations for keyless stores.

Functions§

initial_root
Compute the authenticated root of a newly initialized database without opening storage.