diff --git a/proto-cuda/windows-app/ALLOW-FIREWALL.bat b/proto-cuda/windows-app/ALLOW-FIREWALL.bat new file mode 100644 index 000000000..50f4c8754 --- /dev/null +++ b/proto-cuda/windows-app/ALLOW-FIREWALL.bat @@ -0,0 +1,12 @@ +@echo off +rem Adds a Windows Firewall rule so the Mac node can connect to igneumd.exe on this PC (inbound, private and domain +rem networks). Only needed if you clicked Cancel on the firewall prompt the first time START-IGNEUM.bat ran, or if the +rem status line keeps saying peers 0 while the Mac node is up. Asks for administrator rights once. +cd /d "%~dp0" +if not exist "%~dp0igneumd.exe" ( + echo igneumd.exe is not in this folder ^(extract the whole zip^); the rule needs the exe path. + pause + exit /b 1 +) +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0allow-firewall.ps1" +pause diff --git a/proto-cuda/windows-app/README.txt b/proto-cuda/windows-app/README.txt new file mode 100644 index 000000000..e0878bd27 --- /dev/null +++ b/proto-cuda/windows-app/README.txt @@ -0,0 +1,10 @@ +Igneum devnet for Windows: the node and the miners in one window. Extract the whole zip to a short path such as C:\igneum first. +1. START-IGNEUM.bat. It starts igneumd (database under %LOCALAPPDATA%\igneum\devnet, RPC 127.0.0.1:26610, p2p 0.0.0.0:26611, peered to the Mac at 192.168.68.64:26611), waits until the node is synced, then finds the GPUs, builds the CUDA and OpenCL workers on the first run (CUDA Toolkit 12.8 or newer plus Visual Studio with the MSVC v143 x64 component) and starts MINERS=8 miner identities per GPU vendor against the node on this PC. Settings are at the top of the bat. + Firewall: the first time, Windows Defender Firewall asks about igneumd.exe. Tick Private networks and click Allow access (that lets the Mac node dial this PC). If you clicked Cancel, run ALLOW-FIREWALL.bat once. +2. The window is a dashboard, redrawn every 2 s: the NODE card first (state in colour: starting, syncing, synced, restarting, stopped; blocks, headers, blue score, peers, the chain's blocks per second, the difficulty direction, the node's uptime), then one card per GPU (hash rate in big digits, blocks found, one cell per miner), the network share line, the last events (node started, synced in N s, peer joined or left, node restarted, blocks found, hourly program rebuilt, miner restarted, upload failed) and a footer. Set PLAIN=1 at the top of the bat for a scrolling log instead; the launcher uses it by itself when the window is not a real console. +3. Ctrl+C in the window stops the miners first, then the node, then uploads the logs one last time; the window stays open with a summary. If the window was closed instead, STOP-IGNEUM.bat stops everything cleanly. +A node crash is restarted after a random 5 to 60 s; the miners are restarted once the node is back and synced (their connection dies with the node). Every hour the program changes: the miners exit with code 42, the launcher re-exports the pack, rebuilds the worker and restarts them. The PC is held awake while the window runs; for the night also set Sleep to Never in Settings > System > Power. +Logs land next to the bat (igneum-.log for the launcher, node-.log for the node, nvidia--.log and amd--.log per miner) and are uploaded every 60 s with upload-log.bat under the labels igneum-, nodelog-, nvidia--, amd--. +Separate entry points, same code (igneum-common.ps1): START-NODE.bat runs the node alone (its card and events), START-MINING.bat runs the miners alone against a node that is already up (NODE_HOST=auto picks 127.0.0.1 when one runs here, else the Mac). +If the node exits at once with a database error (an older build's database), delete %LOCALAPPDATA%\igneum\devnet and start again; it resyncs from the Mac in seconds. +Files: START-IGNEUM.bat, START-NODE.bat, START-MINING.bat, STOP-IGNEUM.bat, ALLOW-FIREWALL.bat and their .ps1 files, igneum-common.ps1, igneumd.exe with libstdc++-6.dll, libgcc_s_seh-1.dll and libwinpthread-1.dll (keep them next to it), igneum-miner.exe, upload-log.bat, proto-cuda\ and proto-opencl\ (the worker sources and build.bat). diff --git a/proto-cuda/windows-app/START-IGNEUM.bat b/proto-cuda/windows-app/START-IGNEUM.bat new file mode 100644 index 000000000..1f12e6a1d --- /dev/null +++ b/proto-cuda/windows-app/START-IGNEUM.bat @@ -0,0 +1,73 @@ +@echo off +rem Igneum for Windows: the node and the miners in one window. Double-click this file. +rem It starts igneumd (your own node, peered to the Mac), waits until it is synced, then finds the GPUs in this PC, builds +rem the matching GPU workers on first run (NVIDIA: CUDA, AMD: OpenCL) and runs one igneum-miner per worker against the +rem node on this PC. The window shows a dashboard: the NODE card first, then one card per GPU, the last events. +rem Logs land next to this file and are uploaded every 60 seconds. Stop with Ctrl+C (miners first, then the node); the +rem window stays open at the end. If the window was closed instead, STOP-IGNEUM.bat stops everything. + +rem ---- node settings: edit these lines only ------------------------------------------------------------------------ +rem The Mac node (its p2p port). This node dials it at start and keeps retrying; the Mac can dial back as well. +set "MAC_NODE=192.168.68.64:26611" +rem gRPC for the miners on this PC. +set "RPC_LISTEN=127.0.0.1:26610" +rem p2p on all interfaces, so the Mac node can connect in. Windows Firewall asks once: tick Private networks, Allow access. +set "P2P_LISTEN=0.0.0.0:26611" +rem Where the chain database lives. +set "APPDIR=%LOCALAPPDATA%\igneum\devnet" +rem 1 = hand out block templates before this node is synced and start the miners at once (the Mac node mines alone like +rem this). 0 = the miners start once this node has caught up with the Mac. +set "UNSYNCED_MINING=0" +rem Anything else to pass to igneumd (for example --loglevel=debug). +set "EXTRA_ARGS=" + +rem ---- miner settings ---------------------------------------------------------------------------------------------- +rem Devnet payout address (igneumdev:...). Leave empty for one address per identity, derived from this PC's name. +set "PAYOUT_ADDRESS=" +rem NVIDIA: CUDA device index (0 = first card) and the nvcc architecture (sm_120 = RTX 50 series; "native" lets nvcc pick). +set "NVIDIA_DEVICE=0" +set "CUDA_ARCH=sm_120" +rem AMD: by default the first OpenCL GPU whose vendor string contains AMD_VENDOR is used, never an NVIDIA device. +rem Set AMD_DEVICE to a flat device index from the worker's --list output to override. +set "AMD_VENDOR=Advanced Micro Devices" +set "AMD_DEVICE=" +rem Miner identities per GPU vendor. Each identity runs its own worker process (about 1.3 GiB of GPU memory each) with its +rem own vote key and payout address derived from this PC's name and the index, and its own random nonce start. +set "MINERS=8" +rem Set to 0 to skip a vendor even if the hardware is present. +set "USE_NVIDIA=1" +set "USE_AMD=1" +rem Nonces per job (one job = one block template; a multiple of 32). Empty = the miner's default of 16,777,216, which an +rem RTX 5090 identity finishes in under a second. The integrated AMD GPU needs 100 s for that, so it mines stale templates +rem and reports late; 2,097,152 keeps its jobs near 10 s. +set "NVIDIA_JOB_NONCES=" +set "AMD_JOB_NONCES=2097152" +rem The window shows a dashboard (redrawn in place). Set PLAIN=1 for a scrolling log instead; the launcher also falls +rem back to it by itself when the window is not a real console. +set "PLAIN=0" +rem Visual Studio: the MSVC toolset CUDA 12.8 accepts (14.30 = MSVC v143). Adjust the path if Visual Studio is elsewhere. +set "VCVARS=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" +set "VCVARS_VER=14.30" +rem ------------------------------------------------------------------------------------------------- + +cd /d "%~dp0" +if not exist "%~dp0start-igneum.ps1" ( + echo Please extract the whole zip first ^(right-click, Extract All^), then run START-IGNEUM.bat from the extracted folder. + pause + exit /b 1 +) +if not exist "%~dp0igneumd.exe" ( + echo igneumd.exe is not in this folder. Extract the whole zip ^(the node exe ships prebuilt^) and run again. + pause + exit /b 1 +) +where powershell >nul 2>nul +if errorlevel 1 ( + echo PowerShell was not found. Windows 10 and 11 ship it; nothing else can be done here. + pause + exit /b 1 +) +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0start-igneum.ps1" +echo. +echo Igneum has stopped. The log files are next to this file and were uploaded if the upload tool is present. +pause diff --git a/proto-cuda/windows-app/START-MINING.bat b/proto-cuda/windows-app/START-MINING.bat new file mode 100644 index 000000000..3a22a667a --- /dev/null +++ b/proto-cuda/windows-app/START-MINING.bat @@ -0,0 +1,55 @@ +@echo off +rem Igneum devnet mining test for Windows, the miners only. Double-click this file. +rem It finds the GPUs in this PC, builds the matching GPU workers on first run (NVIDIA: CUDA, AMD: OpenCL), and runs +rem one igneum-miner per worker against a node that is already running (START-NODE.bat here, or the Mac). Logs land next +rem to this file and are uploaded every 60 seconds. START-IGNEUM.bat runs the node and the miners together instead. +rem The window shows a dashboard: hash rate, blocks found and one line per miner. Stop with Ctrl+C; the window stays open at the end. + +rem ---- settings: edit these lines only ---------------------------------------------------------- +rem auto = a node on this PC (START-NODE.bat, 127.0.0.1) when one is running, else the Mac node at 192.168.68.64. Or an address. +set "NODE_HOST=auto" +set "NODE_PORT=26610" +rem Devnet payout address (igneumdev:...). Leave empty for one address per identity, derived from this PC's name. +set "PAYOUT_ADDRESS=" +rem NVIDIA: CUDA device index (0 = first card) and the nvcc architecture (sm_120 = RTX 50 series; "native" lets nvcc pick). +set "NVIDIA_DEVICE=0" +set "CUDA_ARCH=sm_120" +rem AMD: by default the first OpenCL GPU whose vendor string contains AMD_VENDOR is used, never an NVIDIA device. +rem Set AMD_DEVICE to a flat device index from the worker's --list output to override. +set "AMD_VENDOR=Advanced Micro Devices" +set "AMD_DEVICE=" +rem Miner identities per GPU vendor. Each identity runs its own worker process (about 1.3 GiB of GPU memory each) with its +rem own vote key and payout address derived from this PC's name and the index, and its own random nonce start. +set "MINERS=8" +rem Set to 0 to skip a vendor even if the hardware is present. +set "USE_NVIDIA=1" +set "USE_AMD=1" +rem Nonces per job (one job = one block template; a multiple of 32). Empty = the miner's default of 16,777,216, which an +rem RTX 5090 identity finishes in under a second. The integrated AMD GPU needs 100 s for that, so it mines stale templates +rem and reports late; 2,097,152 keeps its jobs near 10 s. +set "NVIDIA_JOB_NONCES=" +set "AMD_JOB_NONCES=2097152" +rem The window shows a dashboard (one card per GPU, redrawn in place). Set PLAIN=1 for the old scrolling log instead; +rem the launcher also falls back to it by itself when the window is not a real console. +set "PLAIN=0" +rem Visual Studio: the MSVC toolset CUDA 12.8 accepts (14.30 = MSVC v143). Adjust the path if Visual Studio is elsewhere. +set "VCVARS=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" +set "VCVARS_VER=14.30" +rem ------------------------------------------------------------------------------------------------- + +cd /d "%~dp0" +if not exist "%~dp0start-mining.ps1" ( + echo Please extract the whole zip first ^(right-click, Extract All^), then run START-MINING.bat from the extracted folder. + pause + exit /b 1 +) +where powershell >nul 2>nul +if errorlevel 1 ( + echo PowerShell was not found. Windows 10 and 11 ship it; nothing else can be done here. + pause + exit /b 1 +) +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0start-mining.ps1" +echo. +echo The mining test has stopped. The log files are next to this file and were uploaded if the upload tool is present. +pause diff --git a/proto-cuda/windows-app/START-NODE.bat b/proto-cuda/windows-app/START-NODE.bat new file mode 100644 index 000000000..97b59063a --- /dev/null +++ b/proto-cuda/windows-app/START-NODE.bat @@ -0,0 +1,45 @@ +@echo off +rem Igneum devnet node for Windows, the node only. Double-click this file. +rem Runs igneumd.exe (the Igneum node) on this PC: the miners mine against it on localhost and it peers with the Mac +rem node. The window shows the NODE card; the node's own output goes to node-.log next to this file. +rem Stop with Ctrl+C; the window stays open at the end. START-IGNEUM.bat runs the node and the miners together instead. + +rem ---- settings: edit these lines only ---------------------------------------------------------- +rem The Mac node (its p2p port). This node dials it at start and keeps retrying; the Mac can dial back as well. +set "MAC_NODE=192.168.68.64:26611" +rem gRPC for the miners on this PC (START-MINING.bat with NODE_HOST=auto looks here first). +set "RPC_LISTEN=127.0.0.1:26610" +rem p2p on all interfaces, so the Mac node can connect in. Windows Firewall asks once: tick Private networks, Allow access. +set "P2P_LISTEN=0.0.0.0:26611" +rem Where the chain database lives. +set "APPDIR=%LOCALAPPDATA%\igneum\devnet" +rem 1 = hand out block templates before this node is synced (the Mac node runs like this because it mines alone). +rem 0 = the miners wait until this node has caught up with the Mac. +set "UNSYNCED_MINING=0" +rem Anything else to pass to igneumd (for example --loglevel=debug). +set "EXTRA_ARGS=" +rem Set PLAIN=1 for a scrolling log instead of the dashboard. +set "PLAIN=0" +rem ------------------------------------------------------------------------------------------------- + +cd /d "%~dp0" +if not exist "%~dp0start-node.ps1" ( + echo Please extract the whole zip first ^(right-click, Extract All^), then run START-NODE.bat from the extracted folder. + pause + exit /b 1 +) +if not exist "%~dp0igneumd.exe" ( + echo igneumd.exe is not in this folder. Extract the whole zip ^(the node exe ships prebuilt^) and run again. + pause + exit /b 1 +) +where powershell >nul 2>nul +if errorlevel 1 ( + echo PowerShell was not found. Windows 10 and 11 ship it; nothing else can be done here. + pause + exit /b 1 +) +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0start-node.ps1" +echo. +echo The node has stopped. The logs are next to this file. +pause diff --git a/proto-cuda/windows-app/STOP-IGNEUM.bat b/proto-cuda/windows-app/STOP-IGNEUM.bat new file mode 100644 index 000000000..e31310e78 --- /dev/null +++ b/proto-cuda/windows-app/STOP-IGNEUM.bat @@ -0,0 +1,13 @@ +@echo off +rem Stops everything Igneum started on this PC when the launcher window was closed instead of Ctrl+C: the launcher +rem scripts first ^(so nothing restarts^), then the miners and their GPU workers, then the node, then the newest logs +rem are uploaded. Safe to run when nothing is running. +cd /d "%~dp0" +where powershell >nul 2>nul +if errorlevel 1 ( + echo PowerShell was not found. Windows 10 and 11 ship it; nothing else can be done here. + pause + exit /b 1 +) +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0stop-igneum.ps1" +pause diff --git a/proto-cuda/windows-app/allow-firewall.ps1 b/proto-cuda/windows-app/allow-firewall.ps1 new file mode 100644 index 000000000..d5b0f6acd --- /dev/null +++ b/proto-cuda/windows-app/allow-firewall.ps1 @@ -0,0 +1,26 @@ +# Adds the inbound Windows Firewall rule for igneumd.exe (started by ALLOW-FIREWALL.bat). Runs itself again elevated, +# removes any block rule Windows made for the exe (the "Cancel" button on the prompt creates one), then adds an allow +# rule for the exe on the private and domain profiles. 3 October 2026. +param([switch]$Elevated) +$root = Split-Path -Parent $MyInvocation.MyCommand.Path +$exe = Join-Path $root 'igneumd.exe' +$rule = 'Igneum node (igneumd)' +if (-not $Elevated) { + Write-Host "asking for administrator rights to add the firewall rule for $exe" + $psArgs = @('-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', ('"' + $PSCommandPath + '"'), '-Elevated') + try { Start-Process -FilePath powershell.exe -Verb RunAs -Wait -ArgumentList $psArgs } catch { Write-Host "not elevated ($_); nothing changed"; exit 1 } + Write-Host 'done. Start again with START-IGNEUM.bat.' + exit 0 +} +try { + $blocked = @(Get-NetFirewallApplicationFilter -ErrorAction SilentlyContinue | Where-Object { $_.Program -and ($_.Program -ieq $exe) } | Get-NetFirewallRule | Where-Object { $_.Action -eq 'Block' }) + foreach ($b in $blocked) { Write-Host "removing block rule '$($b.DisplayName)'"; $b | Remove-NetFirewallRule } + Get-NetFirewallRule -DisplayName $rule -ErrorAction SilentlyContinue | Remove-NetFirewallRule + New-NetFirewallRule -DisplayName $rule -Direction Inbound -Program $exe -Action Allow -Profile Private,Domain -Protocol TCP | Out-Null + Write-Host "added inbound allow rule '$rule' for $exe (private and domain networks)" +} catch { + Write-Host "could not change the firewall: $_" + Start-Sleep -Seconds 5 + exit 1 +} +Start-Sleep -Seconds 2 diff --git a/proto-cuda/windows-app/igneum-common.ps1 b/proto-cuda/windows-app/igneum-common.ps1 new file mode 100644 index 000000000..af8f1dd7c --- /dev/null +++ b/proto-cuda/windows-app/igneum-common.ps1 @@ -0,0 +1,1253 @@ +# Igneum for Windows: the shared module. Dot-sourced by start-igneum.ps1 (node and miners in one window), +# start-mining.ps1 (miners only) and start-node.ps1 (node only), so the logic lives once. 3 October 2026. +# The caller sets $launcherName ('igneum', 'launcher' or 'node-launcher') before dot-sourcing; it names the launcher log. +# +# Sections: settings, logging and events, the node (igneumd), the chain reader (igneum-miner watch), GPUs and tools, +# pack and worker builds, the miners, log reading, states, the dashboard, uploads, keep-awake, the loop helpers. +# +# Lines this module reads: +# igneum-miner watch: node1 blocks=N headers=N daa=N tips=N peers=N difficulty=X sink=<12 hex> blue=N synced=true|false +# miner log: ACCEPTED block nonce=0x... | STATUS '