Bash Script

You can create a basic Bash script to update Geth / Lighthouse

This script is for geth v1.11.15 and lighthouse v4.0.1

1) Open a new document in "Text Editor"

2) Paste the following text into the document:

#!/bin/bash

# Update Geth
# Step 1: Stop Geth
sudo systemctl stop geth

# Step 2: Change to Home directory
cd ~

# Step 3: Use curl to download latest version
curl -LO https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.5-a38f4108.tar.gz

# Step 4: Extract, Copy, and Clean up
tar xvf geth-linux-amd64-1.11.5-a38f4108.tar.gz
cd geth-linux-amd64-1.11.5-a38f4108 && sudo cp geth /usr/local/bin
cd ..
rm geth-linux-amd64-1.11.5-a38f4108.tar.gz
rm -r geth-linux-amd64-1.11.5-a38f4108

# Step 5: Start Geth
sudo systemctl start geth

# Update Lighthouse
# Step 1: Change directory to Home folder
cd ~

# Step 2: Download Lighthouse software
curl -LO https://github.com/sigp/lighthouse/releases/download/v4.0.1/lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz

# Step 3: Stop Lighthouse services
sudo systemctl stop lighthousevalidator
sudo systemctl stop lighthousebeacon

# Step 4: Extract, Copy, and Clean up
tar xvf lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
sudo cp lighthouse /usr/local/bin
rm lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
rm lighthouse

# Step 5: Start Lighthouse services
sudo systemctl start lighthousebeacon
sudo systemctl start lighthousevalidator

# Print the version of Lighthouse
lighthouse_version=$(lighthouse --version)
echo "LIGHTHOUSE VERSION: "
echo "$lighthouse_version"

# Print the version of Geth
geth_version=$(geth --version)
echo "GETH VERSION: "
echo "$geth_version"

3) Save the file (ctrl+s) in your Documents folder as update.sh

Be sure to save the file in your Documents folder

4) Open a new terminal with (ctrl+shift+t)

5) Change to Documents directory:

cd ~/Documents

6) Make the script executable:

chmod +x update.sh

7) Run the update script:

./update.sh

You should see the updated versions printed in the terminal:

That's it, Geth and Lighthouse are now ready for the Shanghai fork on April 12, 2023

Last updated