Geth

Installing and configuring Go-Ethereum as a systemd service.

Geth (Go-Ethereum)

Geth is the official Golang implementation of the Ethereum protocol. It is the most widely used client due to its stability, extensive documentation, and tooling support.


🛡️ Role: Geth will connect to the peer-to-peer network to download block data and execute transactions. It will expose an Engine API that allows the Consensus Client (Step 4) to control it.


1. Install Geth

We recommended installing Geth via the official Personal Package Archive (PPA). This ensures you can easily update the node with a simple apt update in the future.

# 1. Enable the PPA
sudo add-apt-repository -y ppa:ethereum/ethereum

# 2. Update package lists
sudo apt update

# 3. Install Geth
sudo apt install -y geth

# 4. Verify installation
geth version

2. Configure Systemd Service

We will run Geth as a background service using systemd. This ensures the node starts automatically on reboot and runs as the dedicated ethereum user we created in Step 2.

Create the service file:

Paste the following configuration:

🔍 Flag Explanation:

  • --datadir: Points to the folder we created in Step 2.

  • --authrpc.jwtsecret: The critical token allowing the Consensus Client to talk to Geth.

  • --http: Enables the JSON-RPC API (for your dApps or wallets).

  • --http.addr 0.0.0.0: Listens on all interfaces (Safe because we configured UFW Firewall in Step 2).

  • --http.api eth,net,admin: The Engine API is not included here — it runs automatically over the authenticated RPC port (--authrpc.*) and should not be exposed on the public HTTP interface.

  • --state.scheme path: Uses path-based storage, which is the recommended scheme for better performance and proper pruning support.


3. Start the Service

Reload the systemd daemon to read the new file, then enable and start Geth.


4. Verify Status

Geth should now be running. However, it will not start syncing properly yet because it is waiting for a Consensus Client (Step 4) to tell it what the "head" of the chain is.

Check the logs to ensure it started correctly:

Expected Output: You should see logs indicating:

  • Starting Geth on Ethereum mainnet...

  • UDP listener up (P2P Networking active)

⚠️ Warning: You might see Post-merge network, but no beacon client seen. This is normal until we complete Step 4.

Last updated