You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For AI agents. Run these checklists programmatically before, during, and after VPN operations. Every check includes the exact code, expected result, and failure response. Assume the wallet has sufficient P2P for bandwidth consumption.
How to Use
import{setup,getEnvironment,createWallet,importWallet,getBalance,discoverNodes,getNodeInfo,getNetworkStats,estimateCost,PRICING,recommend,connect,disconnect,status,isVpnActive,verify,onEvent,}from'./index.js';// or 'blue-agent-connect' when published to npm
Each checklist item has:
Check: what to verify
Code: exact call
Pass: expected result
Fail: what the failure means and what to do
Run all checks in order. Stop at the first CRITICAL failure. WARNING items can be bypassed with degraded capability.
Checklist 1: Pre-Flight (Before Any Connection)
Run once per session. Verifies the machine can operate.
WARNING. Leftover WireGuard tunnels from a previous crash. Run setup() with autoClean or manually uninstall: wireguard.exe /uninstalltunnelservice wgsent0
conflicts.length
0
WARNING. Conflicting VPN software detected (NordVPN, ExpressVPN, etc.). May interfere with tunnel routing.
Auto-fixed above. Without this, Node.js 20+ uses fetch adapter which silently fails on self-signed node certificates. The connect() function handles this automatically, but verify if making direct SDK calls.
Checklist 2: Wallet & Funding
Run before every connection attempt.
2.1 Wallet Valid
constbal=awaitgetBalance(process.env.MNEMONIC);
Check
Pass
Fail
No exception thrown
Call succeeds
CRITICAL. If INVALID_MNEMONIC: check word count (must be 12 or 24), check for typos, verify BIP39 English wordlist. If network error: LCD endpoints may be down — retry in 30s.
bal.address starts with 'sent1'
true
CRITICAL. Wrong address prefix means wrong chain derivation.
WARNING. Primary LCD down. The SDK has 4 failover endpoints and handles this automatically. If all 4 fail, check your internet connection.
3.2 Node Discovery
constnodes=awaitdiscoverNodes({quick: true});
Check
Pass
Fail
nodes.length > 0
true
CRITICAL. Zero nodes returned. Chain may be down or LCD endpoints unreachable. Retry in 60s.
nodes.length > 100
true
WARNING. Unusually few nodes. Possible pagination issue or chain maintenance. Connection may still work.
3.3 Network Health
conststats=awaitgetNetworkStats();
Check
Pass
Fail
stats.totalNodes > 0
true
CRITICAL. Network appears empty.
stats.byProtocol.v2ray > 0 or stats.byProtocol.wireguard > 0
At least one > 0
CRITICAL. No nodes available for any protocol.
Checklist 4: Connection
Run during the connect() call. Use onProgress to track each phase.
4.1 Progress Monitoring
constphases=newSet();letlastPhase=null;letlastError=null;constvpn=awaitconnect({mnemonic: process.env.MNEMONIC,// fullTunnel: true (default) for privacy, or protocol: 'v2ray' for per-app split tunnelonProgress: (step,detail)=>{phases.add(step);lastPhase=step;// Log for diagnostics: console.log(`[${step}] ${detail}`);},});
4.2 Phase Completion Verification
After connect() returns successfully, verify all critical phases were reached:
Phase
Expected in phases
If Missing
'wallet'
Yes
CRITICAL. Wallet derivation never started. Check mnemonic.
'session'
Yes
CRITICAL. Node selection or payment never started. Check balance, check node availability.
'handshake'
Yes
CRITICAL. Handshake phase never reached. Payment may have failed — check lastError. Session may exist on-chain (tokens spent).
'tunnel'
Yes
CRITICAL. Tunnel installation never started. Handshake may have failed.
'verify'
Yes
WARNING. Verification phase was skipped. Tunnel may still work — proceed to manual verification (Checklist 5).
4.3 Connect Result Validation
const{ sessionId, protocol, nodeAddress, socksPort, ip }=vpn;
Check
Pass
Fail
sessionId defined and non-empty
true
CRITICAL. No session ID means the blockchain TX may have failed. Check wallet balance — if it decreased, the session exists but ID extraction failed.
protocol is 'wireguard' or 'v2ray'
true
WARNING. Unknown protocol '${protocol}'. Connection may still work.
nodeAddress starts with 'sentnode1'
true
WARNING. Node address missing or malformed. Connection may still work if sessionId is valid.
If V2Ray: socksPort is a number > 0
true
WARNING. No SOCKS5 port. V2Ray may not be routing traffic. Verify manually.
ip !== null
true
WARNING. IP verification failed (ipify.org may be unreachable through this node). Tunnel may still work. Run Checklist 5 to confirm.
ip !== yourOriginalIp
true
WARNING. IP didn't change. Possible split tunnel mode or full tunnel not installed. May be expected if fullTunnel: false.
Checklist 5: Post-Connection Verification
Run immediately after connect() succeeds. Confirms the tunnel is actually working.
5.1 Connection State
constactive=isVpnActive();constst=status();
Check
Pass
Fail
active
true
CRITICAL. isVpnActive() returns false immediately after connect. Tunnel may have collapsed. Disconnect and retry with a different node.
st.connected
true
CRITICAL. Same as above — status shows disconnected.
st.sessionId matches vpn.sessionId
true
WARNING. Session ID mismatch. State may be stale.
st.protocol matches vpn.protocol
true
WARNING. Protocol mismatch. Likely a state tracking issue — tunnel may still work.
5.2 Traffic Verification
constv=awaitverify();
Check
Pass
Fail
v.connected
true
CRITICAL. Tunnel down during verification.
v.verified
true
CRITICAL. Cannot confirm traffic flows through the tunnel. The tunnel may be installed but not routing. Disconnect and try a different node.
v.ip !== null
true
WARNING. IP check failed but verified may still be true from SDK verification. If both ip === null and verified === false, the tunnel is dead.
5.3 Data Transfer Test
lettestRes;if(vpn.socksPort){// V2Ray: test through SOCKS5 proxyconstaxios=(awaitimport('axios')).default;const{ SocksProxyAgent }=awaitimport('socks-proxy-agent');constagent=newSocksProxyAgent(`socks5h://127.0.0.1:${vpn.socksPort}`);testRes=awaitaxios.get('https://api.ipify.org?format=json',{httpAgent: agent,httpsAgent: agent,timeout: 15000,adapter: 'http',});}else{// WireGuard: traffic routes automatically through the tunnelconstaxios=(awaitimport('axios')).default;testRes=awaitaxios.get('https://api.ipify.org?format=json',{timeout: 15000,adapter: 'http',});}
Check
Pass
Fail
Response received within timeout
true
WARNING. Tunnel may be slow or congested. Increase timeout to 30s and retry once. If still fails, try a different node.
testRes.data.ip is not your real IP
true
CRITICAL (WireGuard full tunnel). Traffic is not routing through the VPN. NORMAL (V2Ray split tunnel) — only SOCKS5-proxied traffic routes through the tunnel.
testRes.status === 200
true
WARNING. Non-200 response. The test endpoint may be down. Try https://ifconfig.me as fallback.
5.4 DNS Leak Check
// Verify DNS resolves through the tunnel, not your ISPconstdnsRes=awaitaxios.get('https://1.1.1.1/cdn-cgi/trace',{httpAgent: agent,httpsAgent: agent,timeout: 10000,adapter: 'http',// V2Ray// For WireGuard: omit agents, DNS is enforced by tunnel config});
Check
Pass
Fail
Response received
true
WARNING. Cloudflare trace endpoint unreachable. DNS may still be correct — this is a secondary check.
Response does not contain your real ISP IP
true
WARNING. Possible DNS leak. If using WireGuard, check that DNS = 10.8.0.1 is in the config. If using V2Ray, verify SOCKS5 proxy is routing DNS queries.
Checklist 6: Runtime Health Monitoring
Run periodically while connected (every 30-60 seconds).
6.1 Connection Still Active
constalive=isVpnActive();constst=status();
Check
Pass
Fail
alive
true
CRITICAL. Connection lost. Begin reconnection (Checklist 8).
st.connected
true
CRITICAL. Same — status shows disconnected.
st.uptimeMs > previousUptimeMs
true
WARNING. Uptime not advancing. State may be stale. Verify with verify().
6.2 Traffic Still Flows
constv=awaitverify();
Check
Pass
Fail
v.verified
true
CRITICAL. Tunnel is up but traffic has stopped flowing. Disconnect and reconnect.
Time since last successful verify < 120s
true
WARNING. Verification hasn't succeeded in 2+ minutes. Network may be degrading.
6.3 Balance Monitor (Every 5 Minutes)
constbal=awaitgetBalance(process.env.MNEMONIC);
Check
Pass
Fail
bal.funded
true
WARNING. Balance dropping below threshold. Plan for disconnection or top-up. Session continues until data allocation is consumed, but new sessions cannot be created.
bal.udvpn > previousBalance - expectedConsumption
true
INFO. Track spend rate. If balance is dropping faster than expected, session may have an issue.
Checklist 7: Disconnection
Run when work is complete or on shutdown.
7.1 Graceful Disconnect
constresult=awaitdisconnect();
Check
Pass
Fail
result.disconnected
true
WARNING. Disconnect reported failure, but tunnel is likely down. Proceed to verification.
No exception thrown
true
WARNING. Best-effort — the tunnel was probably torn down. Continue to post-disconnect verification.
7.2 Post-Disconnect Verification
constactive=isVpnActive();constst=status();
Check
Pass
Fail
active
false
CRITICAL. Tunnel still active after disconnect. Orphaned tunnel. Attempt: await disconnect() again. If still active, escalate to manual cleanup (7.3).
CRITICAL. Orphaned tunnel survived emergency cleanup. Manual intervention required: wireguard.exe /uninstalltunnelservice wgsent0 (WireGuard) or kill V2Ray process by PID (NOT taskkill /F /IM node.exe — that kills your own process).
7.4 System State Clean
// Verify no system proxy left behind (V2Ray)// On Windows, check registry or run:// netsh winhttp show proxy
Check
Pass
Fail
No system proxy pointing to dead SOCKS5 port
true
WARNING. Orphaned system proxy will break system HTTP traffic. Clear it: netsh winhttp reset proxy
Checklist 8: Error Recovery
Run when any connection attempt fails or when runtime health check fails.
Timeout or cancellation. Increase timeout or check network.
SESSION_POISONED
Fatal
Previous session is corrupted. Do not reuse. Fresh connection needed.
NODE_OFFLINE
Retryable
Try a different node.
NODE_CLOCK_DRIFT
Retryable
Skip this node. Try another.
V2RAY_ALL_FAILED
Retryable
All transports failed. Try a WireGuard node or different V2Ray node.
WG_NO_CONNECTIVITY
Retryable
Tunnel installed but dead. Try a different node.
BROADCAST_FAILED
Retryable
Chain TX failed. Wait 30s, retry.
ALL_NODES_FAILED
Retryable
Every candidate failed. Wait 60s, retry with different country or protocol.
ALL_ENDPOINTS_FAILED
Retryable
LCD/RPC all down. Check internet. Wait 60s, retry.
V2RAY_NOT_FOUND
Setup
Run setup() to install V2Ray binary.
WG_NOT_AVAILABLE
Setup
Install WireGuard or retry with protocol: 'v2ray'.
SESSION_EXISTS
Recoverable
Active session found. SDK reuses it automatically. If it keeps failing, wait for session expiry.
PARTIAL_CONNECTION_FAILED
Recoverable
Payment succeeded but tunnel failed. Session exists on-chain. Retry connection to same node — session will be reused (no double payment).
8.2 Retry Strategy
constMAX_RETRIES=3;constBACKOFF=[5000,10000,20000];// msfor(letattempt=0;attempt<MAX_RETRIES;attempt++){try{constvpn=awaitconnect(opts);// Run Checklist 4 + 5break;// Success}catch(err){if(['INVALID_MNEMONIC','INSUFFICIENT_BALANCE','ABORTED'].includes(err.code)){throwerr;// Fatal — do not retry}if(attempt<MAX_RETRIES-1){awaitnewPromise(r=>setTimeout(r,BACKOFF[attempt]));}else{throwerr;// Exhausted retries}}}
8.3 Post-Failure Cleanup
After any failed connection attempt:
// Always verify no orphaned statetry{awaitdisconnect();}catch{/* best effort */}conststillActive=isVpnActive();if(stillActive){const{ emergencyCleanupSync }=awaitimport('sentinel-dvpn-sdk');emergencyCleanupSync();}
Check
Pass
Fail
isVpnActive() === false after cleanup
true
Orphaned tunnel exists. See Checklist 7.3.
Checklist 9: Full End-to-End Validation
Run this as a single script to verify the entire pipeline works. This is the definitive test.
// Load mnemonic from .env (use dotenv or manual parsing)// import 'dotenv/config'; // Requires: npm install dotenvimport{setup,getEnvironment,getBalance,estimateCost,recommend,connect,disconnect,status,isVpnActive,verify,}from'./index.js';// or 'blue-agent-connect' when published to npmconstresults={preflight: false,wallet: false,balance: false,costEstimate: false,recommendation: false,connection: false,stateConsistent: false,trafficVerified: false,disconnection: false,cleanState: false,};try{// ── Preflight ──constenv=getEnvironment();if(env.capabilities.length===0)thrownewError('No tunnel protocol available');constcheck=awaitsetup();if(!check.ready)thrownewError(`Setup issues: ${check.issues.join(', ')}`);results.preflight=true;// ── Wallet ──constbal=awaitgetBalance(process.env.MNEMONIC);if(!bal.address.startsWith('sent1'))thrownewError('Bad address');results.wallet=true;// ── Balance ──if(!bal.funded)thrownewError(`Underfunded: ${bal.p2p}`);results.balance=true;// ── Cost Estimate ──constcost=awaitestimateCost({gigabytes: 1});if(bal.udvpn<cost.grandTotal.udvpn)thrownewError(`Need ${cost.grandTotal.p2p}, have ${bal.p2p}`);results.costEstimate=true;// ── Recommendation ──constrec=awaitrecommend({priority: 'reliability'});if(rec.action==='cannot-connect')thrownewError('No nodes available');results.recommendation=true;// ── Connection ──constphases=newSet();constvpn=awaitconnect({mnemonic: process.env.MNEMONIC,fullTunnel: false,onProgress: (step)=>phases.add(step),timeout: 120000,});if(!vpn.sessionId)thrownewError('No session ID');if(!phases.has('wallet'))thrownewError('Wallet phase missing');if(!phases.has('session'))thrownewError('Session phase missing');if(!phases.has('handshake'))thrownewError('Handshake phase missing');if(!phases.has('tunnel'))thrownewError('Tunnel phase missing');results.connection=true;// ── State Consistency ──constst=status();if(!st.connected)thrownewError('Status says disconnected after connect');if(!isVpnActive())thrownewError('isVpnActive false after connect');if(st.sessionId!==vpn.sessionId)thrownewError('Session ID mismatch');results.stateConsistent=true;// ── Traffic Verification ──constv=awaitverify();if(!v.verified)thrownewError('Traffic verification failed');results.trafficVerified=true;// ── Disconnection ──awaitdisconnect();results.disconnection=true;// ── Clean State ──if(isVpnActive())thrownewError('Still active after disconnect');if(status().connected)thrownewError('Status still connected after disconnect');results.cleanState=true;}catch(err){console.error(`FAILED: ${err.message} (code: ${err.code||'none'})`);}finally{// Ensure cleanup even on failuretry{awaitdisconnect();}catch{}}// ── Report ──console.log('\n═══ End-to-End Checklist Results ═══');constentries=Object.entries(results);constpassed=entries.filter(([,v])=>v).length;consttotal=entries.length;for(const[name,ok]ofentries){console.log(` ${ok ? 'PASS' : 'FAIL'}${name}`);}console.log(`\n ${passed}/${total} checks passed.`);if(passed===total){console.log(' All systems operational. AI Path is fully functional.');}else{constfirstFail=entries.find(([,v])=>!v)?.[0];console.log(` First failure: ${firstFail}. Fix this before retrying.`);}
Expected Output (All Pass)
═══ End-to-End Checklist Results ═══
PASS preflight
PASS wallet
PASS balance
PASS costEstimate
PASS recommendation
PASS connection
PASS stateConsistent
PASS trafficVerified
PASS disconnection
PASS cleanState
10/10 checks passed.
All systems operational. AI Path is fully functional.