lnnode

package
v0.0.0-...-ddb1edc Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientConnection

func NewClientConnection(cfg *config.Config) (*grpc.ClientConn, error)

func TestTxSpentURL

func TestTxSpentURL(URL string) error

Types

type API

type API interface {
	SubscribeEvents() (*subscribe.Client, error)
	HasActiveChannel() bool
	IsReadyForPayment() bool
	WaitReadyForPayment(timeout time.Duration) error
	NodePubkey() string
	APIClient() lnrpc.LightningClient
	SubSwapClient() submarineswaprpc.SubmarineSwapperClient
	BreezBackupClient() breezbackuprpc.BreezBackuperClient
	RouterClient() routerrpc.RouterClient
	WalletKitClient() walletrpc.WalletKitClient
	ChainNotifierClient() chainrpc.ChainNotifierClient
	InvoicesClient() invoicesrpc.InvoicesClient
	SignerClient() signrpc.SignerClient
}

API represents the lnnode exposed functions that are accessible for breez services to use. It is mainly enable the service to subscribe to various daemon events and get an APIClient to query the daemon directly via RPC.

type BackupNeededEvent

type BackupNeededEvent struct{}

BackupNeededEvent is sent when the node signals backup is needed.

type ChainSyncedEvent

type ChainSyncedEvent struct{}

ChainSyncedEvent is sent when the chain gets into synced state.

type ChannelEvent

type ChannelEvent struct {
	*lnrpc.ChannelEventUpdate
}

ChannelEvent is sent whenever a channel is created/closed or active/inactive.

type Daemon

type Daemon struct {
	sync.Mutex

	TorConfig *tor.TorConfig
	// contains filtered or unexported fields
}

Daemon contains data regarding the lightning daemon.

func NewDaemon

func NewDaemon(cfg *config.Config, db *db.DB, startBeforeSync bool) (*Daemon, error)

NewDaemon is used to create a new daemon that wraps a lightning network daemon.

func (*Daemon) APIClient

func (d *Daemon) APIClient() lnrpc.LightningClient

APIClient returns the interface to query the daemon.

func (*Daemon) BreezBackupClient

func (d *Daemon) BreezBackupClient() breezbackuprpc.BreezBackuperClient

func (*Daemon) ChainNotifierClient

func (d *Daemon) ChainNotifierClient() chainrpc.ChainNotifierClient

func (*Daemon) ClosedChannels

func (d *Daemon) ClosedChannels() (int, error)

func (*Daemon) HasActiveChannel

func (d *Daemon) HasActiveChannel() bool

HasActiveChannel returns true if the node has at least one active channel.

func (*Daemon) InvoicesClient

func (d *Daemon) InvoicesClient() invoicesrpc.InvoicesClient

func (*Daemon) IsReadyForPayment

func (d *Daemon) IsReadyForPayment() bool

IsReadyForPayment returns true if we can pay

func (*Daemon) NodePubkey

func (d *Daemon) NodePubkey() string

NodePubkey returns the identity public key of the lightning node.

func (*Daemon) PopulateChannelsGraph

func (a *Daemon) PopulateChannelsGraph() error

func (*Daemon) RestartDaemon

func (d *Daemon) RestartDaemon() error

RestartDaemon is used to restart a daemon that from some reason failed to start or was started and failed at some later point.

func (*Daemon) RouterClient

func (d *Daemon) RouterClient() routerrpc.RouterClient

func (*Daemon) SignerClient

func (d *Daemon) SignerClient() signrpc.SignerClient

func (*Daemon) Start

func (d *Daemon) Start() error

Start is used to start the lightning network daemon.

func (*Daemon) Stop

func (d *Daemon) Stop() error

Stop is used to stop the lightning network daemon.

func (*Daemon) SubSwapClient

func (d *Daemon) SubSwapClient() submarineswaprpc.SubmarineSwapperClient

func (*Daemon) SubscribeEvents

func (d *Daemon) SubscribeEvents() (*subscribe.Client, error)

SubscribeEvents subscribe to various application events

func (*Daemon) WaitReadyForPayment

func (d *Daemon) WaitReadyForPayment(timeout time.Duration) error

WaitReadyForPayment is waiting untill we are ready to pay

func (*Daemon) WalletKitClient

func (d *Daemon) WalletKitClient() walletrpc.WalletKitClient

type DaemonDownEvent

type DaemonDownEvent struct{}

DaemonDownEvent is sent when the daemon stops

type DaemonReadyEvent

type DaemonReadyEvent struct {
	IdentityPubkey string
}

DaemonReadyEvent is sent when the daemon is ready for RPC requests

type Dependencies

type Dependencies struct {
	// contains filtered or unexported fields
}

Dependencies is an implementation of interface daemon.Dependencies used for injecting breez deps int LND running as library

func (*Dependencies) ChainService

func (d *Dependencies) ChainService() *neutrino.ChainService

ChainService returns a neutrino.ChainService to be used from both sync job and LND running daemon

func (*Dependencies) ChanDB

func (d *Dependencies) ChanDB() *channeldb.DB

ChanDB returns the channel db for the daemon

func (*Dependencies) ReadyChan

func (d *Dependencies) ReadyChan() chan interface{}

ReadyChan returns the channel passed to LND for getting ready signal

type InvoiceEvent

type InvoiceEvent struct {
	*lnrpc.Invoice
}

InvoiceEvent is sent when a new invoice is created/settled.

type PeerEvent

type PeerEvent struct {
	*lnrpc.PeerEvent
}

PeerEvent is sent whenever a peer is connected/disconnected.

type ResumeEvent

type ResumeEvent struct{}

ResumeEvent is sent when the app resumes.

type RoutingNodeChannelOpened

type RoutingNodeChannelOpened struct{}

RoutingNodeChannelOpened is sent when a channel with the routing node is opened.

type TransactionEvent

type TransactionEvent struct {
	*lnrpc.Transaction
}

TransactionEvent is sent when a new transaction is received.

Jump to

Keyboard shortcuts

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