Decision of 4 October 2026 (evening): the Igneum Miner software takes a visible, switchable 1% dev fee, the norm for GPU miners; the protocol stays fee-free. The miner side (--dev-fee, the 1-in-100 template counter, the audit command) is on branch dev-fee of the node fork. - app: settings.dev_fee (default on) passes --dev-fee 0 to igneum-miner when off; Settings shows the miner's own "dev fee 1% (1 block in 100) to 0x..." line next to the rewards address with a switch; the engine parses the miner's start line and its dev-fee block lines (fee_session, lifetime fee_total, an event per fee block) - packaging/hive: h-manifest.conf, h-config.sh, h-run.sh, h-stats.sh, make-hive-package.sh (igneum-hive-<v>.tar.gz with the Linux igneumd, igneum-miner and both GPU workers), README with the Flight Sheet, selftest.sh (bash -n, stub binaries, the three hooks the way Hive runs them, the stats JSON parsed). Hive itself is untested - infra/cross/build-workers-linux.sh: the NVRTC and OpenCL workers cross-compiled for Linux with zig; proto-opencl/cl_dynamic.h gains the Linux dlopen branch (libOpenCL.so.1) - tools/dev-fee/run.mjs: the fee-block test network (two nodes on 29900+, three CPU miners, payouts audit) - docs/design/miner-dev-fee.md (mechanism, flag, lines, the DEV_FEE_ADDRESS placeholder and the devnet address), docs/fud-ledger.md E18 and the E5/L9 status line, litepaper "What a miner's hour looks like" paragraph, homepage miner section note Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
39 lines
2.9 KiB
Bash
Executable file
39 lines
2.9 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Igneum Miner for HiveOS: the stats Hive polls. Sourced by Hive (so: no exit); sets $khs (total kH/s) and $stats
|
|
# (JSON: hs per GPU in kH/s, temp, fan, uptime, ver, ar = [accepted, rejected], algo, bus_numbers). The per-GPU numbers
|
|
# come from the miners' own STATUS lines ($CUSTOM_LOG_BASENAME.gpu<N>.log, "now=<MH/s> MH/s"); accepted, rejected and
|
|
# dev-fee blocks are the cumulative counters of the same line. Temperatures and fans come from Hive's gpu-stats when it
|
|
# exists (its arrays follow Hive's GPU order; NVIDIA first here as on Hive), else nvidia-smi, else empty.
|
|
[[ -z "$CUSTOM_LOG_BASENAME" ]] && . "$(dirname "${BASH_SOURCE[0]}")/h-manifest.conf"
|
|
_hdir="$(dirname "${BASH_SOURCE[0]}")"
|
|
_ver="$(head -1 "$_hdir/version.txt" 2>/dev/null | awk '{print $2}')"; _ver="${_ver:-$CUSTOM_VERSION}"
|
|
_hs=(); _acc=0; _rej=0; _fee=0; _total_khs=0
|
|
for _f in $(ls "$CUSTOM_LOG_BASENAME".gpu*.log 2>/dev/null | sort -t u -k 3 -n); do
|
|
_line="$(grep ' STATUS ' "$_f" 2>/dev/null | tail -1)"
|
|
_mh="$(printf '%s' "$_line" | sed -n 's/.* now=\([0-9.]*\) MH\/s.*/\1/p')"
|
|
[[ -z "$_mh" ]] && _mh="$(printf '%s' "$_line" | sed -n 's/.* hash=\([0-9.]*\) MH\/s.*/\1/p')"
|
|
[[ -z "$_mh" ]] && _mh=0
|
|
_k="$(awk -v m="$_mh" 'BEGIN{printf "%.1f", m*1000}')"
|
|
_hs+=("$_k")
|
|
_total_khs="$(awk -v a="$_total_khs" -v b="$_k" 'BEGIN{printf "%.1f", a+b}')"
|
|
_a="$(printf '%s' "$_line" | sed -n 's/.* accepted=\([0-9]*\).*/\1/p')"; _acc=$((_acc + ${_a:-0}))
|
|
_r="$(printf '%s' "$_line" | sed -n 's/.* rejected=\([0-9]*\).*/\1/p')"; _rej=$((_rej + ${_r:-0}))
|
|
_d="$(printf '%s' "$_line" | sed -n 's/.* fee=\([0-9]*\).*/\1/p')"; _fee=$((_fee + ${_d:-0}))
|
|
done
|
|
_n=${#_hs[@]}
|
|
_temp="[]"; _fan="[]"; _bus="[]"
|
|
if command -v gpu-stats >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
|
|
_gs="$(gpu-stats 2>/dev/null)"
|
|
_temp="$(jq -c ".temp[0:$_n] // []" <<< "$_gs" 2>/dev/null || echo '[]')"
|
|
_fan="$(jq -c ".fan[0:$_n] // []" <<< "$_gs" 2>/dev/null || echo '[]')"
|
|
_bus="[$(jq -r ".busids[0:$_n][]? | split(\":\")[0]" <<< "$_gs" 2>/dev/null | while read -r _b; do printf '%d\n' "0x$_b" 2>/dev/null; done | paste -sd, -)]"
|
|
elif command -v nvidia-smi >/dev/null 2>&1; then
|
|
_temp="[$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits 2>/dev/null | head -n "$_n" | paste -sd, -)]"
|
|
_fan="[$(nvidia-smi --query-gpu=fan.speed --format=csv,noheader,nounits 2>/dev/null | head -n "$_n" | sed 's/\[N\/A\]/0/' | paste -sd, -)]"
|
|
_bus="[$(nvidia-smi --query-gpu=pci.bus_id --format=csv,noheader 2>/dev/null | head -n "$_n" | awk -F: '{printf "%d\n", strtonum("0x"$2)}' | paste -sd, -)]"
|
|
fi
|
|
_started="$(cat "$CUSTOM_LOG_BASENAME.started" 2>/dev/null)"; _up=0
|
|
[[ -n "$_started" ]] && _up=$(( $(date +%s) - _started ))
|
|
_hs_json="[$(IFS=,; printf '%s' "${_hs[*]}")]"
|
|
khs="$_total_khs"
|
|
stats="{\"hs\":$_hs_json,\"hs_units\":\"khs\",\"temp\":$_temp,\"fan\":$_fan,\"uptime\":$_up,\"ver\":\"$_ver\",\"ar\":[$_acc,$_rej],\"algo\":\"igneum\",\"bus_numbers\":$_bus,\"dev_fee_blocks\":$_fee}"
|