lndutil

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MAXEVENTS int = 50000

MAXEVENTS is used to set the maximum events in ForwardingHistoryRequest. It's also used to check if we need to request more.

Variables

This section is empty.

Functions

func Connect

func Connect(host, tlsCertPath, macaroonPath string) (*grpc.ClientConn, error)

Connect connects to LND using gRPC.

func ImportMissingNodeEvents

func ImportMissingNodeEvents(client lnrpc.LightningClient, db *sqlx.DB) error

ImportMissingNodeEvents imports information about all nodes that we have had a channel with.

func ImportRoutingPolicies

func ImportRoutingPolicies(client lnrpc.LightningClient, db *sqlx.DB) error

ImportRoutingPolicies imports routing policy information about all open channels if they don't already have

func ImportTransactions

func ImportTransactions(client lnrpc.LightningClient, db *sqlx.DB) error

func InitChanIdList

func InitChanIdList(db *sqlx.DB) error

func InitOurNodesList

func InitOurNodesList(pubkeys []string)

InitOurNodesList populates the list of nodes owned by us.

func InitPeerList

func InitPeerList(db *sqlx.DB) error

InitPeerList fetches all public keys from the list of all channels. This is used to filter out noise from the graph updates.

func SubscribeAndStoreChannelEvents

func SubscribeAndStoreChannelEvents(ctx context.Context, client lnrpc.LightningClient,
	db *sqlx.DB, pubKeyChan chan string, chanPoinChan chan string) error

SubscribeAndStoreChannelEvents Subscribes to channel events from LND and stores them in the database as a time series

func SubscribeAndStoreChannelGraph

func SubscribeAndStoreChannelGraph(ctx context.Context, client lnrpc.LightningClient, db *sqlx.DB) error

SubscribeAndStoreChannelGraph Subscribes to channel updates

func SubscribeAndStoreHtlcEvents

func SubscribeAndStoreHtlcEvents(ctx context.Context, router routerrpc.RouterClient, db *sqlx.DB) error

SubscribeAndStoreHtlcEvents subscribes to HTLC events from LND and stores them in the database as time series. NB: LND has marked HTLC event streaming as experimental. Delivery is not guaranteed, so dataset might not be complete HTLC events is primarily used to diagnose how good a channel / node is. And if the channel allocation should change.

func SubscribeAndStoreTransactions

func SubscribeAndStoreTransactions(ctx context.Context, client lnrpc.LightningClient, db *sqlx.DB) error

SubscribeAndStoreTransactions Subscribes to on-chain transaction events from LND and stores them in the database as a time series. It will also import unregistered transactions on startup.

func SubscribeForwardingEvents

func SubscribeForwardingEvents(ctx context.Context, client lightningClientForwardingHistory,
	db *sqlx.DB, opt *FwhOptions) error

SubscribeForwardingEvents repeatedly requests forwarding history starting after the last forwarding stored in the database and stores new forwards.

func UpdateChanIdList

func UpdateChanIdList(c chan string)

func UpdatePeerList

func UpdatePeerList(c chan string)

UpdatePeerList is meant to run as a gorouting. It adds new public keys to the pubKeyList and removes existing ones.

Types

type FwhOptions

type FwhOptions struct {
	MaxEvents *int
	Tick      <-chan time.Time
}

FwhOptions allows the caller to adjust the number of forwarding events can be requested at a time and set a custom time interval between requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL