package
0.18.4-beta.rc2
Repository: https://github.com/lightningnetwork/lnd.git
Documentation: pkg.go.dev

# README

routing

Build Status MIT licensed GoDoc

The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.

Installation and Updating

$  go get -u github.com/lightningnetwork/lnd/routing

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

DefaultAprioriConfig returns the default configuration for the estimator.
DefaultBimodalConfig returns the default configuration for the estimator.
DisableLog disables all library log output.
FetchAmountPairCapacity determines the maximal public capacity between two nodes depending on the amount we try to send.
IsBlindedRouteNUMSTargetKey returns true if the given public key is the NUMS key used as a target for blinded path final hops.
New creates a new instance of the ChannelRouter with the specified configuration parameters.
NewAprioriEstimator creates a new AprioriEstimator.
NewBimodalEstimator creates a new BimodalEstimator.
NewBlindedEdge constructs a new BlindedEdge which packages the policy info for a specific hop within the given blinded payment path.
NewBlindedPaymentPathSet constructs a new BlindedPaymentPathSet from a set of BlindedPayments.
NewControlTower creates a new instance of the controlTower.
NewDirectedNodePair instantiates a new DirectedNodePair struct.
NewMissionControl returns a new instance of missionControl.
NewRouteRequest produces a new route request for a regular payment or one to a blinded route, validating that the target, routeHints and finalExpiry parameters are mutually exclusive with the blindedPayment parameter (which contains these values for blinded payments).
RouteHintsToEdges converts a list of invoice route hints to an edge map that can be passed into pathfinding.
UseLogger uses a specified Logger to output package logging info.
ValidateCLTVLimit is a helper function that validates that the cltv limit is greater than the final cltv delta parameter, optionally including the BlockPadding in this calculation.

# Constants

AprioriEstimatorName is used to identify the apriori probability estimator.
BimodalEstimatorName is used to identify the bimodal estimator.
BimodalScaleMsatMax is the maximum value for BimodalScaleMsat.
BlindedPathNUMSHex is the hex encoded version of the blinded path target NUMs key (in compressed format) which has no known private key.
BlockPadding is used to increment the finalCltvDelta value for the last hop to prevent an HTLC being failed if some blocks are mined while it's in-flight.
DefaultAprioriWeight is the default a priori weight.
DefaultBimodalDecayTime is the default value for BimodalDecayTime.
DefaultBimodalNodeWeight is the default value for the BimodalNodeWeight in BimodalConfig.
DefaultBimodalScaleMsat is the default value for BimodalScaleMsat in BimodalConfig.
DefaultCapacityFraction is the default value for CapacityFraction.
DefaultFeeEstimationTimeout is the default value for FeeEstimationTimeout.
DefaultMaxMcHistory is the default maximum history size.
DefaultMcFlushInterval is the default interval we use to flush MC state to the database.
DefaultMinFailureRelaxInterval is the default minimum time that must have passed since the previously recorded failure before the failure amount may be raised.
DefaultPayAttemptTimeout is the default payment attempt timeout.
DefaultPenaltyHalfLife is the default half-life duration.
MaxCLTVDelta is the maximum CLTV value accepted by LND for all timelock deltas.
MinCLTVDelta is the minimum CLTV value accepted by LND for all timelock deltas.
RiskFactorBillionths controls the influence of time lock delta of a channel on route selection.
No description provided by the author

# Variables

BlindedPathNUMSKey is a NUMS key (nothing up my sleeves number) that has no known private key.
CompressedBlindedPathNUMSKey is the compressed version of the BlindedPathNUMSKey.
DefaultAprioriHopProbability is the default a priori probability for a hop.
DefaultAttemptCost is the default fixed virtual cost in path finding of a failed payment attempt.
DefaultAttemptCostPPM is the default proportional virtual cost in path finding weight units of executing a payment attempt that fails.
DefaultEstimator is the default estimator used for computing probabilities in pathfinding.
DefaultMinRouteProbability is the default minimum probability for routes returned from findPath.
DefaultShardMinAmt is the default amount beyond which we won't try to further split the payment if no route is found.
ErrExpiryAndBlinded is returned if a final cltv and a blinded path are provided, as the cltv should be provided within the blinded path.
ErrHintsAndBlinded is returned if a route request has both bolt 11 route hints and a blinded path set.
ErrHTLCRestrictions is returned when a blinded path has invalid HTLC maximum and minimum values.
ErrInsufficientBlindedHops is returned when a blinded path does not have enough blinded hops.
ErrInvalidAprioriWeight is returned when we get an apriori weight that is out of range.
ErrInvalidCapacityFraction is returned when we get a capacity fraction that is out of range.
ErrInvalidDecayTime is returned when we get a decay time below zero.
ErrInvalidFailureInterval is returned if we get an invalid failure interval.
ErrInvalidHalflife is returned when we get an invalid half life.
ErrInvalidHopProbability is returned when we get an invalid hop probability.
ErrInvalidMcHistory is returned if we get a negative mission control history count.
ErrInvalidNodeWeight is returned when we get a node weight that is out of range.
ErrInvalidScale is returned when we get a scale below or equal zero.
ErrNoBlindedPath is returned when the blinded path in a blinded payment is missing.
ErrNoPayLoadSizeFunc is returned when no payload size function is definied.
ErrNoTarget is returned when the target node for a route is not provided by either a blinded route or a cleartext pubkey.
ErrPaymentLifecycleExiting is used when waiting for htlc attempt result, but the payment lifecycle is exiting .
ErrRouterShuttingDown is returned if the router is in the process of shutting down.
ErrSelfIntro is a failure returned when the source node of a route request is also the introduction node.
ErrSkipTempErr is returned when a non-MPP is made yet the skipTempErr flag is set.
ErrTargetAndBlinded is returned is a target destination and a blinded path are both set (as the target is inferred from the blinded path).
ErrZeroCapacity is returned when we encounter a channel with zero capacity in probability estimation.

# Structs

AMPOptions houses information that must be known in order to send an AMP payment.
AprioriConfig contains configuration for our probability estimator.
AprioriEstimator returns node and pair probabilities based on historical payment results.
BimodalConfig contains configuration for our probability estimator.
BimodalEstimator returns node and pair probabilities based on historical payment results based on a liquidity distribution model of the LN.
BlindedEdge implements the AdditionalEdge interface.
BlindedPathRestrictions are a set of constraints to adhere to when choosing a set of blinded paths to this node.
BlindedPayment provides the path and payment parameters required to send a payment along a blinded path.
BlindedPaymentPathSet groups the data we need to handle sending to a set of blinded paths provided by the recipient of a payment.
ChannelPolicy holds the parameters that determine the policy we enforce when forwarding payments on a channel.
ChannelRouter is the layer 3 router within the Lightning stack.
Config defines the configuration for the ChannelRouter.
DirectedNodePair stores a directed pair of nodes.
EdgeLocator is a struct used to identify a specific edge.
ErrNoChannel is returned when a route cannot be built because there are no channels that satisfy all requirements.
FeeSchema is the set fee configuration for a Lightning Node on the network.
LightningPayment describes a payment to be sent through the network to the final destination.
MissionControl contains state which summarizes the past attempts of HTLC routing by external callers when sending payments throughout the network.
MissionControlConfig defines parameters that control mission control behaviour.
MissionControlPairSnapshot contains a snapshot of the current node pair state in mission control.
MissionControlSnapshot contains a snapshot of the current state of mission control.
PathFindingConfig defines global parameters that control the trade-off in path finding between fees and probability.
PrivateEdge implements the AdditionalEdge interface.
RestrictParams wraps the set of restrictions passed to findPath that the found path must adhere to.
RouteRequest contains the parameters for a pathfinding request.
SessionSource defines a source for the router to retrieve new payment sessions.
TimedPairResult describes a timestamped pair result.

# Interfaces

AdditionalEdge is an interface which specifies additional edges which can be appended to an existing route.
ControlTower tracks all outgoing payments made, whose primary purpose is to prevent duplicate payments to the same payment hash.
ControlTowerSubscriber contains the state for a payment update subscriber.
Estimator estimates the probability to reach a node.
Graph is an abstract interface that provides information about nodes and edges to pathfinding.
GraphSessionFactory can be used to produce a new Graph instance which can then be used for a path-finding session.
MissionController is an interface that exposes failure reporting and probability estimation.
PaymentAttemptDispatcher is used by the router to send payment attempts onto the network, and receive their results.
PaymentSession is used during SendPayment attempts to provide routes to attempt.
PaymentSessionSource is an interface that defines a source for the router to retrieve new payment sessions.

# Type aliases

NodeResults contains previous results from a node to its peers.
PayloadSizeFunc defines the interface for the payload size function.
RouteHints is an alias type for a set of route hints, with the source node as the map's key and the details of the hint(s) in the edge policy.