Skip to main content

Polkadot Runbook

Polkadot DB Clean up

Description: This runbook is to clean up Polkadot service DB if it is corrupted and not syncing.

Action:

  1. Stop the node

    docker stop <container>
  2. Delete the DB

     rm -R <dataDirPath>/chains/<ksmcc3|polkadot>/db -R
  3. Download the chaindata snapshot

    aria2c -x5 -o temp_file https://<ksm|dot>-rocksdb.polkashots.io/snapshot 
  4. Extract the snapshot into data directory

    lz4 -c -d temp_file | tar -x -C <DataDirPath>/chains/<ksmcc3|polkadot>/
  5. Check the db directory is created

    du -sh <DataDirPath>/chains/<ksmcc3|polkadot>/db
  6. Start the container and check the logs

    Docker logs <container>
  7. Check the node by searching the name on telemetry and comparing block number with the other public nodes.

    For Kusama: https://telemetry.polkadot.io/#/0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe

    For Polkadot: https://telemetry.polkadot.io/#list/0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3