igneum/infra/seed-nodes/config.sh
2026-10-05 15:58:18 +00:00

52 lines
4 KiB
Bash
Executable file

# Igneum seed nodes: settings. Sourced by every script in this directory. Override in the environment.
# A seed is a small VM with a fixed public IPv4 that runs igneumd with p2p open, no mining, RPC on loopback, and
# serves peer exchange. seeds.txt lists "<ip>:26611" per seed; seeds.tsv keeps the metadata.
PROVIDER="${PROVIDER:-hetzner}" # hetzner (hcloud) or digitalocean (doctl)
SEED_NAME="${SEED_NAME:-igneum-seed-1}"
SEED_TYPE="${SEED_TYPE:-cx23}" # 2 shared Intel vCPU, 4 GB, 40 GB: USD 6.49/mo net, USD 0.0104/h, in fsn1, nbg1, hel1
# (Hetzner API, 3 Oct 2026). It is the cheapest x86 type this project can create in the
# EU: the old cpx11/cpx21 line is deprecated there since Dec 2025 (only ash and hil keep
# it, at USD 20.49 and 37.49/mo), cpx12 (1 vCPU, 2 GB) costs 13.49. 4 GB is needed: the
# node keeps up to four 256 MiB lottery caches (M15 cap) beside rocksdb, and the on-VM
# build wants 4 GB plus swap. US seeds: cpx11 (2 GB) or cpx21; Singapore: cpx22 (30.99).
SEED_LOCATION="${SEED_LOCATION:-fsn1}" # fsn1 Falkenstein, nbg1 Nuremberg, hel1, ash, hil, sin
IMAGE="${IMAGE:-debian-13}" # debian-13 (glibc 2.41) since 5 October 2026: the PC build job's Linux binaries come from
# WSL2 Ubuntu 24.04 and want glibc 2.38/2.39, which debian-12 (2.36) refuses ("GLIBC_2.38
# not found" on the first testnet provision). The devnet seed stays on debian-12 with the
# Mac's zig cross-build (glibc 2.36). Rebuild: hcloud server rebuild <name> --image debian-13.
DO_SIZE="${DO_SIZE:-s-2vcpu-4gb}"
DO_REGION="${DO_REGION:-fra1}"
DO_IMAGE="${DO_IMAGE:-debian-12-x64}"
SSH_KEY_FILE="${SSH_KEY_FILE:-$HOME/.ssh/igneum_ed25519}" # the operations key (3 Oct 2026)
SSH_KEY_NAME="${SSH_KEY_NAME:-igneum-ops}"
SSH_USER="${SSH_USER:-root}"
# Who may reach port 22. "any" = 0.0.0.0/0 (the project lead's instruction of 3 Oct 2026: SSH open); "me" = this Mac's public IP
# at creation time (api.ipify.org); or a CIDR. Change later with: hcloud firewall replace-rules, or ./firewall.sh.
SSH_SOURCE="${SSH_SOURCE:-any}"
HETZNER_TOKEN_FILE="${HETZNER_TOKEN_FILE:-$HOME/.config/igneum/hetzner-token}" # one line, the API token; never printed
# NET picks the network profile (5 October 2026): devnet = the shared devnet on the 266xx ports, seeds.tsv, firewall
# igneum-seed; testnet = igneum-testnet-1 (--testnet --netsuffix=1) on the 268xx ports (docs/testnet/README.md section 1),
# seeds-testnet.tsv, firewall igneum-testnet-seed, DNS names seedN.testnet.igneum.network (dns.sh).
NET="${NET:-devnet}"
case "$NET" in
devnet)
NETWORK_ARGS="${NETWORK_ARGS:---devnet}" # the live devnet; a suffixed test network: "--devnet --devnet-suffix=20"
P2P_PORT=26611; RPC_PORT=26610; RPC_JSON_PORT=28610; EVM_RPC_PORT=26790
FIREWALL_NAME="${FIREWALL_NAME:-igneum-seed}"; SEEDS_FILE_BASE=seeds; DNS_ZONE_SUB="" ;;
testnet)
NETWORK_ARGS="${NETWORK_ARGS:---testnet --netsuffix=1}"
P2P_PORT=26811; RPC_PORT=26810; RPC_JSON_PORT=28810; EVM_RPC_PORT=26890
FIREWALL_NAME="${FIREWALL_NAME:-igneum-testnet-seed}"; SEEDS_FILE_BASE=seeds-testnet; DNS_ZONE_SUB="testnet" ;;
*) echo "NET must be devnet or testnet" >&2; exit 1 ;;
esac
SEED_PEERS="${SEED_PEERS:-}" # other seeds to --addpeer, comma separated ip:port (filled from seeds.txt by provision)
# The node source (shared with the 20-node network): vendor/igneum-node working tree plus igneum-pow
NODE_SRC="${NODE_SRC:-$REPO/vendor/igneum-node}"
POW_SRC="${POW_SRC:-$REPO/igneum-pow}"
SRC_MODE="${SRC_MODE:-head+dirty}"
BUILD_WHERE="${BUILD_WHERE:-seed}" # seed = build on the seed VM itself (swap added); bin = use ../cloud-devnet/build/bin