How to purge chain database

Got an error when launching a full node back and forth on Kusama and Westend network, thought they sync to different databases.

My command:
./polkadot --chain=westend --pruning archive

Got error:
2021-04-06 18:14:09 :chains: Native runtime: westend-50 (parity-westend-0.tx5.au2)
Error:
0: State Database error: Expected pruning mode: constrained

The database it points at Database: RocksDb at ~/.local/share/polkadot/chains/westend2/db

I tried to purge the database by
./polkadot purge-chain

Still getting the same error.

Idea?

1 Like

Follow up to my question. By trial and error, I solve the problem. Well, it’s rather simple. To purge the database of specific network, you just have to specify the name of the chain. In my case, to purge the Westend database that was messed up for whatever reason, run
./polkadot purge-chain --chain=westend

1 Like