Module sim_node

Module sim_node 

Source

Structs§

ChannelPolicy
Represents one node in the channel’s forwarding policy and restrictions. Note that this doesn’t directly map to a single concept in the protocol, a few things have been combined for the sake of simplicity. Used to manage the lightning “state machine” and check that HTLCs are added in accordance of the advertised policy.
SimGraph
Graph is the top level struct that is used to coordinate simulation of lightning nodes.
SimulatedChannel
Represents a simulated channel, and is responsible for managing addition and removal of HTLCs from the channel and sanity checks. Channel state is tracked unidirectionally for each participant in the channel.
WrappedLog
WrappedLog implements LDK’s logging trait so that we can provide pathfinding with a logger that uses our existing logger.

Enums§

ForwardingError
ForwardingError represents the various errors that we can run into when forwarding payments in a simulated network. Since we’re not using real lightning nodes, these errors are not obfuscated and can be propagated to the sending node and used for analysis.

Functions§

ln_node_from_graph
Produces a map of node public key to lightning node implementation to be used for simulations.
populate_network_graph
Populates a network graph based on the set of simulated channels provided. This function only applies channel announcements, which has the effect of adding the nodes in each channel to the graph, because LDK does not export all of the fields required to apply node announcements. This means that we will not have node-level information (such as features) available in the routing graph.