Pruning CometBFT blocks
The size of the CometBFT directory will grow with validator signatures, transactions, etc.
The tool CometPrune (opens in a new tab) can prune old blocks from your CometBFT directory.
It reduces only the CometBFT data in ${BASE_DIR}/${CHAIN_ID}/cometbft
and does not affect Namada's storage data in ${BASE_DIR}/${CHAIN_ID}/db
.
Install CometPrune
-
Download the binary from the release page (opens in a new tab)
-
Or, build from the source
git clone [email protected]:ekhvalov/cometprune.git
cd cometprune
go install
Prune the blocks
-
Stop the node
-
Prune the blocks
cometprune --path ${BASE_DIR}/${CHAIN_ID}/cometbft/data --keep-blocks $BLOCKS_TO_KEEP
where the most recent $BLOCKS_TO_KEEP
will be retained.
💡
Leaving the last one block (--keep-blocks 1
) is enough to restart the node successfully. The tool will reject to delete all blocks, i.e. --keep-blocks 0
doesn't work.
- Restart the node