Electroneum CLI corrupted blockchain data repair guide

Windows

  1. Browse to the directory electroneumd is located.

  2. Open a new command prompt. This is done by first making sure your cursor isn’t located on any of the files and subsequently doing SHIFT + right click. It will give you an option to “Open command window here”. If you’re using Windows 10, it’ll likely give you an option to open the Powershell.

  3. Now type electroneumd.exe --db-salvage

  4. If you’re using the Powershell, type .\electroneumd --db-salvage

  5. If that doesn’t work, type ./electroneumd.exe --db-salvage

If that doesn’t work you, unfortunately, have to resync from scratch. This is done by deleting data.mdb from C:\ProgramData\electroneum\lmdb, which will trigger the resync upon launching electroneumd.

Note that C:\ProgramData\electroneum\lmdb is a hidden directory. Thus, you have to manually use the explorer to navigate to it.

Linux and Mac OS X

  1. Browse to the directory electroneumd is located.

  2. Open a new terminal.

  3. Now type ./electroneum --db-salvage

If that doesn’t work you, unfortunately, have to resync from scratch. This is done by deleting data.mdb from ~/.electroneum, which will trigger the resync upon launching electroneumd.

Note that ~/.electroneum is, by default, a hidden directory. On Mac OS X you can typically use cmd+shift+. to unhide directories, whereas on Linux you can typically use ctrl+H to unhide directories.

6 Likes

How often (or likely) does this happen?

I’ve only seen it happen when the system that it is running on turns off unexpectedly. (i.e. power failure)

2 Likes

Resyncing from scratch is not the only option. One can import the blockchain.raw with the electroneum-blockchain-import command, and then sync the remainder of whatever the latest blockchain.raw does not include. Much faster than syncing from scratch. Please refer to your earlier post for instructions - Importing the Blockchain to Electroneum CLI

3 Likes

Just like @dwayne mentioned, and also if you do not close your electroneumd and electroneum-cli properly, blockchain could be corrupt on next opening.

electroneum-cli -controls how wallet data is stored (if not closed properly, wallet data file could corrupt, which means balance, transactions etc will not show correctly)

electroneumd -synchronizes blockchain data (if not closed properly, blockchain data could corrupt)

Closing CLI instructions are in Remote Node guide.

1 Like

Yeah I haven’t read that but I always save the blockchain and then use exit.

1 Like