Skip to content

About

Nimbus Ethereum consensus client package for StartOS

Resources

Stars

0 stars

Watchers

1 watching

Forks

 
 

Repository files navigation

Nimbus Logo

Nimbus on StartOS

Everything not listed in this document should behave the same as upstream Nimbus. If a feature, setting, or behavior is not mentioned here, the upstream documentation is accurate and fully applicable — see the Documentation section of instructions.md for links.

StartOS service package for Nimbus, a lightweight Ethereum consensus (beacon chain) client.


Table of Contents


Image and Container Runtime

This package runs the unmodified upstream multi-architecture statusim/nimbus-eth2 container image directly with a custom command line tailored for StartOS. The manifest requires at least 24 GiB of RAM (hardwareRequirements.ram) to exclude 8 GB and 16 GB devices while allowing 32 GB+ hosts after StartOS's memory reserve and integrated GPU carve-outs (64 GB+ preferred when running alongside other heavy services).

Property Value
Image source Upstream unmodified (statusim/nimbus-eth2)
Architectures x86_64, aarch64 (emulateMissing: false)
Entrypoint Custom command (/home/user/nimbus_beacon_node with StartOS flags)
  • Subcontainers:
    • nimbus: Long-lived subcontainer running prepare-nimbus (oneshot creating /chain/nimbus and setting user:user ownership) and the nimbus daemon (sigtermTimeout: 60_000 so SQLite/chaindag state flushes cleanly on stop).
    • checkpoint-sync: Temporary subcontainer (sdk.SubContainer.withTemp) created only while running the Checkpoint Sync action.
  • Runtime resource scaling: On every startup, computeResourceBudget() inspects container RAM (os.totalmem()) and logical CPUs (os.availableParallelism()) to set --num-threads (half of CPUs, clamped 1–4), --rest-statecache-size (1 below 20 GiB container RAM, 3 otherwise), --rest-statecache-ttl (30s / 60s), and caps --max-peers (100 below 20 GiB container RAM, 250 otherwise). Nimbus runs with --network=mainnet --history=prune --netkey-file=/chain/nimbus/netkey --insecure-netkey-password --enr-auto-update=true, preserving its libp2p Peer ID across restarts and updates so Ethereum peers can reconnect inbound immediately. At boot, main.ts reads any enabled public IP matching the active outbound gateway once (.once(), never .const()) to seed --nat=extip:<ip> (falling back to --nat=none), so both discv5 and libp2p advertise the public address from second zero while StartTunnel ↔ WAN switches still never force restarts.
  • Live thermal throttling: Rather than restarting Nimbus when temperatures climb, the thermals health check runs taskset -acp and ionice inside the nimbus subcontainer against all threads of /home/user/nimbus_beacon_node (comm=nimbus_beacon_n), scaling CPU core affinity and I/O priority smoothly and reversibly without interrupting sync.

Volume and Data Layout

Persistent settings live on an internal config volume, while the consensus database is mounted at /chain from either the internal chain volume or a user-selected StartOS shared volume.

Volume / Source Mount Path Purpose
config StartOS-managed Stores store.json and transient log-health.json telemetry
chain / shared volume /chain Consensus database stored under /chain/nimbus (pruned history)
nethermind:engine-auth /run/engine-auth Read-only mount providing Nethermind's jwt.hex for Engine API

File Models

The package owns one Zod-typed JSON file model on the config volume (store.json) and one rolling diagnostic telemetry file (log-health.json, not a file model).

  • config/store.json (z.looseObject): Holds StartOS-side configuration (storage, consensusPort, quicPort, consensusPeers, checkpointUrl, trustedBlockRoot, thermalProtection) and fullySynced. Seeded with defaults on init via storeJson.merge(effects, {}). Written by the configure and checkpoint-sync actions, and updated with fullySynced: true once initial sync completes. Hand edits to undeclared keys survive because the schema uses z.looseObject, while declared keys are validated/repaired on merge. Startup (main.ts) .const()s only startup-relevant fields — updating thermalProtection or fullySynced never restarts Nimbus.
  • config/log-health.json: Written atomically (.tmp + rename) by LogHealthMonitor during runtime with rolling 15-minute error counts, recent notable log lines, and active thermal throttle state. Excluded from backups.

Dependencies

Nimbus requires a running execution client on the same StartOS server to validate execution payloads over the authenticated Engine API.

  • nethermind (required, kind: 'running', health check nethermind): Supplies the Engine API on internal port 8551 (resolved dynamically over the StartOS bridge via sdk.host.getBridgeAddress, host ID engine-api) and the engine-auth volume mounted read-only at /run/engine-auth for jwt.hex. If Nethermind's bridge address cannot be resolved, Nimbus does not start and surfaces a failing execution-connection health check.

Network Access and Interfaces

Nimbus binds its REST Beacon API privately for bridge-local consumers and exposes its adjacent P2P TCP/UDP and QUIC UDP ports as one grouped range interface.

Interface / Host ID Type Port(s) Protocol Purpose
beacon-api — 5052 TCP Unexported bridge-only Beacon REST API (--rest-address=0.0.0.0)
peer-network api 9000–9001 (configurable, 2 contiguous ports) TCP + UDP Grouped range for peer TCP + discovery UDP (base port) and QUIC UDP (+1); Nimbus does not listen on QUIC TCP
  • Changing the peer port retires the previous range binding via MultiHost.retirePort() and resets public address selections.
  • main.ts does not .const() the outbound gateway or interface host, so switching between gateways (for example, StartTunnel and local WAN) never forces intermediate restarts; the peer-ports health check reacts via .onChange() and sdk.host.getAddressGateways(), and --enr-auto-update=true refreshes Nimbus's advertised IP automatically.
  • Legacy non-adjacent port configs fall back to separate consensus-peers (p2p) and consensus-quic (p2p) interfaces until saved with adjacent ports.

Installation and First-Run Flow

On install, init seeds config/store.json with defaults (storage: null, thermalProtection: 'auto') and raises a critical task requiring storage selection before Nimbus can start.

  1. Install and start Nethermind first so the nethermind dependency, bridge Engine API, and engine-auth JWT volume are present.
  2. Run Configuration → Settings to select either the StartOS data drive (must be at least 150 GiB) or a writable, available shared volume, choose an initial checkpoint sync source, and set peer ports/limits.
  3. Start Nimbus. When /chain/nimbus/db is empty and a checkpoint URL is configured, Nimbus bootstraps via --external-beacon-api-url (and optional --trusted-block-root) in minutes.

Actions

Every action below is user-facing (visibility: 'enabled'). No hidden actions exist.

  • configure (Configuration → Settings):
    • When to run: Required before first start to choose storage, or whenever changing checkpoint sync defaults, peer port, peer cap, or thermal protection mode.
    • What it changes: Updates config/store.json and retires the old port range if the peer port changes.
    • Cost: Instant. Changing only thermalProtection applies live without restarting Nimbus; changing any other setting restarts the daemon.
    • Repeat safety: Idempotent. Changing storage does not migrate existing chain data.
  • checkpoint-sync (Maintenance → Checkpoint Sync):
    • When to run: To recover from consensus database corruption or switch an already-initialized genesis sync to a recent finalized checkpoint.
    • What it changes: Deletes /chain/nimbus/db (leaving validator keys intact), runs nimbus_beacon_node trustedNodeSync --backfill=false in temporary subcontainer checkpoint-sync, and updates checkpointUrl, trustedBlockRoot, and fullySynced: false in store.json.
    • Cost: Typically 1–3 minutes (10-minute command timeout); requires the service to be stopped.
    • Repeat safety: Destructive to /chain/nimbus/db, safe to repeat whenever a fresh finalized state is desired.
  • log-summary (Maintenance → System & Log Summary):
    • When to run: When diagnosing sync delays, high temperatures, memory pressure, or Log Health warnings/failures.
    • What it changes: Read-only; samples live /sys/class/hwmon, /sys/class/thermal, /proc resources, and config/log-health.json.
    • Cost: Sub-second, zero service impact.
    • Repeat safety: Idempotent.
    • Outputs: Copyable/downloadable plain-text diagnostics report (nimbus-diagnostics.txt).
  • connected-peers (Explorer → Connected Peers):
    • When to run: When inspecting connected consensus peers, client diversity, TCP vs. QUIC usage, geographic distribution, or copying your node's ENR/Peer ID.
    • What it changes: Read-only; queries /eth/v1/node/peers?state=connected, /eth/v1/node/identity, and performs an on-demand batch GeoIP lookup (ip-api.com/batch, degrading cleanly if offline).
    • Cost: 1–2 seconds, zero service impact.
    • Repeat safety: Idempotent.
    • Outputs: Markdown summary (countries, Community Helper badge, residential vs. datacenter split, TCP/QUIC breakdown, consensus client diversity chart) plus copyable peer table (nimbus-peers.txt), ENR, and Peer ID.
  • beacon-pulse (Explorer → Beacon Pulse):
    • When to run: When viewing live Beacon Chain finality, epoch liveness, sync committee participation, PeerDAS blobs, recent validator graffiti, slashing radar, and your node's BLS/state verification scorecard.
    • What it changes: Read-only; queries local Beacon API endpoints and reads ephemeral /tmp/nimbus-session-stats.json (100% local, zero external network calls).
    • Cost: Sub-second, zero service impact.
    • Repeat safety: Idempotent.
    • Outputs: Markdown dashboard plus copyable recent beacon blocks table (nimbus-pulse.txt) and client identity.

Tasks

The package creates one dynamic task in init/seed.ts (watchStorage) and fires informational/alert StartOS notifications during operation.

  • Choose storage (configure):
    • What raises it: store.json has storage: null, or the selected shared volume grant is missing, read-only, or unavailable.
    • Severity: critical (blocks service startup).
    • What clears it: Selecting the StartOS data drive or an available read/write shared volume in configure, or restoring availability/read-write access to the previously selected shared volume. Returns automatically if the volume grant is later revoked or unplugged.
  • Notifications (non-blocking): Sent for initial Consensus Sync Complete, Server Overheating (2h cooldown), Critically Low Server Memory (2h cooldown), Nimbus Disk Space Low / Critical (24h / 6h cooldown), and once-per-run critical log alerts (db-disk, fatal-oom, jwt-auth, clock-drift).

Health Checks

Nine health checks surface live Beacon API, execution link, sync progress, network/ENR, peer counts, hardware temperature, system resources, disk space, and log telemetry.

  • nimbus (Consensus API): Probes GET /eth/v1/node/version on port 5052 (120s grace period; tolerates one transient timeout after initial readiness while port 5052 remains listening). Failure after startup means Nimbus crashed, is deadlocked, or port 5052 is down — inspect logs and System & Log Summary.
  • execution-connection (Execution RPC): Probes el_offline via /eth/v1/node/syncing (requires: ['nimbus'], or immediate failure if Nethermind's bridge address is missing). loading means Nethermind is starting, offline, or rejecting JWT auth; verify Nethermind is healthy and check Log Health for JWT mismatch errors.
  • consensus-sync (Consensus Sync): Combines /eth/v1/node/syncing with live Slot start log telemetry (ConsensusLogTracker) to report sync stage, percentage, slot rate, ETA, backfill progress, thermal throttle state, and synced slot/epoch/finalized epoch. Failure after two consecutive API errors means Nimbus's Beacon API is unresponsive.
  • peer-ports (Peer Network): Reactive check (peerNetworkTrigger) verifying external port assignment, sdk.host.getAddressGateways() inbound/outbound alignment, and live ENR IP from /eth/v1/node/identity. Failure means StartOS reassigned the external port away from Settings — update the external port on Peer Network to match. loading indicates an inbound/outbound gateway mismatch or pending ENR update.
  • peers (Peers): Queries /eth/v1/node/peers?state=connected and displays total vs target plus inbound/outbound counts. loading at 0 peers indicates initial discovery or blocked outbound traffic; failure after two consecutive errors means the Beacon API is unreachable.
  • thermals (Temperature): Reactive check (thermalTrigger) reading /sys/class/hwmon (and /sys/class/thermal fallback) for CPU and NVMe temperatures and applying hysteresis-controlled taskset/ionice throttling (auto: Level 1 at 80°C CPU / 68°C NVMe, Level 2 at 88°C / 74°C; quiet: baseline Level 1, Level 2 at 82°C / 70°C; off: monitor only). disabled when hardware exposes no sensors (except quiet mode, which still applies core caps). loading when auto-throttling is active or temps run hot with throttling off. failure at critical overheat (≥ 95°C CPU / ≥ 80°C NVMe sustained, or ≥ 98°C / ≥ 83°C immediate) — check airflow, fans, and cooling immediately.
  • resources (System Resources): Samples host-wide /proc/stat, /proc/loadavg, /proc/meminfo, /proc/pressure/{cpu,memory,io}, and Nimbus's VmRSS inside the nimbus subcontainer (bypassing parent-container LXCFS virtualization so RAM pressure from Nethermind and other services is accurately detected). Reports informational success notices for high disk I/O (iowait >= 35% or IO PSI fullAvg60 >= 25%) or sustained high CPU (>= 90% or load1m > 1.25 * CPUs). loading signals high RAM (>= 88%, < 2 GiB free, or memory PSI someAvg60 >= 15%). failure signals critically low RAM (>= 95% and < 768 MiB free, or memory PSI fullAvg60 >= 25%) — stop other heavy services or lower Target consensus peers.
  • storage (Disk Space): Checks /chain free/total space and percentage used (statfs for local volume, df -PB1 /chain for shared volumes). Warns in message + notification below 40 GiB free and reports failure below 15 GiB free — free space or switch to a larger volume.
  • log-health (Log Health): Real-time sliding-window log analyzer filtering benign StartOS startup/NAT messages while tracking minor warnings and actionable categories (db-disk, fatal-oom, jwt-auth, engine-api, clock-drift, high-load, other-error). Failure requires action per the message and System & Log Summary output (drive check, Checkpoint Sync, NTP check, or restarting Nimbus/Nethermind).

Backups and Restore

Backups use sdk.Backups.ofVolumes('config') to copy only the config volume while excluding transient log-health.json and log-health.json.tmp files.

  • The chain volume (and any shared volume holding /chain/nimbus) is deliberately excluded because the pruned beacon chain database is large and reconstructible in minutes via Checkpoint Sync.
  • Shared volumes are backed up separately by StartOS; after restoring a shared volume, re-grant read/write access to Nimbus and select the restored volume in Configuration → Settings.
  • If Nethermind was restored and generated a new JWT secret, restart Nimbus so it reloads /run/engine-auth/jwt.hex.

Limitations and Differences

  1. Single execution client dependency: Currently wires only nethermind as the required execution provider; other execution clients require explicit dependency support.
  2. Pruned history only: Runs with --history=prune; archive beacon state and full historical backfill are not exposed as configuration options.
  3. No built-in validator client: Validator key management, slashing protection, and fee recipient configuration are not included.
  4. Hardware sensor dependence: Automatic thermal throttling requires Linux sysfs sensors (/sys/class/hwmon or /sys/class/thermal); VMs without exposed sensors report Temperature as disabled unless Low Heat / Quiet mode is selected.

Quick Reference for AI Consumers

package_id: nimbus
image: statusim/nimbus-eth2
architectures: [x86_64, aarch64]
subcontainers: [nimbus, checkpoint-sync]
volumes:
  config: startos-managed
  chain: /chain
file_models:
  - config/store.json
startos_managed_env_vars: []
dependencies: [nethermind]
interfaces:
  peer-network: { type: api, port: 9000, port_range: 2 }
actions:
  - configure
  - connected-peers
  - beacon-pulse
  - checkpoint-sync
  - log-summary
tasks:
  - { action: configure, severity: critical }
health_checks:
  - nimbus
  - execution-connection
  - consensus-sync
  - peer-ports
  - peers
  - thermals
  - resources
  - storage
  - log-health

About

Nimbus Ethereum consensus client package for StartOS

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages