embeddeddcrlnd

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: ISC Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLNWalletNotFound = errors.New("wallet not found")

Functions

This section is empty.

Types

type ChainSyncNotifier

type ChainSyncNotifier func(*initchainsyncrpc.ChainSyncUpdate, error)

type Config

type Config struct {
	// RootDir is the root data dir where dcrlnd data is stored.
	RootDir string

	// Network is one of the supported dcrlnd networks.
	Network string

	// DebugLevel is the logging level to use.
	DebugLevel string

	// MaxLogFiles is the max number of log files to keep around.
	MaxLogFiles int

	// RPCAddresses are addresses to bind gRPC to. When non-empty, the
	// first address MUST be one accessible for the local host (e.g.
	// 127.0.0.1:<port>), otherwise initialization may hang forever.
	RPCAddresses []string

	// DialFunc can be set to specify a non standard dialer.
	DialFunc func(context.Context, string, string) (net.Conn, error)

	// TorAddr is the host:port the Tor's SOCKS5 proxy is listening on.
	TorAddr string

	// TorIsolation enables Tor stream isolation.
	TorIsolation bool

	// SyncFreeList sets the SyncFreeList flag in the DB.
	SyncFreeList bool
}

Config are the config parameters of the dcrlnd instance.

type Dcrlnd

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

Dcrlnd is a running instance of an embedded dcrlnd instance.

func RunDcrlnd

func RunDcrlnd(ctx context.Context, cfg Config) (*Dcrlnd, error)

RunDcrlnd initializes and runs a new embedded dcrlnd instance. It returns with the (locked) instance if no errors are found.

The passed context is only used during the attempts to connect to the running node.

func (*Dcrlnd) Create

func (lndc *Dcrlnd) Create(ctx context.Context, pass string, existingSeed []string,
	multiChanBackup []byte) ([]byte, error)

Create attempts to create a new wallet using a new seed and protects the wallet with the given passphrase. The seed for the wallet is returned.

func (*Dcrlnd) MacaroonPath

func (lndc *Dcrlnd) MacaroonPath() string

MacaroonPath returns the path to the macaroon file of the dcrlnd instance.

func (*Dcrlnd) NotifyInitialChainSync

func (lndc *Dcrlnd) NotifyInitialChainSync(ctx context.Context, ntf ChainSyncNotifier)

NotifyInitialChainSync calls the especified notifier while the chain is syncing. The notifier will be called at least once, either with a message with Synced = true or with an error.

func (*Dcrlnd) RPCAddr

func (lndc *Dcrlnd) RPCAddr() string

RPCAddr returns the address of the gRPC endpoint of the running dcrlnd instance.

func (*Dcrlnd) Stop

func (lndc *Dcrlnd) Stop()

Stop stops the running dcrlnd instance.

func (*Dcrlnd) TLSCertPath

func (lndc *Dcrlnd) TLSCertPath() string

TLSCertPath returns the path to the TLS cert of the dcrlnd instance.

func (*Dcrlnd) TryUnlock

func (lndc *Dcrlnd) TryUnlock(ctx context.Context, pass string) error

TryUnlock attempts to unlock the wallet with the given passphrase.

func (*Dcrlnd) Wait

func (lndc *Dcrlnd) Wait(ctx context.Context) error

Wait blocks until this process is done or the passed context is canceled.

Jump to

Keyboard shortcuts

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