Hands mover: --override-json takes the shipper's exact override object for the cut (checked as restart-hand-nodes.sh checks its argument)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-josh 2026-10-06 20:00:43 +01:00
parent 1ed6db0c2c
commit b30da3e1bd

View file

@ -2,8 +2,10 @@
# Move one devnet hand from this Mac to igneum-build-1, one at a time so one hand always serves (Josh, 6 October 2026: the Mac
# runs nothing the network depends on). Plan and order: docs/plans/hands-on-build-1.md. Dry run by default; --go executes.
#
# infra/build-server/hands/move-hand.sh binary --node <fork worktree> build 0.3.15's Linux igneumd on the box, install it to
# /srv/hands/bin, write the override and snapshot (step 1)
# infra/build-server/hands/move-hand.sh binary --node <fork worktree> [--override-json '<object>']
# build 0.3.15's Linux igneumd on the box, install it to
# /srv/hands/bin, write the override (the shipper's exact
# object, else the Mac's file) and the snapshot (step 1)
# infra/build-server/hands/move-hand.sh observer-node [--go] hot rsync, stop the Mac's observer node (launchd), final rsync,
# start igneum-observer-node, print its first executing line (step 2)
# infra/build-server/hands/move-hand.sh observer [--go] copy ~/.config/igneum/env to /srv/observer/env (600), stop the
@ -29,8 +31,8 @@ MAC_SNAP=/tmp/igneum-devnet/node1-copy-snapshot.bin
MAC_SNAP_SHA=ac101f13576179fd7d7f5e8ee902c9a7b6cc47730e3a3c069f389f0ca46d9221 # the launchd agents' value (6 Oct 2026); recomputed below
H=/srv/hands
MODE="${1:-}"; shift || true
GO=0; NODE_WT=""
while [ $# -gt 0 ]; do case "$1" in --go) GO=1; shift ;; --node) NODE_WT="$2"; shift 2 ;; *) bs_die "unknown argument $1" ;; esac; done
GO=0; NODE_WT=""; OV_JSON=""
while [ $# -gt 0 ]; do case "$1" in --go) GO=1; shift ;; --node) NODE_WT="$2"; shift 2 ;; --override-json) OV_JSON="$2"; shift 2 ;; *) bs_die "unknown argument $1" ;; esac; done
say() { bs_log "$*"; }
run() { if [ "$GO" = 1 ]; then "$@"; else say "DRY RUN: $*"; fi; }
rssh() { "${ROOT_SSH[@]}" "$@"; }
@ -68,9 +70,17 @@ case "$MODE" in
run rssh "install -m 755 -o build -g build '$ctx/target/release/igneumd' '$H/bin/igneumd-$ver-$sha' && ln -sfn '$H/bin/igneumd-$ver-$sha' '$H/bin/igneumd' && sha256sum '$H/bin/igneumd-$ver-$sha' | cut -c1-16 && '$H/bin/igneumd' --version"
say "box binary sha256 $bin_sha; checking its commit string on the box"
run rssh "[ \$(strings '$H/bin/igneumd' | grep -c '$sha') -gt 0 ] && echo 'commit $sha in the binary' || { echo 'NO commit string in the binary'; exit 1; }"
[ -f "$MAC_OV" ] || bs_die "no override file at $MAC_OV"
say "override: $(cat "$MAC_OV" | cut -c1-200)"
run bs_rsync -p "$MAC_OV" "$BS_HOST:$H/override.json"
if [ -n "$OV_JSON" ]; then
# the shipper's exact object for the cut (6 Oct 2026: the sixteen-field file at publish 2); checked as a JSON object with the
# fee switch field, as infra/devnet/restart-hand-nodes.sh checks its argument
printf '%s' "$OV_JSON" | python3 -c 'import json,sys; o=json.load(sys.stdin); assert isinstance(o, dict) and "fees_v1_activation_daa" in o, "the object must carry fees_v1_activation_daa"; print("override (%d fields):" % len(o), json.dumps(o, sort_keys=True)[:400])'
ovfile=$(mktemp); printf '%s\n' "$OV_JSON" > "$ovfile"
else
[ -f "$MAC_OV" ] || bs_die "no override file at $MAC_OV and no --override-json"
say "override from the Mac's file: $(cut -c1-200 "$MAC_OV")"; ovfile="$MAC_OV"
fi
run bs_rsync -p "$ovfile" "$BS_HOST:$H/override.json"
[ "$ovfile" = "$MAC_OV" ] || rm -f "$ovfile"
if [ -f "$MAC_SNAP" ]; then
snap_sha=$(bs_sha256 "$MAC_SNAP"); [ "$snap_sha" = "$MAC_SNAP_SHA" ] || say "WARNING: snapshot sha256 is $snap_sha, the agents say $MAC_SNAP_SHA; the box gets the file's own"
say "snapshot: $MAC_SNAP ($(bs_size "$MAC_SNAP") bytes) -> $H/node1-copy-snapshot.bin,$snap_sha"