Package com.privatechain.storage.leveldb
package com.privatechain.storage.leveldb
LevelDB persistent storage backend — crash-safe block persistence via the
leveldbjni native library (FR-STOR-03, NFR-REL-01).
LevelDBStorage maps block index
n to a big-endian 4-byte key and stores the full block as a JSON value
produced by BlockSerializer. On load, each
block's hash is recomputed and compared against the stored hash; a mismatch
causes an immediate BlockValidationException
(NFR-SEC-03).
LevelDB's write-ahead log guarantees that an abrupt JVM kill cannot corrupt the stored chain (NFR-REL-01).
- Since:
- 1.0.0
-
Classes