Documentation
¶
Index ¶
- Constants
- Variables
- func DisableLog()
- func UseLogger(logger btclog.Logger)
- type Boltnd
- type Config
- type ConfigOption
- func OptionLNDClient(lndClientCfg *lndclient.LndServicesConfig) ConfigOption
- func OptionLNDConfig(cfg *lnd.Config) ConfigOption
- func OptionLNDLogger(root *build.RotatingLogWriter, interceptor signal.Interceptor) ConfigOption
- func OptionRequestShutdown(s func()) ConfigOption
- func OptionSetupLogger(setup func(string, LogRegistration)) ConfigOption
- type LogRegistration
Constants ¶
const ( // DefaultLNDRetries is the default number of times we retry connecting // to lnd before erroring out. DefaultLNDRetries = 4 // DefaultLNDWait is the default amount of time we backoff between // lnd connection attempts. DefaultLNDWait = time.Second * 10 )
const Subsystem = "B12-OFRS"
Subsystem defines the logging code for this subsystem.
Variables ¶
var MinimumLNDVersion = &verrpc.Version{ AppMajor: 0, AppMinor: 15, AppPatch: 0, BuildTags: []string{ "signrpc", "walletrpc", "chainrpc", "invoicesrpc", }, }
MinimumLNDVersion is the minimum lnd version and set of build tags required.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
Types ¶
type Boltnd ¶
type Boltnd struct {
// contains filtered or unexported fields
}
Boltnd holds opt-in bolt features that are externally implemented for lnd.
func NewBoltnd ¶
func NewBoltnd(opts ...ConfigOption) (*Boltnd, error)
NewBoltnd returns a new external boltnd implementation. Note that the lnd config provided must be fully initialized so that we can setup our logging.
func (*Boltnd) Permissions ¶
Permissions returns all permissions for which boltnd's external validator is responsible.
NOTE: This is part of the lnd.ExternalValidator interface.
func (*Boltnd) RegisterGrpcSubserver ¶
RegisterGrpcSubserver is a callback on the lnd.SubserverConfig struct that is called once lnd has initialized its main gRPC server instance. It gives the daemons (or external subservers) the possibility to register themselves to the same server instance.
NOTE: This is part of the lnd.GrpcRegistrar interface.
func (*Boltnd) ValidateMacaroon ¶
ValidateMacaroon extracts the macaroon from the context's gRPC metadata, checks its signature, makes sure all specified permissions for the called method are contained within and finally ensures all caveat conditions are met. A non-nil error is returned if any of the checks fail.
NOTE: This is part of the lnd.ExternalValidator interface.
type Config ¶
type Config struct { // LndClientCfg provides configuration LndClientCfg *lndclient.LndServicesConfig // SetupLogger is used to register our loggers with a top level logger. SetupLogger func(prefix string, register LogRegistration) // RequestShutdown is an optional closure to request clean shutdown // from the calling entity if the boltnd instance errors out. RequestShutdown func() // LNDRetires is the number of times we try to connect to lnd's grpc // server (with backoff set by LNDWait) before exiting with an error. // This value should be set to 0 if we want to immediately exit if // we can't successfully connect. LNDRetires uint8 // LNDWait is the amount of time to wait between retries to connect to // lnd's grpc server. LNDWait time.Duration }
Config contains the configuration required for boltnd.
type ConfigOption ¶
ConfigOption is the function signature used for functional options that update config.
func OptionLNDClient ¶
func OptionLNDClient(lndClientCfg *lndclient.LndServicesConfig) ConfigOption
OptionLNDClient sets the lnd client config in our top level config.
func OptionLNDConfig ¶
func OptionLNDConfig(cfg *lnd.Config) ConfigOption
OptionLNDConfig returns a functional option that will use lnd's internal config struct to create the lndclient config for our lndclient config.
func OptionLNDLogger ¶
func OptionLNDLogger(root *build.RotatingLogWriter, interceptor signal.Interceptor) ConfigOption
OptionLNDLogger uses lnd's root logger and interceptor to register our logs.
func OptionRequestShutdown ¶
func OptionRequestShutdown(s func()) ConfigOption
OptionRequestShutdown provides a closure that will gracefully shutdown the calling code if boltnd exits with an error.
func OptionSetupLogger ¶
func OptionSetupLogger(setup func(string, LogRegistration)) ConfigOption
OptionSetupLogger sets the setup logger function in our config.
type LogRegistration ¶
LogRegistration is the function signature used to register loggers.