Help us shape the future of Go! Take the 2026 Go Developer Survey

lightning

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LightningManager

type LightningManager interface {
	// Status will report the status of the Lightning Nodes connected
	Status() ([]NodeStatus, error)

	// Subscribe will subscribe to keysend events on all nodes on configured chan.
	Subscribe() error

	// CheckMsg will check the message to see if it can send down this transport
	CheckMsg(endpoint string, msg *comm.DIDCommMsg) bool

	// SendData will send a keysend message from a specific node public key.
	SendData(endpoint string, msg *comm.DIDCommMsg) error

	// AddNode will add a node to the LightningManager.
	// If subscriptions are active, will start on new node.
	AddNode(node.Node) error

	// SignMessage will sign the provided message using a node
	SignMessage([]byte) ([]byte, error)

	// VerifySignature will verify the provided signature using a node
	VerifySignature([]byte, []byte) (bool, error)

	// GenerateInvoice will generate an invoice from one of the active nodes.
	GenerateInvoice(int64, string) (string, error)

	// PayInvoice will pay an invoice from one of the active nodes.
	PayInvoice(string) (string, error)

	// PayInvoice will check an invoice for payment.
	CheckInvoice(string) (bool, error)

	// RemoveNode will disconnect & remove node from LightningManager.
	RemoveNode(string) error

	// Stop will stop the lightning manager and
	// all lightning nodes connected to it.
	Stop()

	// GetChannels Get the channels from the connected LND node
	GetChannels() (int64, error)

	// ListPayments Get the payments from the connected LND node
	ListPayments() (string, error)

	// ListInvoices Get the invoices from the connected LND node
	ListInvoices() (string, error)
}

LightningManager is the manager in charge of subscribing to and managing multiple lightning nodes. Data transfer happens via channels in order to abstract base functionality.

func NewLightningManager

func NewLightningManager(cfg *LightningManagerConfig) LightningManager

type LightningManagerConfig

type LightningManagerConfig struct {
	IncomingDataChan chan comm.IncomingDIDMessage
}

type NodeStatus added in v1.1.0

type NodeStatus struct {
	Pubkey string
	Active bool
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
mock/lnd
Package lnd_mock is a generated GoMock package.
Package lnd_mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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