Difference between revisions of "Balancing channels"

From lightningwiki.net
Jump to: navigation, search
 
Line 5: Line 5:
  
 
= Script =
 
= Script =
 +
* In newer versions (LND) you can do: <pre>read -p source-channel-with-local-balance:\  source; read -p peer-pubkey:\  peer; read -p sats: sats; lncli addinvoice --amt $sats; read -p invoice:\  invoice; lncli payinvoice --allow_self_payment --outgoing_chan_id $source --last_hop $peer $invoice</pre>
 
* There is a script to rebalance a LND channel: [[Rebalance-lnd]]
 
* There is a script to rebalance a LND channel: [[Rebalance-lnd]]
 
* Testnet currently: [https://lntoolkit.com/commands/auto-balance lntoolkit]
 
* Testnet currently: [https://lntoolkit.com/commands/auto-balance lntoolkit]
 
* lndmanage (tool for advanced lnd node administration): https://github.com/bitromortac/lndmanage
 
* lndmanage (tool for advanced lnd node administration): https://github.com/bitromortac/lndmanage

Latest revision as of 13:36, 10 February 2020

A channel always has two sides. A local and a remote side. It could be someone opened a channel TO you. That would mean from your perspective there is 0 local balance, and all the balance is remote. That remote balance is the amount the channel was opened with, paid by the peer. This channel can now be used to pay TO you. Because there is remote balance. Now, if you have local balance, this channel could also be used to pay FROM your node TO the peer. (re)Balancing a channel levels the local and remote balance.

Having more balanced channels will help routing payments which will earn you more fees.

Script[edit]

  • In newer versions (LND) you can do:
    read -p source-channel-with-local-balance:\  source; read -p peer-pubkey:\  peer; read -p sats: sats; lncli addinvoice --amt $sats; read -p invoice:\  invoice; lncli payinvoice --allow_self_payment --outgoing_chan_id $source --last_hop $peer $invoice
  • There is a script to rebalance a LND channel: Rebalance-lnd
  • Testnet currently: lntoolkit
  • lndmanage (tool for advanced lnd node administration): https://github.com/bitromortac/lndmanage