Ledger Management¶
The Kakitu ledger is a local copy of the entire Block Lattice — every account chain, every block, every vote record. Managing it correctly ensures node reliability and efficient operation.
Ledger File¶
The ledger is stored as a single LMDB database file:
Located in your data directory (the volume mounted into the Docker container, or the platform-default data path for native installs).
Ledger Size¶
The ledger grows continuously as new blocks are added. Current approximate sizes:
| Network | Size (approx.) |
|---|---|
| Main | ~8 GB (varies with adoption) |
| Test | ~100 MB |
Plan for continued growth. Use NVMe or SSD storage with at least 2× headroom.
Bootstrapping (Initial Sync)¶
A new node must download the full ledger from peers. This process is called bootstrapping.
Monitor progress:
Compare your cemented count against network telemetry:
Bootstrapping on a fast connection typically completes within a few hours.
Using a Ledger Snapshot¶
To avoid bootstrapping from scratch, you can download a ledger snapshot:
- Download the latest snapshot from snapshots.kakitu.org (if available)
- Stop the node
- Replace
data.ldbin your data directory with the snapshot file - Start the node — it will resume from the snapshot block count
Verify snapshot integrity
Always verify the SHA256 checksum of a downloaded snapshot before using it. Only use snapshots from trusted sources.
Backup¶
# Stop the node first for a clean copy
docker stop kakitu-node
# Copy the ledger file
cp ~/kakitu-ledger/data.ldb ~/kakitu-ledger-backup/data.ldb.$(date +%Y%m%d)
# Restart the node
docker start kakitu-node
For live backups without stopping the node, use LMDB's mdb_copy tool:
Pruning Unchecked Blocks¶
The node stores unchecked (unconfirmed) blocks in a temporary table. These are cleaned automatically but can accumulate during periods of network instability.
Check unchecked count:
If unchecked is very large (>100,000), the node may be catching up from a network partition. Monitor and allow it to resolve naturally.
Database Corruption Recovery¶
If the ledger becomes corrupted (node fails to start, reports database errors):
- Stop the node
- Delete
data.ldbanddata.ldb-lock - Restart — the node will re-bootstrap from scratch
Or restore from a backup or snapshot.
Vacuum / Compaction¶
LMDB does not require manual compaction, but after deleting large amounts of data the free space within the file may not be returned to the OS. To reclaim space:
# Stop node first
docker stop kakitu-node
# Copy to a new compact file (mdb_copy with --compact)
mdb_copy --compact ~/kakitu-ledger ~/kakitu-ledger-compact
# Replace
mv ~/kakitu-ledger/data.ldb ~/kakitu-ledger/data.ldb.old
mv ~/kakitu-ledger-compact/data.ldb ~/kakitu-ledger/data.ldb
docker start kakitu-node