README: a second paragraph under the title says the package carries igneumd, igneum-miner and
the two workers and no prover (make-hive-package.sh), so a HiveOS rig earns nothing from the 20%
proving share until a Linux prover build is published; the rig installer on rig-install (cf716a6,
packaging/linux/README.md) idles its prover unit in state setup for the same reason. A per-card
table (8, 12, 16, 24, 32 GB) from the app's rule in provedefault.rs and the proving agent's
measurements of 5 October 2026 (bench-log "proving v1": 13.9 GB prover alone on an empty shard,
28.3 GB on the full prototype shard, 15.6 GB and 16.75 GB mine-and-prove on one 5090, 30.0 GB
full shard beside the miner), marked before the v1-shard row.
IDENTITIES: the app's rule (detect.rs) is 8 vote keys for a card with 8 GiB or more, else 2.
h-config.sh now defaults to IDENTITIES=auto and resolves it per card from nvidia-smi
memory.total or /sys/class/drm/card<N>/device/mem_info_vram_total (amdgpu), 8 when neither
answers, writing IDENTITIES_GPU<N> keys into igneum.conf beside the IDENTITIES=8 fallback; a
number still overrides every card. h-run.sh reads IDENTITIES_GPU<N> first, else IDENTITIES.
The README and the h-config comment say the number.
selftest.sh: IDENTITIES=auto with no GPU tools (8, no per-card keys), the default being auto,
a stubbed nvidia-smi printing 6144 and 24576 (gpu0=2, gpu1=8), the numeric override, and h-run
taking IDENTITIES_GPU1=3 over the fallback. bash packaging/hive/selftest.sh on this Mac:
auto with no GPU tools: IDENTITIES=8, no per-card keys ok
default (no IDENTITIES line) is auto ok
auto with nvidia-smi 6144/24576: gpu0=2, gpu1=8 ok
numeric override keeps IDENTITIES=4 ok
== h-run.sh (fake GPUs: 2 NVIDIA, fake node, fake miner)
dev fee lines in the main log: 4
DEV_FEE=0 reached the miner as --dev-fee 0 ok
gpu0 took the IDENTITIES=8 fallback ok
gpu1 took IDENTITIES_GPU1=3 over the fallback ok
NVIDIA cards got the cuda worker ok
exit 42 restarted the miner and re-exported the pack ok
== h-stats.sh (sourced)
stats JSON ok: hs [118500.0, 118500.0] temp [61, 58] ar [24, 0] bus [1, 2]
== self-test passed (scripts and stats shape; Hive itself is untested)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
97 lines
5.4 KiB
Bash
Executable file
97 lines
5.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Igneum Miner for HiveOS: writes igneum.conf from the Flight Sheet. Sourced by Hive (so: return, never exit).
|
|
# CUSTOM_URL the node the miner mines against: grpc://host:26610 (your own igneumd), or "local" to run the
|
|
# bundled node on this rig (data under the miner folder, peers from PEERS or the public seed)
|
|
# CUSTOM_TEMPLATE the payout address: 0x followed by 40 hex (an EVM address you hold the key for), optionally
|
|
# followed by .workername (the label of this rig's keys; defaults to the Hive worker name)
|
|
# CUSTOM_PASS unused
|
|
# CUSTOM_USER_CONFIG extra lines, KEY=VALUE, one per line or separated by spaces:
|
|
# DEV_FEE=1 the miner software's dev fee in whole percent (1 block template in 100 to the dev
|
|
# address); DEV_FEE=0 turns it off. The protocol itself takes no fee.
|
|
# IDENTITIES=auto vote keys per card: 8 for a card with 8 GB or more, else 2 (IDENTITIES=auto
|
|
# applies that rule per card from nvidia-smi or the amdgpu sysfs, 8 when neither
|
|
# answers; the app's rule, app/igneum-app/src/detect.rs). A number overrides it
|
|
# for every card.
|
|
# WORKER=auto auto | cuda | opencl (the GPU worker; auto = cuda on NVIDIA, opencl on AMD)
|
|
# VOTE=1 sign finality checkpoints (0 = mine without voting)
|
|
# PEERS=a:26611,b:26611 peers for the bundled node when CUSTOM_URL=local
|
|
# EXTRA="..." appended to every igneum-miner command line
|
|
# Hive sources h-manifest.conf before this hook; the fallback is for a run outside Hive (selftest.sh)
|
|
[[ -z "$CUSTOM_CONFIG_FILENAME" ]] && . "$(dirname "${BASH_SOURCE[0]}")/h-manifest.conf"
|
|
|
|
[[ -z "$CUSTOM_TEMPLATE" ]] && echo -e "${YELLOW:-}Igneum: the wallet (CUSTOM_TEMPLATE) is empty; it must be 0x followed by 40 hex${NOCOLOR:-}" && return 1
|
|
[[ -z "$CUSTOM_URL" ]] && echo -e "${YELLOW:-}Igneum: the pool URL (CUSTOM_URL) is empty; grpc://host:26610 of your node, or local${NOCOLOR:-}" && return 1
|
|
|
|
wallet="${CUSTOM_TEMPLATE%%.*}"
|
|
label="${CUSTOM_TEMPLATE#*.}"
|
|
[[ "$label" == "$CUSTOM_TEMPLATE" || -z "$label" ]] && label="${WORKER_NAME:-rig}"
|
|
label="$(printf '%s' "$label" | tr -c 'A-Za-z0-9_-' '-' | cut -c1-32)"
|
|
if ! [[ "$wallet" =~ ^0x[0-9a-fA-F]{40}$ ]]; then
|
|
echo -e "${YELLOW:-}Igneum: the wallet must be 0x followed by 40 hex characters, got '$wallet'${NOCOLOR:-}"
|
|
return 1
|
|
fi
|
|
|
|
# defaults, then the user's KEY=VALUE lines
|
|
DEV_FEE=1; IDENTITIES=auto; WORKER=auto; VOTE=1; PEERS=""; EXTRA=""
|
|
while read -r kv; do
|
|
[[ -z "$kv" || "$kv" == \#* ]] && continue
|
|
key="${kv%%=*}"; val="${kv#*=}"
|
|
case "$key" in
|
|
DEV_FEE|IDENTITIES|WORKER|VOTE|PEERS|EXTRA) printf -v "$key" '%s' "$val" ;;
|
|
*) echo "Igneum: unknown setting '$key' ignored" ;;
|
|
esac
|
|
done < <(printf '%s\n' "$CUSTOM_USER_CONFIG" | tr ' ' '\n' | sed 's/^"//; s/"$//')
|
|
[[ "$DEV_FEE" =~ ^[0-9]+$ ]] || DEV_FEE=1
|
|
[[ "$IDENTITIES" =~ ^[0-9]+$ || "$IDENTITIES" == "auto" ]] || IDENTITIES=auto
|
|
|
|
# IDENTITIES=auto: 8 for a card with 8 GiB (8192 MiB) or more, else 2, per card, in the order h-run.sh numbers them
|
|
# (NVIDIA first unless WORKER=opencl, then AMD unless WORKER=cuda). VRAM from nvidia-smi (MiB per line) and from
|
|
# /sys/class/drm/card<N>/device/mem_info_vram_total (bytes, amdgpu). A card whose VRAM cannot be read gets 8.
|
|
ident_block="" # IDENTITIES_GPU<N>=... lines, one per card, newline-terminated
|
|
ident_summary=""
|
|
if [[ "$IDENTITIES" == "auto" ]]; then
|
|
vrams=()
|
|
if [[ "$WORKER" != "opencl" ]] && command -v nvidia-smi >/dev/null 2>&1; then
|
|
nvq=(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits)
|
|
command -v timeout >/dev/null 2>&1 && nvq=(timeout 20 "${nvq[@]}")
|
|
while read -r mib; do
|
|
mib="${mib//[[:space:]]/}"
|
|
[[ "$mib" =~ ^[0-9]+$ ]] && vrams+=("$mib") || vrams+=("")
|
|
done < <("${nvq[@]}" 2>/dev/null)
|
|
fi
|
|
if [[ "$WORKER" != "cuda" ]]; then
|
|
for d in "${IGNEUM_DRM_ROOT:-/sys/class/drm}"/card*; do
|
|
[[ "$(basename "$d")" =~ ^card[0-9]+$ && -r "$d/device/mem_info_vram_total" ]] || continue
|
|
bytes="$(cat "$d/device/mem_info_vram_total" 2>/dev/null)"
|
|
[[ "$bytes" =~ ^[0-9]+$ ]] && vrams+=("$((bytes / 1048576))") || vrams+=("")
|
|
done
|
|
fi
|
|
n=0
|
|
for mib in ${vrams[@]+"${vrams[@]}"}; do
|
|
if [[ -z "$mib" || "$mib" -ge 8192 ]]; then ident=8; else ident=2; fi
|
|
ident_block+="IDENTITIES_GPU$n=$ident"$'\n'
|
|
ident_summary+="gpu$n ${mib:-?}MiB:$ident "
|
|
n=$((n + 1))
|
|
done
|
|
IDENTITIES=8 # the fallback h-run.sh uses for a card h-config.sh could not see
|
|
[[ $n == 0 ]] && ident_summary="no VRAM readable, 8 per card"
|
|
fi
|
|
|
|
url="$CUSTOM_URL"
|
|
[[ "$url" == "local" ]] && url="local"
|
|
[[ "$url" != "local" && "$url" != grpc://* ]] && url="grpc://$url"
|
|
|
|
mkdir -p "$(dirname "$CUSTOM_CONFIG_FILENAME")"
|
|
cat > "$CUSTOM_CONFIG_FILENAME" <<CONF
|
|
# written by h-config.sh from the Flight Sheet; edit the Flight Sheet, not this file
|
|
NODE_URL=$url
|
|
WALLET=$(printf '%s' "$wallet" | tr 'A-F' 'a-f')
|
|
LABEL=$label
|
|
DEV_FEE=$DEV_FEE
|
|
IDENTITIES=$IDENTITIES
|
|
${ident_block}WORKER=$WORKER
|
|
VOTE=$VOTE
|
|
PEERS=$PEERS
|
|
EXTRA=$EXTRA
|
|
CONF
|
|
echo "Igneum: config written to $CUSTOM_CONFIG_FILENAME (node $url, wallet ${wallet:0:8}..., dev fee ${DEV_FEE}%, identities ${ident_summary:-$IDENTITIES per card})"
|