Skip to main content

Module persist

Module persist 

Source
Expand description

Persistent channel storage for MPP sessions.

Stores open payment channel state in a SQLite database at $TEMPO_HOME/channels.db (default: ~/.tempo/channels.db). This allows channel reuse across process invocations, avoiding the cost of opening a new on-chain channel for every cast / forge command.

Functionsยง

channel_key_from_persisted ๐Ÿ”’
Reconstruct the composite HashMap key from a persisted Channel.
delete_channel_from_db
Delete a channel from the database by its channel ID.
find_channel
Look up a usable persisted channel by key.
from_channel_entry
Create a Channel from a ChannelEntry with metadata.
global_db ๐Ÿ”’
Process-wide database handle.
is_usable ๐Ÿ”’
Whether a channel can still be used (active and not fully spent).
load_channels
Load channels from database, evicting spent/inactive entries.
save_channels
Save channels to database.
to_channel_entry
Convert a persisted Channel to a ChannelEntry.
upsert_channel_in_memory
Insert or update a channel entry in memory only (no DB write).