#!/usr/bin/env bash # Runs ON a node VM as root (Debian 12 or Ubuntu). Called by provision.sh with: # install-node.sh # Expects /opt/igneum/bin/{igneumd,igneum-miner,wrpc.py,run-igneumd.sh,blocklog.sh} and the three unit files in /root. set -euo pipefail name="$1"; idx="$2"; suffix="$3"; bits="$4"; peers="$5"; extip="$6"; threads="$7"; status_secs="${8:-60}" export DEBIAN_FRONTEND=noninteractive if ! command -v chronyd >/dev/null 2>&1 || ! command -v iptables >/dev/null 2>&1; then apt-get update -qq apt-get install -y -qq chrony iptables python3 jq >/dev/null fi systemctl enable --now chrony >/dev/null 2>&1 || true id igneum >/dev/null 2>&1 || useradd --system --home /var/lib/igneum --shell /usr/sbin/nologin igneum mkdir -p /var/lib/igneum /var/log/igneum /etc/igneum /opt/igneum/bin chmod +x /opt/igneum/bin/* chown -R igneum:igneum /var/lib/igneum /var/log/igneum # A private devnet: own handshake magic (suffix) and own genesis (bits override recomputes the genesis hash). # OverrideParams is deny_unknown_fields, so only known keys go in here (consensus/core/src/config/params.rs). printf '{"genesis_bits": %s}\n' "$bits" > /etc/igneum/override-params.json cat > /etc/igneum/node.env </dev/null 2>&1 echo "installed $name (index $idx, suffix $suffix, bits $bits, peers $peers, $threads miner thread(s)); $(/opt/igneum/bin/igneumd --version | head -1)"