igneum/infra/seed-nodes/node/install-seed.sh
2026-10-05 15:59:53 +00:00

32 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# Runs ON the seed VM as root: install-seed.sh <name> <external-ip> "<network args>" "<peer list>" [p2p-port rpc-port json-port evm-port]
# Expects /opt/igneum/bin/{igneumd,igneum-miner,wrpc.py,run-seed.sh} and /root/igneumd.service.
set -euo pipefail
name="$1"; extip="$2"; netargs="$3"; peers="${4:-}"; p2p="${5:-26611}"; rpc="${6:-26610}"; rpcjson="${7:-28610}"; evm="${8:-26790}"
export DEBIAN_FRONTEND=noninteractive
command -v chronyd >/dev/null 2>&1 || { apt-get update -qq; apt-get install -y -qq chrony python3 >/dev/null; }
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 /etc/igneum /opt/igneum/bin
chmod +x /opt/igneum/bin/*
chown -R igneum:igneum /var/lib/igneum
# values quoted: the launcher sources this file with `.`, so an unquoted "--testnet --netsuffix=1" ran "--netsuffix=1"
# as a command (5 October 2026, the first testnet seed); systemd's EnvironmentFile reads the quotes too
cat > /etc/igneum/seed.env <<EOF
SEED_NAME="$name"
EXTERNAL_IP="$extip"
NETWORK_ARGS="$netargs"
SEED_PEERS="$peers"
P2P_PORT=$p2p
RPC_PORT=$rpc
RPC_JSON_PORT=$rpcjson
EVM_RPC_PORT=$evm
IGNEUM_RPC=ws://127.0.0.1:$rpcjson
EXTRA_ARGS=
EOF
cp /root/igneumd.service /etc/systemd/system/igneumd.service
systemctl daemon-reload
systemctl enable igneumd >/dev/null 2>&1
systemctl restart igneumd
sleep 3
systemctl is-active igneumd && journalctl -u igneumd --no-pager -n 5 -o cat