igneum/proto-cuda/windows-node/allow-firewall.ps1
igneum-labs 976c14ae1f Windows node package: igneumd cross-compiled for the PC, START-NODE and BUILD-NODE launchers
proto-cuda/windows-node/: START-NODE.bat and start-node.ps1 (igneumd
--devnet with --addpeer to the Mac, status line every 30 s through
igneum-miner watch, keep-awake, random-delay restart, Ctrl+C),
BUILD-NODE.bat and build-node.ps1 (builds on the PC from the src.zip
snapshot; winget for Rustup, LLVM and protoc; MSVC default toolset),
ALLOW-FIREWALL.bat and allow-firewall.ps1, README.txt, cross-build.sh
(the mingw-w64 recipe that built igneumd.exe in 8 min 25 s; the exe
ships with the three mingw runtime DLLs) and make-package.sh.
WINDOWS-MINER.md gains "Run your own node"; bench-log records the
cross-compile and the two-peer sync test on the Mac (ports 27000 and
27010, live node untouched). The mining launcher's NODE_HOST=auto
edit stays uncommitted for the agent that owns start-mining.ps1.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 20:54:27 +00:00

26 lines
1.6 KiB
PowerShell

# 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 the node again with START-NODE.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