diff --git a/packages/docs/pages/operators/ledger/_meta.json b/packages/docs/pages/operators/ledger/_meta.json index 6f561925..2e72b7cc 100644 --- a/packages/docs/pages/operators/ledger/_meta.json +++ b/packages/docs/pages/operators/ledger/_meta.json @@ -2,5 +2,6 @@ "env-vars": "Node Configuration", "running-a-full-node": "Full node step-by-step", "logging-config": "Logging configurations", - "base-directory": "Base directory" -} \ No newline at end of file + "base-directory": "Base directory", + "pruning-cometbft-blocks": "Pruning CometBFT blocks" +} diff --git a/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx b/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx new file mode 100644 index 00000000..f08b7c1b --- /dev/null +++ b/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx @@ -0,0 +1,30 @@ +import { Callout } from 'nextra-theme-docs' + +# Pruning CometBFT blocks + +The size of the CometBFT directory will grow with validator signatures, transactions, etc. + +The tool [CometPrune](https://github.com/ekhvalov/cometprune) can prune old blocks from your CometBFT directory. It reduces only the CometBFT data `${BASE_DIR}/${CHAIN_ID}/cometbft`, doesn't affect Namada's storage data `${BASE_DIR}/${CHAIN_ID}/db`. + +### Install CometPrune +- Download the binary from [the release page](https://github.com/ekhvalov/cometprune/releases) + +- Or, build from the source +```shell copy +git clone git@github.com:ekhvalov/cometprune.git +cd cometprune +go install +``` + +### Prune the blocks +1. Stop the node + +2. Prune the blocks +```shell copy +cometprune --path ${BASE_DIR}/${CHAIN_ID}/cometbft/data --keep-blocks +``` + +Leaving the last one block (`--keep-blocks 1`) is enough to restart the node. The tool will reject to delete all blocks, i.e. `--keep-blocks 0` doesn't work. + + +3. Restart the node