Dealing with Storage Issues on the Execution Client
After running the execution client for a while, you will notice that it will start to fill up the hard disk. The following steps might be helpful for you.
Firstly make sure you have a fallback execution client: see 8.11 Strategy 2.
Reference: https://gist.github.com/yorickdowne/3323759b4cbf2022e191ab058a4276b2
You will need to upgrade Geth to at least 1.10x. Other prerequisites are a fully synced execution engine and that a snapshot has been created.
Stop your execution engine
sudo systemctl stop eth1Prune the blockchain data
geth --datadir ~/.ethereum snapshot prune-state🔥 Geth pruning Caveats:
Pruning can take a few hours or longer (typically 2 to 10 hours is common) depending on your node's disk performance.
There are three stages to pruning: iterating state snapshot, pruning state data and compacting database.
"Compacting database" will stop updating status and appear hung. Do not interrupt or restart this process. Typically after an hour, pruning status messages will reappear.
Restart execution engine
sudo systemctl start eth1After you have installed your hard disk, you will need to properly format it and automount it. Consult the ubuntu guides on this.
I will assume that the new disk has been mounted onto /mnt/eth1-data. (The name of the mount point is up to you)
Handling file permissions.
You need to change ownership of the folder to be accessible by your eth1 service. If your folder is a different name, please change the /mnt/eth1-data accordingly.
sudo chown $whoami:$whoami /mnt/eth1-datasudo chmod 755 /mnt/eth1-dataStop your Eth1 node.
sudo systemctl stop eth1Edit the system service file to point to a new data directory.
sudo nano /etc/systemd/system/eth1.serviceAt the end of this command starting with /usr/bin/geth --http --metrics .... add a space and the following flag --datadir "/mnt/eth1-data".
Ctrl-X to save your settings.
Refresh the system service daemon to load the new configurations.
sudo systemctl daemon-reloadRestart the Eth1 node.
sudo systemctl start eth1Make sure it is up and running by viewing the running logs.
journalctl -fu eth1(Optional) Delete original data directory
rm -r ~/.ethereumLast updated