Ansible role for Nimbus Eth2 beacon node on Linux
https://github.com/status-im/nimbus-eth2
871b4d5c20 | ||
---|---|---|
defaults | ||
files | ||
handlers | ||
meta | ||
tasks | ||
templates | ||
README.md |
README.md
Description
This role provisions a Nimbus installation that can act as an ETH2 network bootstrap node.
Introduction
The role will:
- Checkout a branch from the nimbus-eth2 repo
- Build it using the
build.sh
Bash script - Schedule regular builds using Systemd timers
- Start a node by defining a Systemd service
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:
- 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:
# 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.
Management
Service
Assuming the stable
branch was built you can manage the service with:
sudo systemctl start beacon-node-mainnet-stable
sudo systemctl status beacon-node-mainnet-stable
sudo systemctl stop beacon-node-mainnet-stable
You can view logs under:
tail -f /data/beacon-node-mainnet-stable/logs/service.log
All node data is located in /data/beacon-node-mainnet-stable/data
.
Builds
A timer will be installed to build the image:
> 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)
To rebuild the image:
> 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.
To check full build logs use:
journalctl -u build-beacon-node-mainnet-stable.service
Requirements
Due to being part of Status infra this role assumes availability of certain things:
- The
iptables-persistent
module