4 releases (breaking)

0.4.0 Feb 5, 2025
0.3.1 Jan 22, 2025
0.2.0 Jan 10, 2025
0.1.0 Sep 18, 2024

#870 in Magic Beans

Download history 4/week @ 2024-11-27 36/week @ 2024-12-04 24/week @ 2024-12-11 11/week @ 2024-12-18 8/week @ 2024-12-25 9/week @ 2025-01-01 144/week @ 2025-01-08 9/week @ 2025-01-15 128/week @ 2025-01-22 3/week @ 2025-01-29 152/week @ 2025-02-05

298 downloads per month

GPL-3.0 license

340KB
1K SLoC

polkadot-du

Investigate storage size of Substrate chains.

Install with:

cargo install polkadot-du --locked
pdu --help

Example: Info

First acquire a state snapshot. We are going to use the People Rococo chain, since it is rather small. You will need the try-runtime-cli for this and a full or archive node to download the state from:

try-runtime create-snapshot --uri wss://sys.ibp.network:443/statemint ah-polkadot.snap

Then run the analysis:

cargo run -r -- info --snap ah-polkadot.snap --rpc wss://sys.ibp.network:443/statemint

The results will be a bit boring for such a small network, but for a larger one - eg Kusama - it could look like this. The results will also be written into a JSON file named kusama_storage.json. You can download this snapshot to try it.

Kusama storage analysis

You can also zoom in on a specific pallet:

cargo run -r -- info --snap ah-polkadot.snap --rpc wss://sys.ibp.network:443/statemint --pallet System

Again for Kusama:

Kusama Balances pallet

Example: Grep

Search for an SS58 account address across the storage snapshot:

pdu grep --snap ../runtimes/polkadot.snap --rpc wss://sys.ibp.network:443/statemint address "15kr2dkeJQuCAfBQqZjnPeqmoMTWarRMxAGWPnfSmWdaVcbi"

Example: Grep Parachain Sovereign Account

Search for the sovereign account of parachain 2034 (Hydration) in a Relay chain snapshot:

pdu grep --snap polkadot.snap --rpc wss://try-runtime.polkadot.io:443 para-account child 2034

License

GPLv3 ONLY, see LICENSE file for details.

License: GPL-3.0

Dependencies

~98–140MB
~2.5M SLoC