> For the complete documentation index, see [llms.txt](https://agstakingco.gitbook.io/eth-2-0-staking-guide-prater-lighthouse/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/eth-2-0-staking-guide-prater-lighthouse/eth-2.0-beacon-node.md).

# ETH 2.0 - Beacon Node

## Eth 2.0 Clients

There are multiple Eth2 clients with working implementations. This guide will focus on installing Lighthouse, but be sure to research the other clients and promote Eth2 client diversity.

|            | [Lighthouse](https://lighthouse-book.sigmaprime.io/installation.html) | [Teku](https://docs.teku.pegasys.tech/en/latest/HowTo/Get-Started/Build-From-Source/) | [Prysm](https://docs.prylabs.network/docs/testnet/medalla/) | [Nimbus](https://status-im.github.io/nimbus-eth2/) |
| ---------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------------- |
| *Dev Team* | Sigma Prime                                                           | Consensys                                                                             | Prysmatic Labs                                              | Status                                             |
| *Focus*    | Speed, security                                                       | Enterprise                                                                            | Usability, reliability                                      | Lightweight                                        |
| *Language* | Rust                                                                  | Java                                                                                  | Go                                                          | Nim                                                |

## Eth2 || Beacon Node || Installation

### **Install Rust:**

{% hint style="info" %}
If you don't already have `curl` installed, you'll need to use:

```
sudo apt install curl
```

{% endhint %}

```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

{% hint style="info" %}
**NOTE**: The installation will stop half way through. Press `1`  then`Enter` to finish installation
{% endhint %}

### **Install other required  packages:**

```
sudo apt install -y git gcc g++ make cmake pkg-config libssl-dev
```

### **Change directory to `/home`:**

```
cd ~
```

### Clone Lighthouse repository using `git`:

```
git clone https://github.com/sigp/lighthouse.git
```

{% hint style="danger" %}

### Log Out / Log In

Rust modifies the PATH variable, so you need to log out and back in to prevent a `command not found` error during the next step.
{% endhint %}

### **After logging back in, enter Lighthouse directory:**

```
cd ~/lighthouse
```

### **Use make to compile the binary:**

```
make
```

{% hint style="info" %}
Depending on hardware, this may take \~15 minutes. Good time for a break.

If you encounter any errors while compiling, head to the [Ligthouse Discord](https://discord.gg/cyAszAh). The developers of Lighthouse are very knowledgeable and always happy to help!
{% endhint %}

## Eth2 || Beacon Node || Systemd File

### Create  `lighthousebeacon` user:

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

### Create `/lighthouse/beacon` directory:

```
sudo mkdir -p /var/lib/lighthouse/beacon
```

### Change ownership of `/lighthouse/beacon` :

```
sudo chown -R lighthousebeacon:lighthousebeacon /var/lib/lighthouse/beacon
```

### Copy Lighthouse binaries into `/usr/local/bin`:

```
sudo cp /$HOME/.cargo/bin/lighthouse /usr/local/bin
```

### Create `lighthousebeacon.service`:

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

### Paste the following into the file:

`[Unit]`\
`Description=Lighthouse Beacon Node`\
`Wants=network-online.target`\
`After=network-online.target`\
\
`[Service]`\
`Type=simple`\
`User=lighthousebeacon`\
`Group=lighthousebeacon`\
`Restart=always`\
`RestartSec=5`\
`ExecStart=/usr/local/bin/lighthouse beacon_node --datadir /var/lib/lighthouse --network prater --staking --eth1-endpoints http://127.0.0.1:8545`\
\
`[Install]`\
`WantedBy=multi-user.target`

### The file should look like this:

![](https://3900395349-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mca1oBmcey-0r7KGQhR%2F-Mca7Eje8OZ-CPN31U7E%2F-Mca8ae3i8xFU38_fWPE%2Fimage.png?alt=media\&token=392792a9-cfc5-4861-94cf-db79959635ed)

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

Below is a description of the command found in the "ExecStart" line:

* `/usr/local/bin/lighthouse beacon_node` - starts the beacon\_node
* `--datadir /var/lib/lighthouse/beacon-node` - data directory for Eth2 beacon node
* `--network prater` - connect to prater testnet
* `--staking` - enables the HTTP server for validator communication
* `--eth1-endpoints http://127.0.0.1:8545` - Location of ETH1 node

### Reload the system daemon:

```
sudo systemctl daemon-reload
```

## Eth2 || Beacon || Run

### Start `lighthousebeacon.service`:

```
sudo systemctl start lighthousebeacon
```

### Check `lighthousebeacon.service` output:

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

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

Use `sudo systemctl stop lighthousebeacon` if you'd like to stop the service.
{% endhint %}

## Eth 2.0 || Beacon Node || Sync

![](https://3900395349-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mca1oBmcey-0r7KGQhR%2F-Mca7Eje8OZ-CPN31U7E%2F-McaA-ouMxfRmpQkkeac%2Fimage.png?alt=media\&token=61ca9cbc-c519-48c9-80b3-01cb45c96cb4)

{% hint style="success" %}
Congratulations! The Eth2 beacon node is now syncing to the Prater testnet!
{% endhint %}
