Skip to content

Commit 6c33b9e

Browse files
docs: Windows zero-prereq via protocol: 'v2ray' (take Windows to 100/100)
Surface protocol: 'v2ray' as the recommended Windows connect path everywhere: no admin, no manual install, auto-downloaded V2Ray binary (~70% of nodes). WireGuard becomes an optional admin-once upgrade for the other ~30% (faster); the SDK checks admin BEFORE payment, so a non-admin box never wastes USDC/P2P. Verified against installed blue-js-sdk@2.8.0 ai-path source: - setup.js setupV2Ray() + connect.js auto-install V2Ray with no admin - setup.js checkWireGuard()/isAdmin() require admin for the WG MSI + tunnel - connect.js maps opts.protocol -> serviceType; omitted searches both - ADMIN-ELEVATION.md: V2Ray ~70% no admin, admin gate precedes payment - server/src/index.ts /manifest: new connectWindows block; connect/tldr/ platforms/setup/example default to protocol: 'v2ray' (tsc clean) - docs/llms.txt + docs/index.html: JSON-LD + both code blocks use protocol: 'v2ray'; Autonomous connectDirect path left as WireGuard
1 parent 9a6a5dd commit 6c33b9e

3 files changed

Lines changed: 28 additions & 15 deletions

File tree

docs/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
"lcdFallbacks": ["https://lcd.sentinel.co", "https://sentinel-api.polkachu.com", "https://api.sentinel.quokkastake.io", "https://sentinel-rest.publicnode.com", "https://api.sentinel.suchnode.net"],
5656
"platforms": "Payment is identical everywhere; only the connect step differs by OS.",
5757
"connectMacLinux": "Native CLI sentinel-dvpncli (go install github.com/sentinel-official/sentinel-dvpncli@latest, needs Go 1.24+). The CLI does NOT bundle a tunnel: it shells out to wg-quick (install wireguard-tools: apt/brew/pacman) for WireGuard nodes, or v2ray on PATH for V2Ray nodes. Most nodes are WireGuard, so install wireguard-tools at minimum; sudo is needed to bring the interface up. Then: (1) printf '%s\\n\\n' \"$MNEMONIC\" | sentinel-dvpncli keys add agent --keyring.backend test (keys add is interactive: line 1 = mnemonic, blank line 2 = default passphrase; there is no --recover flag); (2) sentinel-dvpncli tx session-start <nodeAddress> --subscription-id <subscriptionId> --tx.fee-granter-addr <feeGranter> --tx.from-name agent --keyring.backend test; (3) sessionId = sentinel-dvpncli query sessions --account-addr <sent1...> --subscription-id <subscriptionId> --output-format json (newest entry); (4) sentinel-dvpncli connect <sessionId>. Exception: Fedora (SELinux blocks VPNs).",
58-
"connectWindows": "Heavier JS path. await setup() from blue-js-sdk/ai-path — run once on a fresh machine; auto-downloads V2Ray (no admin), checks/installs WireGuard (MSI needs admin); returns { ready, capabilities, recommended, issues }",
58+
"connectWindows": "Zero-prereq path: pass protocol: 'v2ray' to connect() — no admin, no manual install. V2Ray is a userspace SOCKS5 proxy; connect() auto-downloads the v2ray binary to ~/.sentinel-sdk/bin on first use (no admin), covering ~70% of nodes. setup() is optional (it just pre-fetches V2Ray). WireGuard nodes (the other ~30%, faster) need admin ONCE for the MSI install + tunnel service; the SDK checks admin BEFORE payment and refuses a WireGuard node when not elevated, so no funds are wasted. If you cannot elevate, stay on protocol: 'v2ray'.",
5959
"walletCreate": "createWallet() from blue-js-sdk/ai-path → { address, mnemonic }",
60-
"connect": "Windows JS tunnel: connect({ mnemonic, subscriptionId, feeGranter, nodeAddress }) → { connected, ip, protocol }. On macOS/Linux use connectMacLinux (native CLI) instead.",
60+
"connect": "Windows JS tunnel: connect({ mnemonic, subscriptionId, feeGranter, nodeAddress, protocol: 'v2ray' }) → { connected, ip, protocol }. protocol: 'v2ray' = zero admin, zero manual install (auto-downloaded binary, ~70% of nodes) — the recommended Windows path. Omit protocol only if you have admin and want WireGuard nodes too. On macOS/Linux use connectMacLinux (native CLI) instead.",
6161
"disconnect": "JS: disconnect() ends session on-chain (fee-granted), tears down tunnel. CLI: sentinel-dvpncli tx session-cancel <sessionId>",
6262
"nodeFallback": "If provision.nodeAddress is empty, call rpcQueryNodesForPlan(rpc, provision.planId, { status: 1 }) and pick from items[]"
6363
},
@@ -1980,7 +1980,7 @@ <h3 style="font-size: 13px; color: var(--accent); margin-bottom: 18px; letter-sp
19801980
<span class="kw">import</span> { <span class="fn">base</span> } <span class="kw">from</span> <span class="str">'viem/chains'</span><span class="op">;</span>
19811981
<span class="kw">import</span> { <span class="fn">setup</span>, <span class="fn">createWallet</span>, <span class="fn">connect</span>, <span class="fn">disconnect</span>, <span class="fn">rpcQueryNodesForPlan</span>, <span class="fn">createRpcQueryClientWithFallback</span> } <span class="kw">from</span> <span class="str">'blue-js-sdk/ai-path'</span><span class="op">;</span>
19821982

1983-
<span class="cm">// Fresh machine? setup() auto-downloads V2Ray (no admin) + checks WireGuard</span>
1983+
<span class="cm">// Optional: pre-fetch V2Ray (no admin). connect({ protocol: 'v2ray' }) auto-fetches it anyway.</span>
19841984
<span class="kw">await</span> <span class="fn">setup</span>()<span class="op">;</span>
19851985

19861986
<span class="cm">// Create a Sentinel wallet (one-time &mdash; save the mnemonic!)</span>
@@ -2048,11 +2048,12 @@ <h3 style="font-size: 13px; color: var(--accent); margin-bottom: 18px; letter-sp
20482048
<span class="prop">nodeAddress</span><span class="op">,</span> <span class="cm">// from provision or fallback query</span>
20492049
<span class="prop">subscriptionId</span><span class="op">:</span> String(provision<span class="op">.</span>subscriptionId)<span class="op">,</span> <span class="cm">// from Step 2</span>
20502050
<span class="prop">feeGranter</span><span class="op">:</span> provision<span class="op">.</span>feeGranter<span class="op">,</span> <span class="cm">// operator pays gas</span>
2051+
<span class="prop">protocol</span><span class="op">:</span> <span class="str">'v2ray'</span><span class="op">,</span> <span class="cm">// zero admin, zero manual install (Windows)</span>
20512052
})<span class="op">;</span>
20522053

20532054
<span class="cm">// All traffic now routes through encrypted P2P tunnel</span>
20542055
console<span class="op">.</span><span class="fn">log</span>(<span class="str">`VPN active: ${vpn.ip} via ${vpn.protocol}`</span>)<span class="op">;</span>
2055-
<span class="cm">// { connected: true, ip: '104.234.x.x', protocol: 'wireguard',</span>
2056+
<span class="cm">// { connected: true, ip: '104.234.x.x', protocol: 'v2ray',</span>
20562057
<span class="cm">// sessionId: '39269345', nodeAddress: 'sentnode1...' }</span>
20572058

20582059
<span class="cm">// Disconnect also uses fee grant &mdash; 0 tokens needed</span>
@@ -2379,7 +2380,7 @@ <h2>End-to-end: USDC to VPN tunnel</h2>
23792380
<span class="fn">rpcQueryNodesForPlan</span><span class="op">,</span> <span class="fn">createRpcQueryClientWithFallback</span><span class="op">,</span>
23802381
} <span class="kw">from</span> <span class="str">'blue-js-sdk/ai-path'</span><span class="op">;</span>
23812382

2382-
<span class="cm">// ── Step 0: Fresh machine? Auto-install tunnel binaries (V2Ray needs no admin) ──</span>
2383+
<span class="cm">// ── Step 0 (optional): pre-fetch V2Ray (no admin). connect({ protocol: 'v2ray' }) auto-fetches it anyway ──</span>
23832384
<span class="kw">await</span> <span class="fn">setup</span>()<span class="op">;</span>
23842385

23852386
<span class="cm">// ── Step 1: Create Sentinel wallet (one-time) ──</span>
@@ -2428,6 +2429,7 @@ <h2>End-to-end: USDC to VPN tunnel</h2>
24282429
<span class="prop">nodeAddress</span><span class="op">,</span>
24292430
<span class="prop">subscriptionId</span><span class="op">:</span> String(provision<span class="op">.</span>subscriptionId)<span class="op">,</span>
24302431
<span class="prop">feeGranter</span><span class="op">:</span> provision<span class="op">.</span>feeGranter<span class="op">,</span>
2432+
<span class="prop">protocol</span><span class="op">:</span> <span class="str">'v2ray'</span><span class="op">,</span> <span class="cm">// zero admin, zero manual install (Windows)</span>
24312433
})<span class="op">;</span>
24322434

24332435
console<span class="op">.</span><span class="fn">log</span>(<span class="str">`VPN active: ${vpn.ip} via ${vpn.protocol}`</span>)<span class="op">;</span>
@@ -2457,7 +2459,7 @@ <h2>End-to-end: USDC to VPN tunnel</h2>
24572459
<span class="str">"sentinelTxHash"</span>: <span class="str">"2C1CFE..."</span>,
24582460
<span class="str">"expiresAt"</span>: <span class="str">"2026-05-14T..."</span>,
24592461
<span class="str">"operatorAddress"</span>: <span class="str">"0xCC689D..."</span>,
2460-
<span class="str">"instructions"</span>: <span class="str">"import { setup, connect } from 'blue-js-sdk/ai-path'; await setup(); /* installs V2Ray automatically if no tunnel binary is present */ await connect({ mnemonic, nodeAddress, subscriptionId, feeGranter })"</span>
2462+
<span class="str">"instructions"</span>: <span class="str">"import { setup, connect } from 'blue-js-sdk/ai-path'; /* setup() is optional on Windows — connect({ protocol: 'v2ray' }) auto-fetches the V2Ray binary (no admin, ~70% of nodes) */ await connect({ mnemonic, nodeAddress, subscriptionId, feeGranter, protocol: 'v2ray' })"</span>
24612463
}</code></pre>
24622464
</div>
24632465
</div>

docs/llms.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The agent needs exactly one thing before calling x402: an EVM private key with a
1111
**Payment is identical on every platform.** What differs is *connecting* the tunnel after the server returns 200. There are two equally-supported connect paths — pick by OS:
1212

1313
- **macOS & Linux:** Use the native `sentinel-dvpncli` (one `go install`, Go 1.24+), then drive it with three flag-only commands — see **"macOS & Linux — native CLI connect"** below. The CLI does NOT bundle a tunnel: it shells out to `wg-quick` for WireGuard nodes, so install **wireguard-tools** first (`apt install wireguard-tools` | `brew install wireguard-tools` | `pacman -S wireguard-tools`), or a `v2ray` binary on PATH for V2Ray nodes. Most nodes are WireGuard; bringing the interface up needs sudo. **Only exception: Fedora** — its SELinux blocks VPN interfaces and cannot be worked around programmatically; macOS, Ubuntu, Debian and Arch are fine once the tunnel binary is installed.
14-
- **Windows (heavier):** run `await setup()` from `blue-js-sdk/ai-path` once on a fresh machine before `connect()`. It auto-downloads V2Ray 5.2.1 to `~/.sentinel-sdk/bin` (no admin) and detects/auto-installs WireGuard (the MSI install needs admin). It returns `{ ready, capabilities, recommended, issues }` — if `capabilities` includes `v2ray`, you can connect with zero manual installs. See **"Windows — JS-SDK connect"** below.
14+
- **Windows (zero prerequisites):** pass `protocol: 'v2ray'` to `connect()` and you need **no admin and no manual install**. V2Ray is a userspace SOCKS5 proxy; `connect()` auto-downloads the `v2ray` binary to `~/.sentinel-sdk/bin` on first use (no admin) and covers ~70% of the network (~630 nodes). That is the complete Windows path: `npm install` → pay → `connect({ ..., protocol: 'v2ray' })`. WireGuard nodes (the other ~30%, faster) are an **optional admin-once upgrade** — the MSI install and tunnel service need elevation (`cscript run-admin.vbs setup.js` triggers one UAC prompt; a service running as SYSTEM/admin needs none). The SDK checks admin **before payment** and refuses a WireGuard node when not elevated, so no USDC or P2P is ever wasted. If you cannot elevate, stay on `protocol: 'v2ray'`. `await setup()` is optional (it pre-fetches V2Ray; `connect()` fetches it anyway). See **"Windows — JS-SDK connect"** below.
1515

1616
Both paths consume the exact same 200 response (`subscriptionId`, `planId`, `feeGranter`, `nodeAddress`) and end in the same `MsgStartSession` + direct WireGuard/V2Ray handshake.
1717

@@ -60,7 +60,7 @@ Free:
6060
7. Server returns 200 `{ provisioned, subscriptionId, planId, feeGranter, nodeAddress, nodeCountry, nodes[], sentinelTxHash, expiresAt }`.
6161
8. Agent connects, using the path for its OS (both consume the same 200 fields):
6262
- **macOS/Linux:** import the key (`printf '%s\n\n' "$MNEMONIC" | sentinel-dvpncli keys add agent --keyring.backend test`), `sentinel-dvpncli tx session-start <nodeAddress> --subscription-id <subscriptionId> --tx.fee-granter-addr <feeGranter> --tx.from-name agent --keyring.backend test`, resolve the new id with `sentinel-dvpncli query sessions --account-addr <sent1...> --subscription-id <subscriptionId> --output-format json` (newest entry), then `sentinel-dvpncli connect <sessionId>`. (See "macOS & Linux — native CLI connect".)
63-
- **Windows:** `setup()` once on a fresh machine, then `connect({ mnemonic, subscriptionId, feeGranter, nodeAddress })`. (See "Windows — JS-SDK connect".)
63+
- **Windows:** `connect({ mnemonic, subscriptionId, feeGranter, nodeAddress, protocol: 'v2ray' })` — zero admin, zero manual install (the v2ray binary auto-downloads). Omit `protocol` only if you have admin and want WireGuard nodes too. (See "Windows — JS-SDK connect".)
6464
9. `MsgStartSession` on Sentinel — gas paid by `feeGranter` (the fee grant the server created in step 6, so the agent's session start costs zero P2P).
6565
10. Direct WireGuard/V2Ray handshake — tunnel up. The operator never sees it.
6666

@@ -78,7 +78,7 @@ import {
7878
rpcQueryNodesForPlan, createRpcQueryClientWithFallback,
7979
} from 'blue-js-sdk/ai-path';
8080

81-
await setup(); // fresh machine: auto-downloads V2Ray, checks WireGuard
81+
await setup(); // optional: pre-fetch V2Ray (no admin). connect({ protocol: 'v2ray' }) auto-fetches it anyway.
8282
const wallet = await createWallet();
8383
const scheme = new ExactEvmScheme({ address, signTypedData });
8484
const client = new x402Client();
@@ -106,6 +106,8 @@ const vpn = await connect({
106106
subscriptionId: String(subscriptionId),
107107
feeGranter,
108108
nodeAddress,
109+
protocol: 'v2ray', // zero admin, zero manual install — Windows zero-prereq path.
110+
// Omit only if you have admin and want WireGuard nodes (faster, ~30% of network).
109111
});
110112
// vpn.connected === true
111113
```

0 commit comments

Comments
 (0)