-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from anoma/yuji/prune-tm-blocks
CometPrune guide to prune CometBFT blocks
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 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) | ||
|
||
- Or, build from the source | ||
```shell copy | ||
git clone [email protected]: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 $BLOCKS_TO_KEEP | ||
``` | ||
where the most recent `$BLOCKS_TO_KEEP` will be retained. | ||
|
||
<Callout> | ||
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. | ||
</Callout> | ||
|
||
3. Restart the node |