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
|
|
|
|
|
|
|
|
The role will checkout a branch from the
|
|
|
|
[nimbus-eth2](https://github.com/status-im/nimbus-eth2) repo, build and run it.
|
|
|
|
|
|
|
|
Each host can run multiple beacon nodes. Each node can be built from a different
|
|
|
|
branch (stable, unstable, testing, etc.) and will be run with systemd.
|
|
|
|
|
|
|
|
A timer is installed that will periodically pull changes from git and rebuild
|
|
|
|
the binaries.
|
|
|
|
|
|
|
|
# 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'
|
|
|
|
# Infura WebSocket URLs
|
|
|
|
beacon_node_web3_urls: ['wss://mainnet.infura.io/ws/v3/123qwe123qwe123qwe']
|
|
|
|
```
|
|
|
|
The order of WebSocket URLs matters. First is the default, the rest are fallbacks.
|
|
|
|
|
|
|
|
# Usage
|
|
|
|
|
|
|
|
Assuming the `stable` branch was built you can manage the service with:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-22 12:04:12 +00:00
|
|
|
systemctl start beacon-node-mainnet-stable
|
|
|
|
systemctl status beacon-node-mainnet-stable
|
|
|
|
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-22 12:04:12 +00:00
|
|
|
The service will store all data in the `/data/beacon-node-mainnet-stable` directory.
|
2021-06-22 09:34:37 +00:00
|
|
|
|
|
|
|
# Building
|
|
|
|
|
|
|
|
A timer will be installed to build the image:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-22 12:04:12 +00:00
|
|
|
systemctl list-timers build-beacon-node-mainnet-stable
|
2021-06-22 09:34:37 +00:00
|
|
|
```
|
|
|
|
To rebuild the image:
|
2021-09-21 15:25:36 +00:00
|
|
|
```sh
|
2021-10-22 12:04:12 +00:00
|
|
|
systemctl start build-beacon-node-mainnet-stable.service
|
2021-09-21 15:25:36 +00:00
|
|
|
```
|
|
|
|
To check build logs use:
|
|
|
|
```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
|