Skip to main content

11.7 Reset Blockchain State

When updating or switching execution clients, incompatibilities may arise with the existing blockchain state. These errors often occur due to changes in the client’s internal database structure, chain data corruption, or leftover logs. Resetting the blockchain state can resolve sync issues, failed starts, and client crashes by reinitializing a clean local environment.

info

The following steps are performed on your 📟 node server.

1. Stop Node Operation

Depending on your setup method, there are different ways to stop your node before applying updates.

cd <lukso-working-directory>
lukso stop
info

Exchange <lukso-working-directory> with the path of the node folder.

Force Client Shutdown
sudo pkill geth

2. Remove Blockchain Data

# Move into Node Directory
cd <lukso-working-directory>

# Remove Blockchain Data
rm -rf <network>-data

# Remove Logs
rm -rf <network>-logs

# Initialize the Folder
sudo lukso init
tip

The lukso init command only adds missing files within the /configs/ folder without overwriting existing ones.

info

Exchange <lukso-working-directory> and <network> with the path of the node folder and the configured network.

3. Restart the Node

Depending on your setup method, there are different ways to start your node after the blockchain state was cleared.

cd <lukso-working-directory>
lukso start --checkpoint-sync
info

Exchange <lukso-working-directory> with the path of the node folder.

After the clients were started, verify that their services are still up.

sudo lukso status
warning