# IDYL Node CLI installer for Windows (Windows PowerShell 5.1 or PowerShell 7). # # irm https://idylnetwork.com/install.ps1 | iex # # Prefer to read it first (recommended): # irm https://idylnetwork.com/install.ps1 -OutFile install.ps1 # notepad install.ps1 # powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 # # What it does, and nothing else: # 1. checks that Node.js 20 or newer is installed (it does not install Node for you) # 2. downloads the node CLI from the IDYL gateway and copies the node CLI to # %LOCALAPPDATA%\IDYL\app # 3. creates the launcher %LOCALAPPDATA%\IDYL\bin\idyl-node.cmd and adds that folder to # your user PATH (set IDYL_NO_PATH=1 to skip; no admin rights needed) # 4. creates a node identity (%USERPROFILE%\.idyl\node-keypair.json) if none exists # 5. prints the next steps # No admin rights, no system-wide changes, no third-party scripts. Re-run it to update; # your keypair is never touched. # # The archive (idyl-node.zip) is built by CI from services/node and listed with its SHA-256 # at https://idylnetwork.com/downloads. # # Environment overrides: # IDYL_HOME install root (default %LOCALAPPDATA%\IDYL) # IDYL_ZIP_URL node archive (default https://idylnetwork.com/downloads/idyl-node.zip; a local .zip path also works) # IDYL_NO_PATH 1 = do not change the user PATH & { $ErrorActionPreference = 'Stop' Set-StrictMode -Version 3.0 function EnvOr([string]$Name, [string]$Default) { $v = [Environment]::GetEnvironmentVariable($Name) if ($v) { return $v } else { return $Default } } $DownloadsUrl = 'https://idylnetwork.com/downloads' $ZipUrl = EnvOr 'IDYL_ZIP_URL' "$DownloadsUrl/idyl-node.zip" $Root = EnvOr 'IDYL_HOME' (Join-Path $env:LOCALAPPDATA 'IDYL') $NoPath = (EnvOr 'IDYL_NO_PATH' '0') -eq '1' $AppDir = Join-Path $Root 'app' $BinDir = Join-Path $Root 'bin' $Launcher = Join-Path $BinDir 'idyl-node.cmd' $Keypair = Join-Path (Join-Path $env:USERPROFILE '.idyl') 'node-keypair.json' function Step([string]$Text) { Write-Host ''; Write-Host $Text -ForegroundColor White } function Fail([string]$Text) { Write-Host '' Write-Host "idyl install: $Text" -ForegroundColor Red throw 'IDYL install failed.' } # ------------------------------------------------------------ 1. Node.js Step '1/4 Checking Node.js' if (-not (Get-Command node -ErrorAction SilentlyContinue)) { Fail "Node.js 20 or newer is required and was not found. Install it from https://nodejs.org (or: winget install OpenJS.NodeJS.LTS), open a new terminal and re-run this script." } $nodeVersion = (& node -p 'process.versions.node' | Out-String).Trim() $major = 0 [void][int]::TryParse(($nodeVersion -split '\.')[0], [ref]$major) if ($major -lt 20) { Fail "Node.js 20 or newer is required (found $nodeVersion). Update from https://nodejs.org and re-run." } Write-Host "Node.js v$nodeVersion" # ------------------------------------------------------------ 2. download Step '2/4 Downloading IDYL' $tmp = Join-Path ([IO.Path]::GetTempPath()) ("idyl-install-" + [Guid]::NewGuid().ToString('N')) New-Item -ItemType Directory -Path $tmp | Out-Null try { $zip = Join-Path $tmp 'idyl.zip' Write-Host $ZipUrl try { if (Test-Path -LiteralPath $ZipUrl -PathType Leaf) { Copy-Item -LiteralPath $ZipUrl -Destination $zip } else { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $ZipUrl -OutFile $zip -UseBasicParsing } } catch { Fail "Download failed: $ZipUrl. Check your connection and try again (or download idyl-node.zip yourself from $DownloadsUrl and set IDYL_ZIP_URL to its path)." } $srcRoot = Join-Path $tmp 'src' try { Expand-Archive -LiteralPath $zip -DestinationPath $srcRoot -Force } catch { Fail 'The download is not a valid .zip archive.' } $src = Get-ChildItem -LiteralPath $srcRoot -Directory | Select-Object -First 1 if (-not $src -or -not (Test-Path -LiteralPath (Join-Path $src.FullName 'services\node\cli.js'))) { Fail 'The archive does not contain services\node\cli.js.' } # Stage the new copy next to the old one, then swap, so a failed update keeps the old install. New-Item -ItemType Directory -Path $Root -Force | Out-Null $stage = Join-Path $Root 'app.new' if (Test-Path -LiteralPath $stage) { Remove-Item -LiteralPath $stage -Recurse -Force } New-Item -ItemType Directory -Path (Join-Path $stage 'services') -Force | Out-Null Copy-Item -LiteralPath (Join-Path $src.FullName 'services\node') -Destination (Join-Path $stage 'services\node') -Recurse $tests = Join-Path $stage 'services\node\test' if (Test-Path -LiteralPath $tests) { Remove-Item -LiteralPath $tests -Recurse -Force } Copy-Item -LiteralPath (Join-Path $src.FullName 'package.json') -Destination (Join-Path $stage 'package.json') $license = Join-Path $src.FullName 'LICENSE' if (Test-Path -LiteralPath $license) { Copy-Item -LiteralPath $license -Destination (Join-Path $stage 'LICENSE') } $old = Join-Path $Root 'app.old' if (Test-Path -LiteralPath $old) { Remove-Item -LiteralPath $old -Recurse -Force } if (Test-Path -LiteralPath $AppDir) { Move-Item -LiteralPath $AppDir -Destination $old } Move-Item -LiteralPath $stage -Destination $AppDir if (Test-Path -LiteralPath $old) { Remove-Item -LiteralPath $old -Recurse -Force } } finally { Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue } $cli = Join-Path $AppDir 'services\node\cli.js' $version = (& node $cli --version | Out-String).Trim() Write-Host "Installed IDYL Node $version to $AppDir" # ------------------------------------------------------------ 3. launcher + PATH Step '3/4 Creating the idyl-node command' New-Item -ItemType Directory -Path $BinDir -Force | Out-Null $cmd = "@echo off`r`nrem IDYL Node launcher (created by scripts/install.ps1)`r`nnode ""%~dp0..\app\services\node\cli.js"" %*`r`n" [IO.File]::WriteAllText($Launcher, $cmd, (New-Object Text.ASCIIEncoding)) Write-Host $Launcher $userPath = [Environment]::GetEnvironmentVariable('Path', 'User') if (-not $userPath) { $userPath = '' } $onPath = @($userPath -split ';' | Where-Object { $_ -and ($_.TrimEnd('\') -ieq $BinDir.TrimEnd('\')) }).Count -gt 0 if (-not $onPath -and -not $NoPath) { $newPath = if ($userPath) { "$userPath;$BinDir" } else { $BinDir } [Environment]::SetEnvironmentVariable('Path', $newPath, 'User') $env:Path = "$env:Path;$BinDir" Write-Host "Added $BinDir to your user PATH (open a new terminal to use idyl-node)." $onPath = $true } # ------------------------------------------------------------ 4. identity Step '4/4 Node identity' if (Test-Path -LiteralPath $Keypair) { Write-Host "Keeping your existing keypair: $Keypair" $id = (& node $cli --pubkey --keypair $Keypair | Out-String).Trim() Write-Host "Node id: $id" } else { & node $cli --init --keypair $Keypair if ($LASTEXITCODE -ne 0) { Fail 'Could not create the node keypair.' } } # ------------------------------------------------------------ next steps Write-Host '' Write-Host 'IDYL Node is installed.' if (-not $onPath) { Write-Host '' Write-Host "$BinDir is not on your PATH. Run the launcher by its full path, or add the folder to PATH." } Write-Host @" Next steps 1. Install Ollama: https://ollama.com/download 2. Pull a model that fits your machine, for example: ollama pull llama3.1:8b 3. Start serving: idyl-node --gateway https://idylnetwork.com --backend http://localhost:11434/v1 --idle-only (A self-hosted gateway works the same way: pass its URL.) Options --payout where payouts go (testnet: earnings are metered, not paid yet) --serve-floor also run The Floor's guard model (ollama pull llama-guard3:1b) --unbound also serve Unbound (abliterated) models. Your computer generates the responses. Check that serving unrestricted models is legal where you live. The Floor blocks the worst categories but is not perfect. idyl-node --help everything else Back up $Keypair. It is your node identity. "@ }