Giter VIP home page Giter VIP logo

infra-role-beacon-node-macos's Introduction

Description

This role provisions a Nimbus installation on MacOS hosts.

Introduction

The role will:

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-macos
  src: [email protected]:status-im/infra-role-beacon-node-macos.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'
# 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'

The order of WebSocket URLs matters. First is the default, the rest are fallbacks.

Management

Directories

Each service folder consists of the following contents:

  • build.sh - Script that is executed to create a new build. The resulting binaries can be found in repo/build/
  • rpc.sh - Script to make it easier to interact with the beacon node JSON RPC API.
  • data/ - Data created by the beacon node process.
  • repo/ - Clone of the nimbus-eth2 repo.
  • logs/ - Node and build logs.
  • logs/build.log - Build logs generated by the Launchd scheduled job.
  • logs/service.log - Node logs rotated according to the logrotate.conf file.

Service

To see service status use:

 > sudo launchctl list status.beacon-node-mainnet-stable
{
	"StandardOutPath" = "/Users/nimbus/beacon-node-mainnet-stable/logs/service.log";
	"LimitLoadToSessionType" = "System";
	"StandardErrorPath" = "/Users/nimbus/beacon-node-mainnet-stable/logs/service.log";
	"Label" = "status.beacon-node-mainnet-stable";
	"OnDemand" = false;
	"LastExitStatus" = 0;
	"PID" = 6347;
	"Program" = "/Users/nimbus/beacon-node-mainnet-stable/repo/build/nimbus_beacon_node";
	"ProgramArguments" = (
		"/Users/nimbus/beacon-node-mainnet-stable/repo/build/nimbus_beacon_node";
		"--network=mainnet";
...

To restart the node use:

sudo launchctl unload /Library/LaunchDaemons/status.beacon-node-mainnet-unstable.plist
sudo launchctl load /Library/LaunchDaemons/status.beacon-node-mainnet-unstable.plist

Note that the Launchd config has the keepalive value set to true and running launchctl stop will immediately restart the node process.

Builds

Build scheduled with a Launchd Scheduled Job can be also managed using launchctl:

sudo launchctl start status.build-beacon-node-mainnet-stable
sudo launchctl stop status.build-beacon-node-mainnet-stable

The build logs can be seen in the logs/build.log. The job simply runs the buils.sh Bash script which can be run by hand:

 > sudo -u nimbus /Users/nimbus/beacon-node-prater-stable/build.sh 
 >>> Build Start: 2021-10-26T10:37:52Z
 >>> Fetching changes...
HEAD is now at 9e8081e4 Merge branch 'stable' into unstable
 >>> Binary already built. Run with --force flag to override
 >>> SUCCESS

Cleanup

When removing a deployment make sure to stop and delete the launchd daemons:

# stop the beacon node
cd /Library/LaunchDaemons
sudo launchctl unload status.beacon-node-mainnet-unstable.plist
rm status.beacon-node-mainnet-unstable.plist

# unload the periodic build job
sudo launchctl unload status.build-beacon-node-mainnet-unstable.plist
rm status.build-beacon-node-mainnet-unstable.plist

# delete the repo, data and logs
rm -rf ~/beacon-node-mainnet-unstable

# delete logrotate config
rm /opt/homebrew/etc/logrotate.d/beacon-node-mainnet-unstable.conf

infra-role-beacon-node-macos's People

Contributors

arthurk avatar etan-status avatar jakubgs avatar zah avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.