Running Bitcoind in Pruning Mode: A Guide
In the world of cryptocurrency and blockchain development, running multiple nodes on a single computer can be beneficial for several reasons, such as increased security and faster transaction processing times. However, this also means that older blocks are being discarded, leaving less data available to users like you.
One way to mitigate these issues is through pruning mode, which allows you to run only the necessary information from each block on your local machine, discarding most of what’s stored elsewhere. In this article, we’ll walk through a step-by-step guide on how to install and configure Bitcoind in pruning mode.
Why Prune Your Bitcoind?
Before diving into the process, let’s quickly discuss why you might want to run your Bitcoind in pruning mode:
: By discarding older blocks, you reduce the attack surface for potential security vulnerabilities.
: Running a full node can be slower than running a pruning node, which is optimized for performance.
Pruning Bitcoind: A Step-by-Step Guide
config.json
file in the pruning node’s root directory.Here are some example configuration options:
prune.minblock
: The minimum block number to keep. Set it to a lower value if you want more data stored on your local machine.prune.maxblock
: The maximum block number to keep. Set this high enough to ensure the pruning process is efficient but not so high that it takes too long to complete.{
"prune": {
"minblock": 100000, // Keep at least the first 10 million blocks
"maxblock": 2000000 // Keep up to 2 million blocks
}
}
./node.sh
. Make sure you’re in the directory where your pruning node software is installed../node.sh -f config.json
prune
command instead of the normal bitcoind
command../node.sh -c prune -f config.json
Troubleshooting Tips
By following these steps and adjusting the pruning settings according to your needs, you can effectively run Bitcoind in pruning mode. Remember to regularly update your configuration and test your setup before deploying it on a live network.
Conclusion
Pruning Bitcoind is an excellent way to balance security, performance, and storage space requirements. By following these steps and adjusting the settings according to your specific use case, you can optimize your pruning node for optimal results.