2021-06-22 09:34:37 +00:00
|
|
|
# Description
|
|
|
|
|
|
|
|
This role provisions a [Nimbus](https://nimbus.status.im/) installation that can act as an ETH2 network bootstrap node.
|
|
|
|
|
|
|
|
# Introduction
|
|
|
|
|
2021-10-26 11:27:05 +00:00
|
|
|
The role will:
|
2021-06-22 09:34:37 +00:00
|
|
|
|
2021-10-26 11:27:05 +00:00
|
|
|
* Checkout a branch from the [nimbus-eth2](https://github.com/status-im/nimbus-eth2) repo
|
2022-06-20 07:36:00 +00:00
|
|
|
* Build it using the [`build.sh`](./templates/scripts/build.sh.j2) Bash script
|
2021-10-26 11:27:05 +00:00
|
|
|
* Schedule regular builds using [Systemd timers](https://www.freedesktop.org/software/systemd/man/systemd.timer.html)
|
|
|
|
* Start a node by defining a [Systemd service](https://www.freedesktop.org/software/systemd/man/systemd.service.html)
|
2021-06-22 09:34:37 +00:00
|
|
|
|
|
|
|
# Ports
|
|
|
|
|
|
|
|
The service exposes three ports by default:
|
|
|
|
|
|
|
|
* `9000` - LibP2P peering port. Must __ALWAYS__ be public.
|
|
|
|
* `9200` - JSON RPC port. Must __NEVER__ be public.
|
|
|
|
* `9900` - Prometheus metrics port. Should not be public.
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
|
|
|
|
Add to your `requirements.yml` file:
|
|
|
|
```yaml
|
|
|
|
- name: infra-role-beacon-node-linux
|
|
|
|
src: git+git@github.com:status-im/infra-role-beacon-node-linux.git
|
|
|
|
scm: git
|
|
|
|
```
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
|
|
|
|
The crucial settings are:
|
|
|
|
```yaml
|
|
|
|
# branch which should be built
|
|
|
|
beacon_node_repo_branch: 'stable'
|
|
|
|
# ethereum network to connect to
|
|
|
|
beacon_node_network: 'mainnet'
|
|
|
|
# optional setting for debug mode
|
|
|
|
beacon_node_log_level: 'DEBUG'
|
2023-03-15 10:21:39 +00:00
|
|
|
# WebSocket or HTTP URLs for execution layet Engine API
|
|
|
|
beacon_node_exec_layer_urls:
|
|
|
|
- 'wss://erigon.internal.example.org:8551'
|
|
|
|
- 'http://geth.internal.example.org:8552'
|
2021-06-22 09:34:37 +00:00
|
|
|
```
|
|
|
|
The order of WebSocket URLs matters. First is the default, the rest are fallbacks.
|
|
|
|
|
2024-03-11 13:03:24 +00:00
|
|
|
There's also a [container monitor service](./MONITOR.md).
|
|
|
|
```yaml
|
|
|
|
nim_waku_monitor_enabled: true
|
|
|
|
```
|
2024-05-12 13:43:36 +00:00
|
|
|
Most non-sensitive configuration resides in `conf/config.toml` file in service directory.
|
2024-03-11 13:03:24 +00:00
|
|
|
|
2021-10-26 10:44:58 +00:00
|
|
|
# Management
|
|
|
|
|
|
|
|
## Service
|
2021-06-22 09:34:37 +00:00
|
|
|
|
|
|
|
Assuming the `stable` branch was built you can manage the service with:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-26 10:44:58 +00:00
|
|
|
sudo systemctl start beacon-node-mainnet-stable
|
|
|
|
sudo systemctl status beacon-node-mainnet-stable
|
|
|
|
sudo systemctl stop beacon-node-mainnet-stable
|
2021-06-22 09:34:37 +00:00
|
|
|
```
|
2021-09-21 15:25:36 +00:00
|
|
|
You can view logs under:
|
|
|
|
```sh
|
2021-10-22 12:04:12 +00:00
|
|
|
tail -f /data/beacon-node-mainnet-stable/logs/service.log
|
2021-09-21 15:25:36 +00:00
|
|
|
```
|
2021-10-26 10:44:58 +00:00
|
|
|
All node data is located in `/data/beacon-node-mainnet-stable/data`.
|
2021-06-22 09:34:37 +00:00
|
|
|
|
2021-10-26 10:44:58 +00:00
|
|
|
## Builds
|
2021-06-22 09:34:37 +00:00
|
|
|
|
|
|
|
A timer will be installed to build the image:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-26 10:44:58 +00:00
|
|
|
> sudo systemctl list-units --type=service '*beacon-node-*'
|
|
|
|
UNIT LOAD ACTIVE SUB DESCRIPTION
|
|
|
|
beacon-node-prater-stable.service loaded active running Nimbus Beacon Node on prater network (stable)
|
|
|
|
beacon-node-prater-testing.service loaded active running Nimbus Beacon Node on prater network (testing)
|
|
|
|
beacon-node-prater-unstable.service loaded active running Nimbus Beacon Node on prater network (unstable)
|
2021-06-22 09:34:37 +00:00
|
|
|
```
|
|
|
|
To rebuild the image:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-26 10:44:58 +00:00
|
|
|
> sudo systemctl start build-beacon-node-prater-stable
|
|
|
|
> sudo systemctl status build-beacon-node-prater-stable
|
|
|
|
● beacon-node-prater-stable-build.service - Build beacon-node-prater-stable
|
|
|
|
Loaded: loaded (/etc/systemd/system/beacon-node-prater-stable-build.service; enabled; vendor preset: enabled)
|
|
|
|
Active: inactive (dead) since Wed 2021-09-29 12:00:12 UTC; 2h 15min ago
|
|
|
|
TriggeredBy: ● beacon-node-prater-stable-build.timer
|
|
|
|
Docs: https://github.com/status-im/infra-role-systemd-timer
|
|
|
|
Process: 1212987 ExecStart=/data/beacon-node-prater-stable/build.sh (code=exited, status=0/SUCCESS)
|
|
|
|
Main PID: 1212987 (code=exited, status=0/SUCCESS)
|
|
|
|
|
|
|
|
Sep 29 12:00:12 build.sh[1213054]: HEAD is now at 0b21ebfe readme: update toc
|
|
|
|
Sep 29 12:00:12 build.sh[1212987]: >>> Binary already built
|
|
|
|
Sep 29 12:00:12 systemd[1]: beacon-node-prater-stable-build.service: Succeeded.
|
|
|
|
Sep 29 12:00:12 systemd[1]: Finished Build beacon-node-prater-stable.
|
2021-09-21 15:25:36 +00:00
|
|
|
```
|
2021-10-26 10:44:58 +00:00
|
|
|
To check full build logs use:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-22 12:04:12 +00:00
|
|
|
journalctl -u build-beacon-node-mainnet-stable.service
|
2021-06-22 09:34:37 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
# Requirements
|
|
|
|
|
|
|
|
Due to being part of Status infra this role assumes availability of certain things:
|
|
|
|
|
|
|
|
* The `iptables-persistent` module
|