Package com.privatechain.storage
package com.privatechain.storage
BlockchainStorage implementations and chain
export utilities for the private-blockchain library.
Four persistence backends are provided:
com.privatechain.storage.memory— ephemeral HashMap-backed storage for tests and demos (FR-STOR-02).com.privatechain.storage.leveldb— crash-safe persistent storage via LevelDB JNI (FR-STOR-03).com.privatechain.storage.rocksdb— high-throughput persistent storage via RocksDB JNI (FR-STOR-04).com.privatechain.storage.fs— one JSON file per block; requires no native libraries (FR-STOR-05).
All implementations share a single BlockSerializer
instance that holds a pre-configured Jackson ObjectMapper with
JavaTimeModule, disabled
FAIL_ON_UNKNOWN_PROPERTIES, and field-level visibility. Every block is
hash-verified on load (NFR-SEC-03).
ChainExporter provides three static utility
methods for chain export and import (FR-SER-02, FR-SER-03):
toJson(), fromJson(), and toCsv().
- Since:
- 1.0.0
-
ClassesClassDescriptionShared Jackson-based JSON serializer / deserializer for
Blockobjects.Utility class for exporting and importing a full blockchain in JSON and CSV formats.