node

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: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodePubkeyKeysendType   uint64 = 555555
	MessageKeysendType      uint64 = 684931
	MessageOrderKeysendType uint64 = 123456
)
View Source
const MAX_CUST_SIZE = 900

Variables

This section is empty.

Functions

func RandomUint64

func RandomUint64() uint64

Types

type LndConfig

type LndConfig struct {
	MacaroonPath string
	MacaroonHex  string
	TlsCertPath  string
	TlsCertHex   string
	Pubkey       string
	IpAddress    string
	Port         string
	ShouldListen bool
}

type LndNode

type LndNode interface {
	Node
}

func NewLndNode

func NewLndNode(cfg *LndConfig) (node LndNode, err error)

type Node

type Node interface {
	// GetInfo will get the node's basic info.
	GetInfo() (*lnrpc.GetInfoResponse, error)

	// GetPubkey will get the node's public key.
	GetPubkey() string

	// Subscribe will subscribe to keysends through the channel from the node.
	Subscribe(chan comm.IncomingDIDMessage) error

	// Keysend will send a message through Lightning to another node with an amount.
	Keysend(pubKey string, msgData []byte, amt int64) error

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

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

	// VerifySignature will verify the provided signature using a specific node pubkey.
	VerifySignatureFromPubkey(msg, signature, pubkey []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)

	// Disconnect will disconnect safely from the node.
	Disconnect() error

	// ShouldListen indicates if this node should listen to incoming messages
	ShouldListen() bool

	// 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)
}

Node is an implementation of a single lightning node with only the functionality that the LightningManager needs to worry about.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
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