Bug Description
What
Adds minichain/persistence.py — a minimal module that can write the full blockchain and account state to disk and restore it across sessions.
data/
blockchain.json ← serialized list of blocks
state.json ← accounts dict (balances, nonces, contract storage)
Why
Previously the entire chain lived in memory and was lost on every restart. This made multi-session research, demos, and testnet usage impossible.
API
from minichain.persistence import save, load
Save
save(blockchain, path="data/")
Restore
blockchain = load(path="data/")
load() returns a fully working Blockchain instance — new blocks can be mined and added immediately after loading.
Steps to Reproduce
No response
Logs and Screenshots
No response
Environment Details
No response
Impact
Critical - Application is unusable
Code of Conduct
Bug Description
What
Adds
minichain/persistence.py— a minimal module that can write the full blockchain and account state to disk and restore it across sessions.Why
Previously the entire chain lived in memory and was lost on every restart. This made multi-session research, demos, and testnet usage impossible.
API
load()returns a fully workingBlockchaininstance — new blocks can be mined and added immediately after loading.Steps to Reproduce
No response
Logs and Screenshots
No response
Environment Details
No response
Impact
Critical - Application is unusable
Code of Conduct