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.
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 executionPrune the blockchain data
sudo -u execution geth --datadir /var/lib/geth 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 executionAfter 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/execution-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 executionservice. If your folder is a different name, please change the /mnt/execution-data accordingly.
sudo chown execution:execution /mnt/execution-datasudo chmod 755 /mnt/execution-dataStop your execution client.
sudo systemctl stop executionEdit the system service file to point to a new data directory.
sudo nano /etc/systemd/system/execution.serviceAt the end of this command starting with /usr/bin/geth --http --metrics .... add a space and the following flag --datadir "/mnt/execution-data".
Ctrl-X to save your settings.
Refresh the system service daemon to load the new configurations.
sudo systemctl daemon-reloadRestart the execution client.
sudo systemctl start executionMake sure it is up and running by viewing the running logs.
sudo journalctl -fu execution(Optional) Delete original data directory
sudo rm -r /var/lib/geth