> For the complete documentation index, see [llms.txt](https://agstakingco.gitbook.io/eth2main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agstakingco.gitbook.io/eth2main/eth1-geth.md).

# Geth - Execution Engine

### **Update the system:**

```
sudo apt update && sudo apt upgrade
```

### Update distro (Ubuntu) and autoremove:

```
sudo apt dist-upgrade && sudo apt autoremove
```

## Install Geth

1\) **Check latest version of Geth:**

{% hint style="info" %}
Find the most current update [here](https://github.com/ethereum/go-ethereum/releases).

This code in this guide is updated for v1.10.26 and current as of Jan 5, 2023.
{% endhint %}

**Install Curl**

```
sudo apt install curl
```

2\)  **Change to Home directory:**

```
cd ~
```

3\)  **Use curl to download latest version:**

```
curl -LO https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz
```

4\) **Extract, Copy, and Clean up:**

```
tar xvf geth-linux-amd64-1.11.2-73b01f40.tar.gz
cd geth-linux-amd64-1.11.2-73b01f40
sudo cp geth /usr/local/bin
cd ~
rm geth-linux-amd64-1.11.2-73b01f40.tar.gz
rm -r geth-linux-amd64-1.11.2-73b01f40

```

## Create service file to run Geth

### Create `geth` user:

```
sudo useradd --no-create-home --shell /bin/false geth
```

### Create `/geth` directory:

```
sudo mkdir -p /var/lib/geth
```

### Assign `goeth` permission to modify `/geth`:

```
sudo chown -R geth:geth /var/lib/geth
```

### Create `geth.service` :

```
sudo nano /etc/systemd/system/geth.service
```

### Paste the following into the file:

```
[Unit]
Description=Geth Execution Client (Mainnet)
After=network.target
Wants=network.target

[Service]
User=geth
Group=geth
Type=simple
Restart=always
RestartSec=5
TimeoutStopSec=600
ExecStart=/usr/local/bin/geth \
  --mainnet \
  --datadir /var/lib/geth \
  --authrpc.jwtsecret /var/lib/jwtsecret/jwt.hex
  
[Install]
WantedBy=default.target
```

{% hint style="info" %}
Use `Ctrl + X` to exit, `Y` to save, then `Enter` to confirm.
{% endhint %}

### Reload the daemon:

```
sudo systemctl daemon-reload
```

### Start `geth.service`:

```
sudo systemctl start geth
```

### Check `geth.service` output:

```
sudo journalctl -f -u geth.service
```

{% hint style="info" %}
This shows running journal entries created by `geth.service`. You can use `Ctrl + C` to close the window, but the program will continue running in the background.

Use `sudo systemctl stop geth` if you need to stop geth.service
{% endhint %}

The node will begin searching for peers, and eventually start downloading/verifying blocks.

### Geth Sync

{% hint style="danger" %}
**Geth data is currently \~875gb and may take \~24 hours to fully sync.**
{% endhint %}

![](/files/-Mf095qU3RDl2D48l93t)

{% hint style="info" %}
You can check your progress by comparing your block number in Geth to the current block at <https://etherscan.io/>
{% endhint %}

As you wait for the Eth1 node to sync, you can open a new terminal and install Lighthouse - Beacon Node.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://agstakingco.gitbook.io/eth2main/eth1-geth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
