How to Run Lightning in Pruning Mode with LND: A Guide
As a user of the Lightning Network (LN) running on a full node, you are likely aware of the limitations imposed by traditional Bitcoin-based nodes. One of these limitations is pruning, which significantly reduces the complexity and costs associated with validating transactions. In this article, we will explore how to run Lightning in pruning mode using the LND implementation.
What is Pruning Mode?
Pruning mode, also known as “pruning,” is a technique used to reduce the amount of data that needs to be stored on a node, making it more efficient and cost-effective. By pruning transactions, nodes can skip redundant or unnecessary data such as transaction IDs, block hashes, and fees. This approach allows for faster validation times, lower maintenance costs, and increased security.
LND Pruning Mode
LND is a popular Lightning Network implementation that supports pruning mode out of the box. In fact, LND was designed with pruning in mind from the start. To run LND in pruning mode, follow these steps:
Update your node: Make sure you are running the latest version of LND. You can check for updates by visiting the [LND GitHub page]( and following the instructions for updating the node software.
Create a new wallet
: Create a new wallet using the--pruneflag when installing LND. This will allow you to specify pruning mode when creating your wallet.
Example Usage
Here is an example of how to create a new wallet with LND in pruning mode:
`pound
lnd --wallet-dir ./lightning-wallet-prune --prune 1000000 --prune-type=block --prune-fee 2.5
--wallet-dirIn this command:
specifies the directory where you want to create your wallet.--pruneenables pruning mode and sets a maximum number of transactions to store (in this case, 1 million).--prune-type=blockspecifies that only block-level data should be pruned.--prune-feeis the fee in satoshis per transaction that LND will charge when validating transactions.
Full node pruningTo prune all Lightning channels on your full node, you can use the following command:
blowlnd --wallet-dir ./lightning-wallet-prune --prune 1000000 --prune-type=channel
This command will remove all channel-level data from your full node.
Conclusion
Running Lightning in pruning mode with LND is a powerful way to optimize your network performance and reduce costs. By following these steps, you will be able to easily enable pruning mode when creating new wallets or modifying existing ones. Remember to check out the [LND documentation]( for more information on LND-specific commands and options.
Tips and Variations
- To prune data from a specific wallet directory, use the --wallet-dir
option with the prune flag.
- You can also specify a custom pruning threshold using the--prune-threshold
option. For example:lnd --wallet-dir ./lightning-wallet-prune --prune 50000 --prune-type=channel
- To disable pruning for specific transactions, use the--tx-included
flag with the prune type. For example:lnd --wallet-dir ./lightning-wallet-prune --prune 1000000 --tx-included block`
By following these guidelines and experimenting with different options, you'll be able to run Lightning efficiently on your LND deployment and enjoy improved network performance.
