FileLedgerStore class
Keeps a node's ledger on disk, one file per blueprint, under
<data-dir>/blueprints/<id>.json.
This is what makes cleanup survive a restart. The in-memory default forgets what the node owned, so the first plan after a reboot sees every resource as something that was already there and will not remove anything — safe, but it means a blueprint can never really be unassigned.
Writes are chained the way the Hub's JSON repositories chain theirs: an apply writes the ledger once at the end, but a node can be asked to apply two blueprints at once, and two interleaved open/write/close sequences on the same file produce a truncated one.
- Implemented types
Constructors
- FileLedgerStore(String path)
-
Creates a store rooted at
path(the node's data directory).
Properties
Methods
-
clear(
String blueprint) → Future< void> -
Forgets
blueprintentirely.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String blueprint) → Future< Ledger?> -
The ledger for
blueprint, ornullif it has never been applied here.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
Ledger ledger) → Future< void> -
Records
ledger.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited