generated from StabilityNexus/Template-Repo
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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, loadSave
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
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working