From e0b6bb3ec8c698fe90218b61644b76788f470fa5 Mon Sep 17 00:00:00 2001 From: yito88 Date: Thu, 2 Jan 2025 11:17:45 +0100 Subject: [PATCH 1/2] add cometprune guide --- .../docs/pages/operators/ledger/_meta.json | 5 ++-- .../ledger/pruning-cometbft-blocks.mdx | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx 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 From 6e7db9b2cdc4b078d6ee1acfea8be66e1d0d0b98 Mon Sep 17 00:00:00 2001 From: brentstone Date: Thu, 2 Jan 2025 15:54:23 -0800 Subject: [PATCH 2/2] small edits --- .../pages/operators/ledger/pruning-cometbft-blocks.mdx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx b/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx index f08b7c1b..d7dcc5c8 100644 --- a/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx +++ b/packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx @@ -4,7 +4,8 @@ import { Callout } from 'nextra-theme-docs' 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`. +The tool [CometPrune](https://github.com/ekhvalov/cometprune) 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](https://github.com/ekhvalov/cometprune/releases) @@ -21,10 +22,12 @@ go install 2. Prune the blocks ```shell copy -cometprune --path ${BASE_DIR}/${CHAIN_ID}/cometbft/data --keep-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. The tool will reject to delete all blocks, i.e. `--keep-blocks 0` doesn't work. +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. 3. Restart the node