hotmint-storage
Persistent storage backends for the Hotmint BFT consensus framework.
Implements the BlockStore trait from hotmint-consensus using vsdb (a RocksDB-based versioned storage engine), and provides PersistentConsensusState for crash recovery of critical consensus state.
Components
| Component | Description |
|---|---|
VsdbBlockStore |
Persistent block storage backed by vsdb MapxOrd (RocksDB) |
PersistentConsensusState |
Persists view number, locked QC, highest QC, committed height |
Prerequisites
Requires RocksDB development libraries:
# macOS
# Ubuntu
If installed in a non-standard location:
Usage
Block Store
use BlockStore;
use VsdbBlockStore;
let store = new;
// genesis block is inserted automatically
// use as a drop-in replacement for MemoryBlockStore
let engine = new;
Crash Recovery
use ConsensusState;
use PersistentConsensusState;
let pstate = new;
// restore after restart
let mut state = new;
if let Some = pstate.load_current_view
if let Some = pstate.load_locked_qc
if let Some = pstate.load_highest_qc
if let Some = pstate.load_last_committed_height
Data Directory
vsdb stores data in the process working directory by default. Set VSDB_BASE_DIR to control the location:
License
GPL-3.0-only