Recover Wallet on node after running out of disk space
I hope you are all enjoying this upward trajectory that Horizen is going, I know I am.
This post is to help those who run out of disk space and when they start their zend daemon after adding more space they see 0 zen in challenge addresses. This is because the original wallet.dat may have been corrupted.
To check this, you can run
ls -la ~/.zen and if you see wallet.xxxxxx.bak where xxxxxx is a number then the wallet.dat previously used may have been corrupted.
What you can do is try to recover the original wallet.dat using the following:
1) Stop the zend daemon and tracker using
sudo systemctl stop zend zentracker
and confirm that the daemon is down using
ps aux | grep zend | grep -v grep if nothing comes up move onto step2.
2) Back up the wallet.dat that is currently in the ~/.zen directory using
mv ~/.zen/wallet.dat ~/.zen/wallet.dat.backup1
3) Next we copy the .bak file to try and recover
cp ~/.zen/wallet.xxxxxx.bak ~/.zen/wallet.dat
4) Next we need to run zend with the rescan parameter
zend -rescan This process may take some time, so please have some patience. You can check the status using
zen-cli getinfo and once it no longer says rescanning or if the output is the standard output then run
5) If you see your balance there, you can run
zen-cli stop && sleep 4 && sudo systemctl start zend zentracker to the restart the zend daemon and tracker using the systemd process
If you dont recan the wallet after copying over the .bak file the zend daemon will report that the wallet.dat is corrupt and move it again to a new .bak file
Hopefully with this quick guide if your node runs out of space and wallet.dat becomes corrupt this process should help you recover it.
If you have any further questions or queries please post them below or hit me up on discord.
Have a great day