Start the service and check it's working as expected.
Erigon - Command Aliases
daemon-reload # Reload any changes made to the erigon.service
erigon-enable # Enable the erigon.service
erigon-start # Start the erigon.service
erigon-status # View the status of the erigon.service
erigon-log # View the erigon.service logs
Erigon - Update Scripts
Create Erigon update script.
vim ~/erigon-update.sh
~/erigon-update.sh
#!/bin/bash
set -e
while true; do
read -p "Are you sure you want to update Erigon? (Y/N) " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer Y or N.";;
esac
done
cd ~/erigon
read -p "Enter the commit hash you want to checkout: " commit_hash
git fetch
git checkout $commit_hash
echo
echo "****************"
echo "Making Erigon..."
echo "****************"
make erigon
# Check if erigon.service is running
service_was_running=0
if sudo systemctl is-active --quiet erigon.service; then
service_was_running=1
echo "******************"
echo "Stopping Erigon..."
sudo systemctl stop erigon.service
fi
echo "Replacing previous version..."
sudo rm -rf /usr/local/bin/erigon
sudo cp ~/erigon/build/bin/erigon /usr/local/bin
# Only start erigon.service if it was running originally
if [ $service_was_running -eq 1 ]; then
echo "Restarting Erigon..."
echo "********************"
sudo systemctl start erigon.service
fi