|
55 | 55 | "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"], |
56 | 56 | "platforms": "Payment is identical everywhere; only the connect step differs by OS.", |
57 | 57 | "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'.", |
59 | 59 | "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.", |
61 | 61 | "disconnect": "JS: disconnect() ends session on-chain (fee-granted), tears down tunnel. CLI: sentinel-dvpncli tx session-cancel <sessionId>", |
62 | 62 | "nodeFallback": "If provision.nodeAddress is empty, call rpcQueryNodesForPlan(rpc, provision.planId, { status: 1 }) and pick from items[]" |
63 | 63 | }, |
@@ -1980,7 +1980,7 @@ <h3 style="font-size: 13px; color: var(--accent); margin-bottom: 18px; letter-sp |
1980 | 1980 | <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> |
1981 | 1981 | <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> |
1982 | 1982 |
|
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> |
1984 | 1984 | <span class="kw">await</span> <span class="fn">setup</span>()<span class="op">;</span> |
1985 | 1985 |
|
1986 | 1986 | <span class="cm">// Create a Sentinel wallet (one-time — save the mnemonic!)</span> |
@@ -2048,11 +2048,12 @@ <h3 style="font-size: 13px; color: var(--accent); margin-bottom: 18px; letter-sp |
2048 | 2048 | <span class="prop">nodeAddress</span><span class="op">,</span> <span class="cm">// from provision or fallback query</span> |
2049 | 2049 | <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> |
2050 | 2050 | <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> |
2051 | 2052 | })<span class="op">;</span> |
2052 | 2053 |
|
2053 | 2054 | <span class="cm">// All traffic now routes through encrypted P2P tunnel</span> |
2054 | 2055 | 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> |
2056 | 2057 | <span class="cm">// sessionId: '39269345', nodeAddress: 'sentnode1...' }</span> |
2057 | 2058 |
|
2058 | 2059 | <span class="cm">// Disconnect also uses fee grant — 0 tokens needed</span> |
@@ -2379,7 +2380,7 @@ <h2>End-to-end: USDC to VPN tunnel</h2> |
2379 | 2380 | <span class="fn">rpcQueryNodesForPlan</span><span class="op">,</span> <span class="fn">createRpcQueryClientWithFallback</span><span class="op">,</span> |
2380 | 2381 | } <span class="kw">from</span> <span class="str">'blue-js-sdk/ai-path'</span><span class="op">;</span> |
2381 | 2382 |
|
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> |
2383 | 2384 | <span class="kw">await</span> <span class="fn">setup</span>()<span class="op">;</span> |
2384 | 2385 |
|
2385 | 2386 | <span class="cm">// ── Step 1: Create Sentinel wallet (one-time) ──</span> |
@@ -2428,6 +2429,7 @@ <h2>End-to-end: USDC to VPN tunnel</h2> |
2428 | 2429 | <span class="prop">nodeAddress</span><span class="op">,</span> |
2429 | 2430 | <span class="prop">subscriptionId</span><span class="op">:</span> String(provision<span class="op">.</span>subscriptionId)<span class="op">,</span> |
2430 | 2431 | <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> |
2431 | 2433 | })<span class="op">;</span> |
2432 | 2434 |
|
2433 | 2435 | 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> |
2457 | 2459 | <span class="str">"sentinelTxHash"</span>: <span class="str">"2C1CFE..."</span>, |
2458 | 2460 | <span class="str">"expiresAt"</span>: <span class="str">"2026-05-14T..."</span>, |
2459 | 2461 | <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> |
2461 | 2463 | }</code></pre> |
2462 | 2464 | </div> |
2463 | 2465 | </div> |
|
0 commit comments