Skip to content

Instantly share code, notes, and snippets.

@lewdeusdev
Last active June 5, 2024 14:11
Show Gist options
  • Save lewdeusdev/3c4268950605ff4cbfb6d9d01749ad6f to your computer and use it in GitHub Desktop.
Save lewdeusdev/3c4268950605ff4cbfb6d9d01749ad6f to your computer and use it in GitHub Desktop.
Cosmd Prune for Initia Testnet

Cosmprund

Summary

cosmprund is a tool designed to prune a Tendermint database of blocks and a Cosmos-SDK application database of all but the last X versions.

This helps users avoid the need to state sync every few days.

While it currently supports a subset of modules, it effectively prunes the default SDK module and the Osmosis added module.

Note that due to inefficiencies in IAVL and the simple approach of this tool, pruning large nodes can take a significant amount of time. The team is working on integrating this functionality natively into the Cosmos-SDK and Tendermint.

Install

git clone https://github.com/binaryholdings/cosmprund.git
cd cosmprund
git reset --hard d3bf3d8
make build

Check space before

sudo du -ah --block-size=1G / 2>/dev/null | sort -rh | head -n 20

Prune node

# Stop node
sudo systemctl stop initiad

# Prune
./build/cosmprund prune ~/.initia/data

# Restart node
sudo systemctl restart initiad
sudo journalctl -u initiad -f --no-hostname -o cat

Check space after

sudo du -ah --block-size=1G / 2>/dev/null | sort -rh | head -n 20

Notes

  • Initia is not officially supported yet so this will not prune your application.db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment