Expand description
The library code containing the graph data structure for transport and incentivization layer (through the “channel graph”).
NetworkGraph is the main data structure representing the network of nodes and channels. It combines 2 layers:
- The channel graph layer, which represents the network topology with nodes and channels as loaded from the chain.
- The network layer, which represents the nodes based on their physical connectability and QoS attributes.
What does the graph look like:
- Nodes are represented as vertices in the graph.
- Possible connections, a combination of channel availability and or network usability are represented as edges between nodes.
§Weights
The weights accumulate different properties of the edges to represent the cost of using that edge for routing or whether the edge can be used at all. Weights are represented as a struct containing different fields, each representing a different property of the edge. The used properties are:
- presence of incentivization channel with remaining balance (
Option<Balance>) - presence of peer for immediate direct network connection and its quality (
Option<ImmediateQoS>) - presence of intermediate connection through other nodes (
Option<IntermediateQoS>)
Re-exports§
pub use weight::Observations;pub use petgraph::*;
Modules§
Structs§
Constants§
- DEFAULT_
EDGE_ PENALTY - Default penalty multiplier for edges lacking probe-based quality observations.
- DEFAULT_
MIN_ ACK_ RATE - Default minimum acceptable message acknowledgment rate for path selection.
Type Aliases§
- Shared
Channel Graph - A thread-safe, shareable handle to a
ChannelGraph.