lncfg

package
v0.10.0-beta.rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinRejectCacheSize is a floor on the maximum capacity allowed for
	// channeldb's reject cache. This amounts to roughly 125 KB when full.
	MinRejectCacheSize = 5000

	// MinChannelCacheSize is a floor on the maximum capacity allowed for
	// channeldb's channel cache. This amounts to roughly 2 MB when full.
	MinChannelCacheSize = 1000
)
View Source
const (
	// DefaultReadWorkers is the default maximum number of concurrent
	// workers used by the daemon's read pool.
	DefaultReadWorkers = 100

	// DefaultWriteWorkers is the default maximum number of concurrent
	// workers used by the daemon's write pool.
	DefaultWriteWorkers = 8

	// DefaultSigWorkers is the default maximum number of concurrent workers
	// used by the daemon's sig pool.
	DefaultSigWorkers = 8
)

Variables

This section is empty.

Functions

func ClientAddressDialer

func ClientAddressDialer(defaultPort string) func(context.Context,
	string) (net.Conn, error)

ClientAddressDialer creates a gRPC dialer that can also dial unix socket addresses instead of just TCP addresses.

func EnforceSafeAuthentication

func EnforceSafeAuthentication(addrs []net.Addr, macaroonsActive bool) error

EnforceSafeAuthentication enforces "safe" authentication taking into account the interfaces that the RPC servers are listening on, and if macaroons are activated or not. To protect users from using dangerous config combinations, we'll prevent disabling authentication if the server is listening on a public interface.

func IsLoopback

func IsLoopback(addr string) bool

IsLoopback returns true if an address describes a loopback interface.

func IsUnix

func IsUnix(addr net.Addr) bool

IsUnix returns true if an address describes an Unix socket address.

func ListenOnAddress

func ListenOnAddress(addr net.Addr) (net.Listener, error)

ListenOnAddress creates a listener that listens on the given address.

func NormalizeAddresses

func NormalizeAddresses(addrs []string, defaultPort string,
	tcpResolver TCPResolver) ([]net.Addr, error)

NormalizeAddresses returns a new slice with all the passed addresses normalized with the given default port and all duplicates removed.

func ParseAddressString

func ParseAddressString(strAddress string, defaultPort string,
	tcpResolver TCPResolver) (net.Addr, error)

ParseAddressString converts an address in string format to a net.Addr that is compatible with lnd. UDP is not supported because lnd needs reliable connections. We accept a custom function to resolve any TCP addresses so that caller is able control exactly how resolution is performed.

func ParseLNAddressString

func ParseLNAddressString(strAddress string, defaultPort string,
	tcpResolver TCPResolver) (*lnwire.NetAddress, error)

ParseLNAddressString converts a string of the form <pubkey>@<addr> into an lnwire.NetAddress. The <pubkey> must be presented in hex, and result in a 33-byte, compressed public key that lies on the secp256k1 curve. The <addr> may be any address supported by ParseAddressString. If no port is specified, the defaultPort will be used. Any tcp addresses that need resolving will be resolved using the custom TCPResolver.

func TLSListenOnAddress

func TLSListenOnAddress(addr net.Addr,
	config *tls.Config) (net.Listener, error)

TLSListenOnAddress creates a TLS listener that listens on the given address.

func Validate

func Validate(validators ...Validator) error

Validate accepts a variadic list of Validators and checks that each one passes its Validate method. An error is returned from the first Validator that fails.

Types

type Caches

type Caches struct {
	// RejectCacheSize is the maximum number of entries stored in lnd's
	// reject cache, which is used for efficiently rejecting gossip updates.
	// Memory usage is roughly 25b per entry.
	RejectCacheSize int `` /* 222-byte string literal not displayed */

	// ChannelCacheSize is the maximum number of entries stored in lnd's
	// channel cache, which is used reduce memory allocations in reply to
	// peers querying for gossip traffic. Memory usage is roughly 2Kb per
	// entry.
	ChannelCacheSize int `` /* 205-byte string literal not displayed */
}

Caches holds the configuration for various caches within lnd.

func (*Caches) Validate

func (c *Caches) Validate() error

Validate checks the Caches configuration for values that are too small to be sane.

type Prometheus

type Prometheus struct{}

Prometheus configures the Prometheus exporter when monitoring is enabled. Monitoring is currently disabled.

func DefaultPrometheus

func DefaultPrometheus() Prometheus

DefaultPrometheus is the default configuration for the Prometheus metrics exporter when monitoring is enabled. Monitoring is currently disabled.

func (*Prometheus) Enabled

func (p *Prometheus) Enabled() bool

Enabled returns whether or not Prometheus monitoring is enabled. Monitoring is currently disabled, so Enabled will always return false.

type ProtocolOptions

type ProtocolOptions struct {
}

ProtocolOptions is a struct that we use to be able to test backwards compatibility of protocol additions, while defaulting to the latest within lnd, or to enable experimental protocol changes.

func (*ProtocolOptions) AnchorCommitments

func (l *ProtocolOptions) AnchorCommitments() bool

AnchorCommitments returns true if support for the the anchor commitment type should be signaled.

func (*ProtocolOptions) LegacyOnion

func (l *ProtocolOptions) LegacyOnion() bool

LegacyOnion returns true if the old legacy onion format should be used when we're an intermediate or final hop. This controls if we set the TLVOnionPayloadOptional bit or not.

func (*ProtocolOptions) NoStaticRemoteKey

func (l *ProtocolOptions) NoStaticRemoteKey() bool

NoStaticRemoteKey returns true if the old commitment format with a tweaked remote key should be used for new funded channels.

type TCPResolver

type TCPResolver = func(network, addr string) (*net.TCPAddr, error)

TCPResolver is a function signature that resolves an address on a given network.

type Validator

type Validator interface {
	// Validate returns an error if a particular configuration is invalid or
	// insane.
	Validate() error
}

Validator is a generic interface for validating sub configurations.

type Watchtower

type Watchtower struct {
	Active bool `long:"active" description:"If the watchtower should be active or not"`

	TowerDir string `long:"towerdir" description:"Directory of the watchtower.db"`

	watchtower.Conf
}

Watchtower holds the daemon specific configuration parameters for running a watchtower that shares resources with the daemon.

type Workers

type Workers struct {
	// Read is the maximum number of concurrent read pool workers.
	Read int `` /* 132-byte string literal not displayed */

	// Write is the maximum number of concurrent write pool workers.
	Write int `` /* 146-byte string literal not displayed */

	// Sig is the maximum number of concurrent sig pool workers.
	Sig int `` /* 141-byte string literal not displayed */
}

Workers exposes CLI configuration for turning resources consumed by worker pools.

func (*Workers) Validate

func (w *Workers) Validate() error

Validate checks the Workers configuration to ensure that the input values are sane.

type WtClient

type WtClient struct {
	// Active determines whether a watchtower client should be created to
	// back up channel states with registered watchtowers.
	Active bool `long:"active" description:"Whether the daemon should use private watchtowers to back up revoked channel states."`

	// PrivateTowerURIs specifies the lightning URIs of the towers the
	// watchtower client should send new backups to.
	PrivateTowerURIs []string `` /* 263-byte string literal not displayed */

	// SweepFeeRate specifies the fee rate in sat/byte to be used when
	// constructing justice transactions sent to the tower.
	SweepFeeRate uint64 `` /* 144-byte string literal not displayed */
}

WtClient holds the configuration options for the daemon's watchtower client.

func (*WtClient) Validate

func (c *WtClient) Validate() error

Validate ensures the user has provided a valid configuration.

NOTE: Part of the Validator interface.

Jump to

Keyboard shortcuts

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