Lighthouse: There's no way to purge the database

Created on 24 Jan 2020  路  6Comments  路  Source: sigp/lighthouse

Description

I end up in some sort of bad loop where lighthouse could no longer sync blocks, so I wanted to purge the db and have it re-download everything to get past that.

Present Behaviour

There is no command to do so however.

Expected Behaviour

Something like lighthouse beacon purge-db or lighthouse purge beacon db, etc.

Steps to resolve

Add such a command

enhancement good first issue

Most helpful comment

Unfortunately, this deletes the network key and enr.db. Usually you only want to purge the
Unfortunately, there is no way to recover from that besides removing the entire beacon directory including the keys.

There will be if my PR from 2 days ago gets merged ;)

All 6 comments

As a temporary current work-around users can delete the datadir, default ~/.lighthouse/beacon

I'll take a look at this :)

As a temporary current work-around users can delete the datadir, default ~/.lighthouse/beacon

Unfortunately, this deletes the network key and enr.db. Usually you only want to purge the beacon chain database without touching any keys. I tried manually removing the chain and freezer db, but I'll get:

Failed to start Lighthouse: Failed to start beacon node: No database found in datadir. Please make sure the directory provided is valid, or specify a different `--datadir`.

Unfortunately, there is no way to recover from that besides removing the entire beacon directory including the keys.

Unfortunately, this deletes the network key and enr.db. Usually you only want to purge the
Unfortunately, there is no way to recover from that besides removing the entire beacon directory including the keys.

There will be if my PR from 2 days ago gets merged ;)

Unfortunately, there is no way to recover from that besides removing the entire beacon directory including the keys.

This is true, but for the record you can backup the network directory and then replace it after a new datadir has been created. Not an ideal workaround, but just making it known :)

This issue was fixed by #971 so we can close this :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jrhea picture jrhea  路  4Comments

paulhauner picture paulhauner  路  4Comments

nickoneill picture nickoneill  路  3Comments

michaelsproul picture michaelsproul  路  4Comments

q9f picture q9f  路  4Comments