Main Menu
LNCLI Methods Overview
53 min
lncli command line interface reference info methods getinfo syntax lncli getinfo description returns basic information related to the active lnd daemon, including identity pubkey, alias, chains connected to, and information about open/pending channels key parameters no additional parameters required (uses global options like rpcserver, macaroonpath, tlscertpath) usage example getnetworkinfo syntax lncli getnetworkinfo description get statistical information about the current state of the lightning network from the node's perspective, including number of nodes, channels, and network capacity key parameters no additional parameters required usage example channelbalance syntax lncli channelbalance description returns the sum of the total available channel balance across all open channels, categorized in local/remote, pending local/remote and unsettled local/remote balances key parameters no additional parameters required usage example walletbalance syntax lncli walletbalance description compute and display the wallet's current on chain balance, showing total unspent outputs (confirmed and unconfirmed), all confirmed unspent outputs and all unconfirmed unspent outputs under control of the wallet key parameters \ account the name of the account to retrieve the balance for (optional) min confs the minimum number of confirmations each output should have (optional) usage example invoice methods addinvoice syntax lncli addinvoice \[command options] \[value] \[preimage] description add a new invoice, expressing intent for a future payment invoices without an amount can be created by not supplying any parameters or providing an amount of 0, allowing the payer to specify the amount key parameters \ memo a description of the payment to attach along with the invoice amt the amount of satoshis in this invoice (default 0) amt msat the amount of millisatoshis in this invoice expiry payment request expiry time in seconds (default 3600) amp generates an amp invoice which can be paid multiple times preimage the hex encoded preimage (32 byte) for the invoice description hash sha 256 hash of the description fallback addr fallback on chain address usage examples cancelinvoice syntax lncli cancelinvoice \[payment hash] description cancel an existing invoice by its payment hash note this command is available in newer versions of lnd (0 8 0+) and requires the payment hash in hexadecimal format key parameters payment hash the payment hash of the invoice to cancel (required, hex format) usage example lookupinvoice syntax lncli lookupinvoice \[payment hash] description lookup an existing invoice by its payment hash the passed payment hash must be exactly 32 bytes in hexadecimal format key parameters payment hash the payment hash of the invoice to lookup (required, hex format) usage example subscribeinvoices syntax lncli subscribeinvoices \[command options] description creates a uni directional stream from the server to the client for notifying the client of any newly created/settled invoices this is a streaming rpc that will continuously return invoice updates key parameters \ add index the add index starting point for streaming (optional) settle index the settle index starting point for streaming (optional) usage example listinvoices syntax lncli listinvoices \[command options] description list all invoices currently stored within the database any active debug invoices are ignored it has full support for paginated responses with various filtering options key parameters \ pending only toggles if all invoices should be returned, or only unsettled ones index offset the index of an invoice to use as start/end of query (default 0) max invoices the max number of invoices to return (default 100) paginate forwards if set, invoices succeeding the index offset will be returned creation date start filter invoices with creation date >= this timestamp creation date end filter invoices with creation date <= this timestamp usage examples payment methods decodepayreq syntax lncli decodepayreq \<payment request> description decodepayreq takes an encoded payment request string and attempts to decode it, returning a full description of the conditions encoded within the payment request key parameters payment request the lightning network payment request (invoice) string to decode usage example deleteallpayments syntax lncli deletepayments all \[ include non failed] description deleteallpayments deletes all outgoing payments from the database note that it will not attempt to delete in flight payments, since that would be unsafe by default, only failed payments are deleted key parameters \ all delete all payments include non failed include successful payments in deletion (optional, false by default) usage examples deletepayment syntax lncli deletepayments \<payment hash> \[ include non failed] description deletepayment deletes a specific outgoing payment from the database by its payment hash note that it will not attempt to delete an in flight payment, since that would be unsafe key parameters payment hash the hex encoded payment hash of the payment to delete include non failed allow deletion of successful payments (optional, false by default) usage example listpayments syntax lncli listpayments \[ include incomplete] \[ index offset=\<offset>] \[ max payments=\<num>] \[ reversed] description listpayments returns a list of all outgoing payments made by the node key parameters \ include incomplete include incomplete (failed/pending) payments in the list index offset the index of a payment used as an offset point max payments the maximum number of payments to return reversed return payments in reverse chronological order usage examples trackpayment syntax lncli trackpayment \[ json] \<payment hash> description track progress of an existing payment pick up monitoring the progression of a previously initiated payment specified by the hash argument key parameters payment hash the hex encoded payment hash to track json output payment updates as json messages usage example sendpayment syntax lncli sendpayment \[options] pay req=\<payment request> or lncli sendpayment \[options] \<dest> \<amt> \[payment hash] \[final cltv delta] description send a payment over lightning can either use a payment request (invoice) or manually specify payment parameters note this command is deprecated in favor of routerrpc sendpaymentv2 in newer versions key parameters \ pay req payment request (invoice) to pay dest destination public key (hex) amt amount in satoshis keysend send spontaneous payment without invoice amp use atomic multi path payments fee limit maximum fee in satoshis fee limit percent maximum fee as percentage of payment amount timeout payment timeout in seconds usage examples advanced methods channel management channelacceptor syntax lncli channelacceptor description dispatches a bi directional streaming rpc that allows node operators to accept or reject inbound channel open requests based on custom criteria creates a persistent connection where openchannel requests are sent to the client, and the client responds with acceptance/rejection decisions key features streaming rpc maintaining persistent connection for real time channel requests custom control over channel acceptance criteria can modify channel parameters like csv delay, reserve amounts, etc usage example closechannel syntax lncli closechannel \[flags] funding txid output index or lncli closechannel \[flags] chan point=funding txid\ output index description closes an active channel identified by its channel outpoint (funding transaction id and output index) supports both cooperative and unilateral (force) closures with extensive fee control options key parameters \ force attempt unilateral (force) closure block wait for channel close confirmation conf target=\<blocks> target confirmation blocks for fee estimation sat per vbyte=\<amount> manual fee rate in sat/vbyte delivery addr=\<address> address to send funds on cooperative close usage examples closedchannels syntax lncli closedchannels \[flags] description returns a description of all closed channels that the node was a participant in only shows channels that are fully resolved on chain key parameters \ cooperative show only cooperatively closed channels local force show only locally force closed channels remote force show only remotely force closed channels breach show only breach remedy transactions funding canceled show only channels where funding was canceled abandoned show only abandoned channels usage example getchaninfo syntax lncli getchaninfo \[flags] \<chan id> or lncli getchaninfo chan point=\<txid\ index> description returns detailed authenticated network announcement information for a specific channel, identified by either its compact channel id or channel point key parameters chan id 8 byte compact channel id (uint64) chan point=\<txid\ index> channel point format (alternative to chan id) usage example listchannels syntax lncli listchannels \[flags] description returns a description of all open channels that the node is a participant in provides comprehensive filtering options for channel states key parameters \ active only show only currently active channels inactive only show only currently inactive channels public only show only public channels (announced to network) private only show only private channels (not announced) peer=\<pubkey> show channels with specific peer usage examples openchannel syntax lncli openchannel \[flags] \<node key> \<local amt> \[push amt] description opens a new lightning channel to an existing peer supports extensive customization of channel parameters, funding options, and fee policies key parameters \ connect=\<host\ port> connect to peer before opening channel private make channel private (not announced to network) conf target=\<blocks> target confirmation time sat per vbyte=\<amount> manual fee rate min htlc msat=\<amount> minimum htlc value (default 1000) base fee msat=\<amount> base fee for forwarding (default 1000) fee rate ppm=\<amount> fee rate in parts per million (default 1) zero conf attempt zero confirmation channel channel type=\<type> channel type ("tweakless", "anchors", "taproot") usage examples pendingchannels syntax lncli pendingchannels \[flags] description displays information about channels in various pending states those waiting for confirmations, in the process of closing, or with time locked funds key parameters \ include raw tx include raw transaction hex for waiting close channels usage example subscribechannelevents syntax lncli subscribechannelevents description creates a uni directional stream from server to client that sends real time updates about channel state changes essential for monitoring channel lifecycle events usage example on chain methods estimatefee syntax lncli estimatefee \[command options] send json string \[ conf target=n] description get fee estimates for sending bitcoin on chain to multiple addresses estimatefee asks the chain backend to estimate the fee rate and total fees for a transaction that pays to multiple specified outputs key parameters send json string json string encoding addresses and amounts '{"exampleaddr" numcoinsinsatoshis}' conf target number of blocks that the transaction should confirm in (optional) coin selection strategy strategy for selecting coins ('largest', 'random', or 'global config') usage example gettransactions (listchaintxns) syntax lncli listchaintxns \[command options] description returns a list describing all the known transactions relevant to the wallet lists transactions from the wallet including on chain transactions that pay to or are spends from lnd key parameters \ start height the block height from which to start listing transactions end height the block height up to which to list transactions (use 1 for unconfirmed only) account an optional filter to only include transactions relevant to an account usage examples newaddress syntax lncli newaddress \[address type] description generates a new address under control of the local wallet creates a new address for receiving on chain bitcoin payments key parameters (address types) p2wkh pay to witness pubkeyhash (native segwit, bech32) np2wkh nested pay to witness pubkeyhash (legacy segwit) p2tr pay to taproot (taproot addresses, bech32m) usage examples listunspent syntax lncli listunspent \[command options] description lists utxos available for spending returns a list of all unspent transaction outputs (utxos) that are under the control of the wallet key parameters \ min confs the minimum number of confirmations required for utxos (default 1) max confs the maximum number of confirmations for utxos account an optional filter to only include utxos from a specific account usage examples listaddresses note this command is not available in current lnd versions address generation is handled through newaddress and transaction history via listchaintxns sendcoins syntax lncli sendcoins \[command options] addr amt description sendcoins executes a request to send coins to a particular address unlike sendmany, this rpc call only allows creating a single output at a time key parameters \ addr the bitcoin address to send coins to amt the number of bitcoin denominated in satoshis to send conf target the number of blocks that the transaction should confirm in (optional) sat per vbyte manual fee rate in sat/vbyte (optional) send all send all wallet funds label a label for the transaction usage examples sendmany syntax lncli sendmany \[command options] send json string description sendmany handles a request for a transaction that creates multiple specified outputs in parallel allows creating a transaction with multiple outputs in a single transaction key parameters send json string json string encoding addresses and amounts '{"exampleaddr" numcoinsinsatoshis}' conf target number of blocks for confirmation (optional) sat per vbyte manual fee rate in sat/vbyte (optional) label a label for the transaction usage examples subscribetransactions note this is a streaming rpc with no direct cli command accessible via grpc/rest api for real time transaction notifications peer methods connect syntax lncli connect \[command options] \<pubkey>@host description connectpeer attempts to establish a connection to a remote peer this is at the networking level and is used for communication between nodes this is distinct from establishing a channel with a peer key parameters \<pubkey>@host target address in format "pubkey\@host\ port" perm if set, the daemon will attempt to persistently connect to the target peer usage examples disconnect syntax lncli disconnect \[command options] \<pubkey> description disconnectpeer attempts to disconnect one peer from another identified by a given pubkey in the case that there are pending or active channels with the target peer, this action will not be allowed key parameters \<pubkey> the hex encoded compressed public key of the peer to disconnect usage example listpeers syntax lncli listpeers description listpeers returns a verbose listing of all currently active peers shows detailed information about currently connected peers including their connection status and features usage example subscribepeerevents note this is a streaming rpc with no direct cli command accessible via grpc/rest api for real time peer online/offline events routing methods buildroute syntax lncli buildroute \[command options] \[arguments ] description builds a fully specified route based on a list of hop public keys retrieves relevant channel policies from the graph to calculate correct fees and time locks key parameters \ hops comma separated hex pubkeys defining the route path amt amount to send in satoshis final cltv delta blocks for last hop to reveal preimage outgoing chan id short channel id for first hop payment addr hex encoded payment address for last hop's mpp record usage examples estimateroutefee syntax lncli estimateroutefee \[command options] dest amt description allows callers to obtain a lower bound estimate of how much it may cost to send an htlc to a target destination key parameters dest destination node public key (bytes) amt sat amount in satoshis (int64) usage example sendtoroute syntax lncli sendtoroute \[command options] \[arguments ] description ⚠️ deprecated sends a payment over lightning using a specific pre defined route must specify the route and payment hash key parameters \ payment hash hash to use within payment's htlc routes json array string in queryroutes/buildroute response format usage example queryroutes syntax lncli queryroutes \[command options] dest amt description queries the channel router for potential payment paths to a destination node that have sufficient flow for the specified amount, including fees key parameters dest 33 byte hex encoded public key of payment destination amt amount to send in satoshis fee limit maximum fee allowed in satoshis fee limit percent percentage of payment amount used as max fee final cltv delta number of blocks last hop has to reveal preimage use mc use mission control probabilities for pathfinding usage examples describegraph syntax lncli describegraph \[command options] \[arguments ] description returns a description of the latest lightning network graph state from the node's perspective, including all nodes/vertices and edges (channels) connecting them key parameters \ include unannounced include unannounced channels (both private channels and unannounced public channels) include auth proof include announcement signatures in channeledge data usage examples hodl invoices addhodlinvoice syntax lncli addhodlinvoice \[options] \<hash> \[amount] description add a new hold invoice creates a hold invoice that ties the invoice to a hash supplied in the request unlike regular invoices, hodl invoices allow the receiver to delay settlement until they manually settle or cancel the invoice key parameters hash 32 byte hex encoded hash for the hodl invoice amount amount in satoshis (positional argument) memo description of the payment (optional) amt amount in satoshis (alternative to positional) expiry invoice expiry time in seconds (default 86400 seconds/24 hours) private include routing hints for private channels usage examples settleinvoice syntax lncli settleinvoice \[ preimage=\<preimage>] \<preimage> description reveal a preimage and use it to settle the corresponding hodl invoice this releases the held htlc and completes the payment key parameters preimage the hex encoded preimage (32 bytes) which will allow settling an incoming htlc usage examples global options all lncli commands support these global options \ rpcserver host\ port of ln daemon (default "localhost 10009") lnddir path to lnd's base directory (default " / lnd") tlscertpath path to tls certificate macaroonpath path to macaroon file no macaroons disable macaroon authentication network the network lnd is running on (mainnet/testnet/simnet) version compatibility notes commands documented are compatible with lnd versions 0 17 x and 0 18 x the cancelinvoice command was introduced in lnd v0 8 0 sendpayment is deprecated in favor of routerrpc sendpaymentv2 sendtoroute is deprecated and will be removed in future versions some parameter names and output formats may vary between versions always use lncli \<command> help to see version specific options