# DAEMON A GUI

Čas od času se objeví uživatelský problém, že po zapnutí GUI nejede daemon nezbytný pro provozování vlastního blockchainu kryptoměny Monero. Zde je návod a postup jak situaci řešit.

Nejdříve je třeba zjistit zda není verze vašeho současného blockchainu znehodnocena třeba tvrdým odpojením za chodu např. výpadek elektrického proudu nebo režim spánku. Pokud chcete vypnout osobní počítač je nutno řádně ukončit Monerod. Když se dostaneme do takové situace je třeba databázi obnovit.

Je-li vpořádku postupujeme následovně:

[1] Exit the GUI.

[2] Browse to the directory monerod is located. On Windows and Linux this is the same directory as monero-wallet-gui, whereas on Mac OS X monerod is located in ~/Applications/monero-wallet-gui.app/Contents/MacOS | Note that if you cannot find monerod, it could be that your AV (AntiVirus) has quarantined it. In case this occurred, I'd advise to either put it back in the original folder / directory and create an exception or re-extract the binaries (the .zip file (Windows) or the tar.bz2 file (Mac OS X and Linux)) to a new folder / directory (for which an exception is created).

[3] Open monerod manually by double clicking on it (Windows and Mac OS X) or from the terminal with ./monerod (Linux).

[4] It'll likely shut down itself quickly. If that happens, proceed with the guide.

[5] If it doesn't shut down itself, type status a few times to check whether it's fetching any new blocks. If it isn't, proceed with the guide. It it fetches new blocks, however, it's not corrupted and the GUI was simply unable to start the daemon. Try restarting monero-wallet-gui. It should automatically connect to the daemon that's already running.

[6] Browse to C:\ProgramData\bitmonero (Windows) or ~/.bitmonero (Linux and Mac OS X).

[7] Note that, by default, both C:\ProgramData\bitmonero and ~/.bitmonero are hidden directories.

[8a] On Windows, you have to use the explorer to manually navigate to C:\ProgramData\bitmonero

[8b] On Mac OS X, you can typically use cmd+shift+. to unhide directories.

[8c] On Linux, you can typically use ctrl+H to unhide directories.

[9] Now open bitmonero.log

[10] If your log contains this line or something similar, the blockchain is corrupted:

Failed to query m_blocks: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid

[11] We'll first attempt to fix this before performing a resync from scratch.

[12] Again browse to the directory monerod is located.

[13a] On Windows, open a new command prompt from the same directory as monerod.exe. 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, most likely, give you an option to open the Powershell.

[13b] On Linux and Mac OS X, open a new terminal from the same directory as monerod

[14a] On Windows, type the following command in the command prompt:

monerod.exe --db-salvage

If that doesn't work in the Powershell, type:

.\monerod.exe --db-salvage

If that doesn't work either in the Powershell, type:

./monerod.exe --db-salvage

[14b] On Linux and Mac OS X, type the following command in the terminal:

./monerod --db-salvage

[15] If you were using a non-default directory for the blockchain, you have to add the --data-dir flag too if you start monerod separately. If you already have monerod running, type exit first to gracefully stop the daemon. This is done as follows:

On Windows, type the following command in the command prompt:

monerod.exe --db-salvage --data-dir path\to\your\blockchain

If that doesn't work in the Powershell, type:

.\monerod.exe --db-salvage --data-dir path\to\your\blockchain

If that doesn't work either in the Powershell, type:

./monerod.exe --db-salvage --data-dir path\to\your\blockchain

On Linux and Mac OS X, type the following command in the terminal:

./monerod --db-salvage --data-dir path/to/your/blockchain

[16] If that doesn't work you, unfortunately, have to resync from scratch. This is done by deleting data.mdb from C:\ProgramData\bitmonero or ~/.bitmonero (Linux and Mac OS X), which will trigger the resync.

Zdroj dEBRUYNE