HiveOS package: --kit <zip> (repeatable) puts program-pack kits under packs/ in the tar; h-run.sh seeds packs/devnet from a shipped pack only when the node's export left nothing (the first-start convenience, never the authority; SHIPPED_PACK, default v4-devnet3-epoch0); README line (0.3.22, 7 Oct 2026)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
cb04e2b8ca
commit
f070417c7b
3 changed files with 40 additions and 1 deletions
|
|
@ -82,6 +82,16 @@ Stats JSON (what Hive reads from `$stats`): `hs` (kH/s per GPU), `hs_units` (`kh
|
|||
digest on the downloads page; a different one means the override is stale and the node is refused.
|
||||
- Ports: the bundled node listens on 26611 (p2p) and answers RPC on 127.0.0.1:26610 only.
|
||||
|
||||
## Shipped packs (0.3.22)
|
||||
|
||||
`make-hive-package.sh --kit <zip>` (repeatable) puts program-pack kits under `packs/` in the archive: the class v4 sub-version 3
|
||||
kit (eight packs, program_id `a785001687d8688a` for the shared devnet's epoch 0) and Devnet 3's epoch-0 pack
|
||||
`v4-devnet3-epoch0` (program_id `fce15bf61030be57`, exported under igneum-pow 017e7037 over genesis `4020cb43` as epoch and
|
||||
era seed, day bytes for 7 October UTC). They are the rig's FIRST-START convenience: `h-run.sh` seeds `packs/devnet` from the
|
||||
shipped pack only when the node's own export left nothing, so a rig mines from its first start; the pack is dated, and a rig
|
||||
starting after epoch 0 (3,600 DAA) re-exports from its own node as before. The shipped pack is never the authority; the
|
||||
pack-id gate reads `program.json`'s `program_id`.
|
||||
|
||||
## Building the package
|
||||
|
||||
infra/cross/build-linux.sh # igneumd and igneum-miner for Linux (cargo-zigbuild), into infra/cross/out
|
||||
|
|
|
|||
|
|
@ -73,7 +73,17 @@ say "GPUs: $nv NVIDIA, $amd AMD (worker setting: $WORKER)"
|
|||
|
||||
# 3. the hourly program pack from the node (the workers read it with --pack; the miner writes the next one to packs/prepare)
|
||||
export_pack() { [[ "$NODE_URL" == "none" ]] && return 0; rm -rf "$HERE/packs/devnet"; "$BIN/igneum-miner" export-pack "$NODE_URL" "$HERE/packs/devnet" >> "$MAIN" 2>&1; }
|
||||
# a shipped pack (packs/<name>/program.json, from make-hive-package.sh --kit; 0.3.22) seeds packs/devnet ONLY when the node's own
|
||||
# export left nothing: the rig's first-start convenience, never the authority (a rig starting after epoch 0 re-exports from its node;
|
||||
# the miner's --prepare-packs and exit 42 keep it on the chain's program as before). SHIPPED_PACK names the directory under packs/
|
||||
# (h-config.sh or the Flight Sheet; default v4-devnet3-epoch0 when it exists).
|
||||
seed_pack() {
|
||||
[[ -d "$HERE/packs/devnet" && -f "$HERE/packs/devnet/program.json" ]] && return 0
|
||||
local sp="${SHIPPED_PACK:-v4-devnet3-epoch0}"
|
||||
if [[ -f "$HERE/packs/$sp/program.json" ]]; then rm -rf "$HERE/packs/devnet"; cp -R "$HERE/packs/$sp" "$HERE/packs/devnet"; say "first start: packs/devnet seeded from the shipped pack $sp (program_id $(sed -n 's/.*"program_id" *: *"\{0,1\}\([0-9a-fx]*\)"\{0,1\}.*/\1/p' "$HERE/packs/$sp/program.json" | head -1)); the node's export replaces it"; fi
|
||||
}
|
||||
export_pack || say "pack export failed; the miners retry"
|
||||
seed_pack
|
||||
|
||||
# 4. one miner per GPU, restarted on exit (exit 42 = the program changed and the worker cannot prepare: re-export the pack)
|
||||
run_gpu() {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
# and infra/cross/out-workers (the two GPU workers, build-workers-linux.sh)
|
||||
# NODE_OUT=... WORKERS_OUT=... VERSION=... OUT=... other inputs; VERSION defaults to the igneumd version in version.txt
|
||||
# --fake stub binaries instead (the self-test; never ship it)
|
||||
# --kit <zip> (repeatable) program-pack kit(s) unpacked under packs/ in the tar (0.3.22: the sub-version 3
|
||||
# kit and Devnet 3's epoch-0 pack); the rig's first-start convenience, see h-run.sh
|
||||
# Output: packaging/hive/build/igneum-hive-<version>.tar.gz with the directory igneum/ inside (what Hive expects:
|
||||
# the archive name carries the version, the directory does not), plus its sha256 and the Flight Sheet lines.
|
||||
set -euo pipefail
|
||||
|
|
@ -12,7 +14,12 @@ REPO="$(cd "$HERE/../.." && pwd)"
|
|||
NODE_OUT="${NODE_OUT:-$REPO/infra/cross/out-v2}"
|
||||
WORKERS_OUT="${WORKERS_OUT:-$REPO/infra/cross/out-workers}"
|
||||
OUT="${OUT:-$HERE/build}"
|
||||
FAKE=0; [[ "${1:-}" == "--fake" ]] && FAKE=1
|
||||
# --kit <zip> (repeatable; 0.3.22, 7 October 2026): a program-pack kit unpacked under packs/ in the tar (the class v4 sub-version 3
|
||||
# packs and Devnet 3's epoch-0 pack, from the hash lane), the rig's FIRST-START convenience: h-run.sh seeds packs/devnet from a
|
||||
# shipped pack only when the node's own export leaves nothing, and a rig starting after epoch 0 re-exports from its own node as
|
||||
# before; the shipped pack is never the authority. The pack-id gate reads program.json's program_id.
|
||||
FAKE=0; KITS=()
|
||||
while [[ $# -gt 0 ]]; do case "$1" in --fake) FAKE=1; shift ;; --kit) KITS+=("$2"); shift 2 ;; *) echo "unknown argument $1" >&2; exit 2 ;; esac; done
|
||||
log() { printf '%s %s\n' "$(date -u +%H:%M:%S)" "$*"; }
|
||||
die() { log "ERROR: $*" >&2; exit 1; }
|
||||
stage="$OUT/igneum"; rm -rf "$stage"; mkdir -p "$stage/bin"
|
||||
|
|
@ -34,6 +41,18 @@ else
|
|||
VERSION="${VERSION:-$(head -1 "$NODE_OUT/version.txt" | awk '{print $2}')}"
|
||||
fi
|
||||
[[ -n "$VERSION" ]] || die "no version (VERSION=... or a version.txt with 'igneumd <version>')"
|
||||
if [[ ${#KITS[@]} -gt 0 ]]; then
|
||||
mkdir -p "$stage/packs"
|
||||
for k in "${KITS[@]}"; do
|
||||
[[ -f "$k" ]] || die "no kit zip at $k"
|
||||
unzip -q -o "$k" -d "$stage/packs" || die "kit $k does not unzip"
|
||||
log "kit $(basename "$k") sha256 $(shasum -a 256 "$k" 2>/dev/null | awk '{print $1}' || sha256sum "$k" | awk '{print $1}') unpacked under packs/"
|
||||
done
|
||||
# every pack directory holds program.json; its program_id is what the pack-id gate reads
|
||||
n=0; while IFS= read -r pj; do d="$(dirname "$pj")"; id="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("program_id",""))' "$pj" 2>/dev/null || true)"; log "pack ${d#"$stage/packs/"}: program_id ${id:-?}"; n=$((n+1)); done < <(find "$stage/packs" -name program.json | sort)
|
||||
[[ $n -gt 0 ]] || die "the kit(s) hold no pack (no program.json found)"
|
||||
printf 'packs: %s pack(s) from %s (first-start convenience; the rig re-exports from its own node)\n' "$n" "$(for k in "${KITS[@]}"; do basename "$k"; done | tr '\n' ' ')" >> "$stage/version.txt"
|
||||
fi
|
||||
cp "$HERE/h-config.sh" "$HERE/h-run.sh" "$HERE/h-stats.sh" "$HERE/README.md" "$stage/"
|
||||
sed "s/^CUSTOM_VERSION=.*/CUSTOM_VERSION=$VERSION/" "$HERE/h-manifest.conf" > "$stage/h-manifest.conf"
|
||||
chmod +x "$stage"/h-*.sh "$stage"/bin/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue