How to save disk space
Clean up and disable the CometBFT indexer
Suitable for: data node
Downtime required: up to 2 min
How to check if you really need it
To check if you need to clean the transactions index for CometBFT (formerly Tendermint), navigate to the COMETBFT_HOME/data
and see how big are files there:
# cd COMETBFT_HOME/data
# du -sh ./*
du -sh ./*
59G ./blockstore.db
215M ./cs.wal
18K ./evidence.db
512 ./priv_validator_state.json
265M ./state.db
61G ./tx_index.db
In the above scenario, we could save about 61 GB of the storage on our server.
Cleanup instructions
- Stop the node:
sudo systemctl stop vegavisor
- Open the CometBFT config (
COMETBFT_HOME/config/config.toml
) and disable thetx_indexer.indexer
by setting it tonull
[tx_index]
indexer = "null"
- Navigate to
COMETBFT_HOME/data
and renametx_index.db
to something else. This step allows you to easily recover if something goes wrong.
# cd COMETBFT_HOME/data
# mv tx_index.db tx_index.db.tmp
- Create the empty
tx_index.db
directory in theCOMETBFT_HOME/data
# cd COMETBFT_HOME/data
# mkdir tx_index.db
- Start your node and make sure everything is fine
- Remove big directory created in the step 3.
# cd COMETBFT_HOME/data
# rm -r tx_index.db.tmp