seed1.testnet nbg1 195.201.35.33, seed2.testnet ash 5.161.232.205, seed3.testnet sin 5.223.52.210 (5 October 2026). Ports 26810/26811/28810/26890 from seed.env; provision-seed.sh BUILD_WHERE=cross takes the PC build job's Linux igneumd from infra/cross/out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
30 lines
1.4 KiB
Bash
Executable file
30 lines
1.4 KiB
Bash
Executable file
# Shared helpers for infra/seed-nodes. Source this.
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO="$(cd "$HERE/../.." && pwd)"
|
|
export REPO
|
|
# shellcheck source=config.sh
|
|
. "$HERE/config.sh"
|
|
SEEDS_TXT="$HERE/$SEEDS_FILE_BASE.txt"
|
|
SEEDS_TSV="$HERE/$SEEDS_FILE_BASE.tsv"
|
|
BUILD_DIR="$HERE/build"
|
|
|
|
log() { printf '%s %s\n' "$(date -u +%H:%M:%S)" "$*"; }
|
|
die() { log "ERROR: $*" >&2; exit 1; }
|
|
need() { command -v "$1" >/dev/null 2>&1 || die "$1 is not installed ($2)"; }
|
|
|
|
hetzner_auth() {
|
|
need hcloud "brew install hcloud"
|
|
[ -s "$HETZNER_TOKEN_FILE" ] || die "no token at $HETZNER_TOKEN_FILE"
|
|
HCLOUD_TOKEN="$(head -1 "$HETZNER_TOKEN_FILE" | tr -d '[:space:]')"; export HCLOUD_TOKEN
|
|
}
|
|
|
|
SSH_OPTS=(-i "$SSH_KEY_FILE" -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile="$HERE/build/known_hosts" -o ConnectTimeout=15 -o BatchMode=yes -o ServerAliveInterval=30)
|
|
sssh() { local ip="$1"; shift; ssh "${SSH_OPTS[@]}" "$SSH_USER@$ip" "$@"; }
|
|
sscp() { scp -q "${SSH_OPTS[@]}" "$@"; }
|
|
|
|
seed_ip() { awk -F'\t' -v n="$1" '$1 == n { print $4; exit }' "$SEEDS_TSV" 2>/dev/null; }
|
|
seed_names() { cut -f1 "$SEEDS_TSV" 2>/dev/null | grep . || true; }
|
|
|
|
# seeds.txt is derived from seeds.tsv: one "<ip>:26611" per seed, nothing else, so a script or a package can read it as is.
|
|
write_seeds_txt() { awk -F'\t' -v p="$P2P_PORT" '{ print $4 ":" p }' "$SEEDS_TSV" > "$SEEDS_TXT"; }
|