Categorygithub.com/bittap-protocol/lnd
modulepackage
0.0.3
Repository: https://github.com/bittap-protocol/lnd.git
Documentation: pkg.go.dev

# README

Lightning Network Daemon

Release build MIT licensed Irc Godoc Go Report Card

The Lightning Network Daemon (lnd) - is a complete implementation of a Lightning Network node. lnd has several pluggable back-end chain services including btcd (a full-node), bitcoind, and neutrino (a new experimental light client). The project's codebase uses the btcsuite set of Bitcoin libraries, and also exports a large set of isolated re-usable Lightning Network related libraries within it. In the current state lnd is capable of:

  • Creating channels.
  • Closing channels.
  • Completely managing all channel states (including the exceptional ones!).
  • Maintaining a fully authenticated+validated channel graph.
  • Performing path finding within the network, passively forwarding incoming payments.
  • Sending outgoing onion-encrypted payments through the network.
  • Updating advertised fee schedules.
  • Automatic channel management (autopilot).

Lightning Network Specification Compliance

lnd fully conforms to the Lightning Network specification (BOLTs). BOLT stands for: Basis of Lightning Technology. The specifications are currently being drafted by several groups of implementers based around the world including the developers of lnd. The set of specification documents as well as our implementation of the specification are still a work-in-progress. With that said, the current status of lnd's BOLT compliance is:

  • BOLT 1: Base Protocol
  • BOLT 2: Peer Protocol for Channel Management
  • BOLT 3: Bitcoin Transaction and Script Formats
  • BOLT 4: Onion Routing Protocol
  • BOLT 5: Recommendations for On-chain Transaction Handling
  • BOLT 7: P2P Node and Channel Discovery
  • BOLT 8: Encrypted and Authenticated Transport
  • BOLT 9: Assigned Feature Flags
  • BOLT 10: DNS Bootstrap and Assisted Node Location
  • BOLT 11: Invoice Protocol for Lightning Payments

Developer Resources

The daemon has been designed to be as developer friendly as possible in order to facilitate application development on top of lnd. Two primary RPC interfaces are exported: an HTTP REST API, and a gRPC service. The exported API's are not yet stable, so be warned: they may change drastically in the near future.

An automatically generated set of documentation for the RPC APIs can be found at api.lightning.community. A set of developer resources including guides, articles, example applications and community resources can be found at: docs.lightning.engineering.

Finally, we also have an active Slack where protocol developers, application developers, testers and users gather to discuss various aspects of lnd and also Lightning in general.

Installation

In order to build from source, please see the installation instructions.

Docker

To run lnd from Docker, please see the main Docker instructions

IRC

  • irc.libera.chat
  • channel #lnd
  • webchat

Safety

When operating a mainnet lnd node, please refer to our operational safety guidelines. It is important to note that lnd is still beta software and that ignoring these operational guidelines can lead to loss of funds.

Security

The developers of lnd take security very seriously. The disclosure of security vulnerabilities helps us secure the health of lnd, privacy of our users, and also the health of the Lightning Network as a whole. If you find any issues regarding security or privacy, please disclose the information responsibly by sending an email to security at lightning dot engineering, preferably encrypted using our designated PGP key (91FE464CD75101DA6B6BAB60555C6465E5BCB3AF) which can be found here.

Further reading

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package chanfitness monitors the behaviour of channels to provide insight into the health and performance of a channel.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package labels contains labels used to label transactions broadcast by lnd.
No description provided by the author
No description provided by the author
NOTE: forcetypeassert is skipped for the mock because the test would fail if the returned value doesn't match the type.
No description provided by the author
Package lnrpc is a reverse proxy.
Package lntest provides testing utilities for the lnd repository.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AddSubLogger is a helper method to conveniently create and register the logger of one or more sub systems.
AdminAuthOptions returns a list of DialOptions that can be used to authenticate with the RPC server with admin capabilities.
CleanAndExpandPath expands environment variables and leading ~ in the passed path, cleans the result, and returns it.
DefaultConfig returns all default values for the Config struct.
GetAllPermissions returns all the permissions required to interact with lnd.
LoadConfig initializes and parses the config using a config file and command line options.
Main is the true entry point for lnd.
MainRPCServerPermissions returns a mapping of the main RPC server calls to the permissions they require.
NewDefaultDatabaseBuilder returns a new instance of the default database builder.
NewDefaultWalletImpl creates a new default wallet implementation.
NewRPCSignerWalletImpl creates a new instance of the remote signing wallet implementation.
NewTLSManager returns a reference to a new TLSManager.
SetSubLogger is a helper method to conveniently register the logger of a sub system.
SetupLoggers initializes all package-global logger variables.
ValidateConfig check the given configuration to be sane.

# Constants

BitcoinChainName is a string that represents the Bitcoin blockchain.
defaultHTTPHeaderTimeout is the default timeout for HTTP requests.
MaxTimeLockDelta is the maximum CLTV delta that can be applied to forwarded HTLCs.
UnassignedConnID is the default connection ID that a request can have before it actually is submitted to the connmgr.

# Variables

DefaultConfigFile is the default full path of lnd's configuration file.
DefaultLndDir is the default directory where lnd tries to find its configuration file and store its data.
ErrCannotFail is returned when an intercepted forward cannot be failed.
ErrCannotResume is returned when an intercepted forward cannot be resumed.
ErrPeerNotConnected signals that the server has no connection to the given peer.
ErrPreimageMismatch is returned when the preimage that is specified to settle an htlc doesn't match the htlc hash.
ErrServerNotActive indicates that the server has started but hasn't fully finished the startup process.
ErrServerShuttingDown indicates that the server is in the process of gracefully exiting.
MaxFundingAmount is a soft-limit of the maximum channel size currently accepted within the Lightning Protocol.

# Structs

Config defines the configuration options for lnd.
CustomMessage is a custom message that is received from a peer.
DatabaseInstances is a struct that holds all instances to the actual databases that are used in lnd.
DefaultDatabaseBuilder is a type that builds the default database backends for lnd, using the given configuration to decide what actual implementation to use.
DefaultWalletImpl is the default implementation of our normal, btcwallet backed configuration.
GRPCConfig holds the configuration options for the gRPC server.
ImplementationCfg is a struct that holds all configuration items for components that can be implemented outside lnd itself.
ListenerCfg is a wrapper around custom listeners that can be passed to lnd when calling its main method.
ListenerWithSignal is a net.Listener that has an additional Ready channel that will be closed when a server starts listening.
RPCSignerWalletImpl is a wallet implementation that uses a remote signer over an RPC interface.
TLSManager generates/renews a TLS cert/key pair when needed.
TLSManagerCfg houses a set of values and methods that is passed to the TLSManager for it to properly manage LND's TLS options.

# Interfaces

ChainControlBuilder is an interface that must be satisfied by a custom wallet implementation.
DatabaseBuilder is an interface that must be satisfied by the implementation that provides lnd's main database backend instances.
ExternalValidator is an interface that must be satisfied by an external macaroon validator.
GrpcRegistrar is an interface that must be satisfied by an external subserver that wants to be able to register its own gRPC server onto lnd's main grpc.Server instance.
RestRegistrar is an interface that must be satisfied by an external subserver that wants to be able to register its own REST mux onto lnd's main proxy.ServeMux instance.
WalletConfigBuilder is an interface that must be satisfied by a custom wallet implementation.