Skip to content

Commit

Permalink
add cometprune guide
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Jan 2, 2025
1 parent 0e9451d commit e0b6bb3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/docs/pages/operators/ledger/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
"base-directory": "Base directory",
"pruning-cometbft-blocks": "Pruning CometBFT blocks"
}
30 changes: 30 additions & 0 deletions packages/docs/pages/operators/ledger/pruning-cometbft-blocks.mdx
Original file line number Diff line number Diff line change
@@ -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 [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 <amount of blocks to keep>
```
<Callout>
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.
</Callout>

3. Restart the node

0 comments on commit e0b6bb3

Please sign in to comment.