Documentation ¶
Index ¶
- Constants
- func Connect(host, tlsCertPath, macaroonPath string) (*grpc.ClientConn, error)
- func ImportChannelList(t lnrpc.ChannelEventUpdate_UpdateType, db *sqlx.DB, ...) error
- func ImportMissingNodeEvents(client lnrpc.LightningClient, db *sqlx.DB) error
- func ImportRoutingPolicies(client lnrpc.LightningClient, db *sqlx.DB) error
- func ImportTransactions(client lnrpc.LightningClient, db *sqlx.DB) error
- func InitChanIdList(db *sqlx.DB) error
- func InitOurNodesList(pubkeys []string)
- func InitPeerList(db *sqlx.DB) error
- func SubscribeAndStoreChannelEvents(ctx context.Context, client lnrpc.LightningClient, db *sqlx.DB, ...) error
- func SubscribeAndStoreChannelGraph(ctx context.Context, client lnrpc.LightningClient, db *sqlx.DB) error
- func SubscribeAndStoreHtlcEvents(ctx context.Context, router routerrpc.RouterClient, db *sqlx.DB) error
- func SubscribeAndStoreTransactions(ctx context.Context, client lnrpc.LightningClient, db *sqlx.DB) error
- func SubscribeForwardingEvents(ctx context.Context, client lightningClientForwardingHistory, db *sqlx.DB, ...) error
- func UpdateChanIdList(c chan string)
- func UpdatePeerList(c chan string)
- type FwhOptions
Constants ¶
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 ImportChannelList ¶
func ImportChannelList(t lnrpc.ChannelEventUpdate_UpdateType, db *sqlx.DB, client lnrpc.LightningClient) error
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 InitOurNodesList ¶
func InitOurNodesList(pubkeys []string)
InitOurNodesList populates the list of nodes owned by us.
func InitPeerList ¶
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 ¶
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.