Module util
Expand description
Some utility modules live here. See individual sub-modules for more info.
Modules§
- config
- Various user-configurable channel limits and settings which ChannelManager applies for you.
- errors
- Error types live here.
- hash_
tables - Generally LDK uses
std’sHashMaps, however when building for no-std, LDK useshashbrown’sHashMaps with thestdSipHasherand usesgetrandomto opportunistically randomize it, if randomization is available. - indexed_
map - This module has a map which can be iterated in a deterministic order. See the
IndexedMap. - invoice
- Low level invoice utilities.
- logger
- Log traits live here, which are called throughout the library to provide useful information for debugging purposes.
- message_
signing - Lightning message signing and verification lives here. These tools can be used to sign messages using the node’s secret so receivers are sure that they come from you. You can also use this to verify that a given message comes from a specific node. Furthermore, these tools can be used to sign / verify messages using ephemeral keys not tied to node’s identities.
- persist
- This module contains a simple key-value store trait
KVStorethat allows one to implement the persistence forChannelManager,NetworkGraph, andChannelMonitorall in one place. - scid_
utils - Utilities for creating and parsing short channel ids.
- ser
- A very simple serialization framework which is used to serialize/deserialize messages as well
as
ChannelManagers andChannelMonitors. - ser_
macros - Some macros that implement
Readable/Writeabletraits for lightning messages. They also handle serialization and deserialization of TLVs. - string
- Utilities for strings.
- sweep
- This module contains an
OutputSweeperutility that keeps track ofSpendableOutputDescriptors, i.e., persists them in a givenKVStoreand regularly retries sweeping them. - test_
channel_ signer - impls of traits that add exra enforcement on the way they’re called. Useful for detecting state machine errors and used in fuzz targets and tests.
- test_
utils - wakers
- Utilities which allow users to block on some future notification from LDK. These are
specifically used by
ChannelManagerto allow waiting until theChannelManagerneeds to be re-persisted.