global-ai-data-node commited on
Commit
845bf25
·
verified ·
1 Parent(s): 994ad0d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +80 -46
index.html CHANGED
@@ -3,71 +3,105 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Autonomous Compute Arbitrage Gateway</title>
7
- <style>
8
- body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0f172a; color: #f8fafc; padding: 20px; display: flex; justify-content: center; }
9
- .card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; max-width: 540px; width: 100%; padding: 24px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
10
- h2 { margin-top: 0; color: #38bdf8; font-size: 1.4rem; }
11
- label { display: block; margin-top: 15px; font-weight: 600; color: #94a3b8; font-size: 0.85rem; }
12
- select, input { width: 100%; padding: 10px; margin-top: 6px; border-radius: 6px; border: 1px solid #475569; background: #0f172a; color: #fff; box-sizing: border-box; }
13
- button { width: 100%; margin-top: 18px; padding: 12px; background: #0284c7; color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 0.95rem; }
14
- button:hover { background: #0369a1; }
15
- .wallet-box { margin-top: 15px; padding: 10px; background: #022c22; border: 1px solid #059669; border-radius: 6px; font-size: 0.8rem; word-break: break-all; color: #6ee7b7; }
16
- .output { margin-top: 18px; background: #0f172a; border: 1px solid #334155; border-radius: 6px; padding: 12px; font-family: monospace; font-size: 0.82rem; color: #4ade80; white-space: pre-wrap; word-break: break-all; }
17
- </style>
18
  </head>
19
- <body>
20
- <div class="card">
21
- <h2>⚡ Liquid Compute Dispatcher</h2>
22
- <p style="font-size: 0.82rem; color: #94a3b8;">Decentralized GPU Compute Allocation & Real-Time Settlement Router</p>
23
 
24
- <label for="gpu">Select Compute Hardware</label>
25
- <select id="gpu">
26
- <option value="NVIDIA H100">NVIDIA H100 (Spread: $2.70/hr)</option>
27
- <option value="NVIDIA A100">NVIDIA A100 (Spread: $1.68/hr)</option>
28
- <option value="RTX 4090">RTX 4090 (Spread: $0.57/hr)</option>
29
- </select>
 
 
 
 
 
30
 
31
- <label for="hours">Duration (Hours): <span id="hrs-val">5</span> hrs</label>
32
- <input type="range" id="hours" min="1" max="168" value="5" oninput="document.getElementById('hrs-val').innerText = this.value">
 
 
 
 
 
 
 
 
 
33
 
34
- <div class="wallet-box">
35
- <strong>Official Settlement Target (Solana SPL-USDC):</strong><br>
36
- <code>3xdY7ZzunKpptQorAadst2GkfDX1mz7aqZsrwqWSioQX</code>
37
- </div>
 
 
 
 
 
38
 
39
- <label for="txsig">Solana Transaction Signature (Optional for Quote, Required for Node Dispatch)</label>
40
- <input type="text" id="txsig" placeholder="Paste Solana TX hash to verify on-chain">
 
 
41
 
42
- <button onclick="dispatchJob()">🚀 Calculate Quote / Verify & Dispatch Node</button>
 
 
 
 
 
 
 
 
 
 
 
43
 
44
- <div id="result" class="output" style="display:none;"></div>
45
  </div>
46
 
47
  <script>
48
- async function dispatchJob() {
49
- const gpu = document.getElementById('gpu').value;
50
- const hours = document.getElementById('hours').value;
51
- const txSig = document.getElementById('txsig').value.trim();
52
- const out = document.getElementById('result');
53
- out.style.display = 'block';
54
- out.innerText = 'Connecting to Cloudflare Sentinel & Solana RPC...';
55
 
56
- try {
57
- const payload = { gpu: gpu, hours: Number(hours) };
58
- if (txSig) payload.tx_signature = txSig;
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
- const res = await fetch("https://compute-arbitrage-engine.sarkarirojgarofficials.workers.dev/", {
 
61
  method: "POST",
62
  headers: { "Content-Type": "application/json" },
63
  body: JSON.stringify(payload)
64
  });
 
65
  const data = await res.json();
66
- out.innerText = JSON.stringify(data, null, 2);
 
 
67
  } catch (err) {
68
- out.innerText = 'Error: ' + err.message;
 
 
 
 
 
69
  }
70
- }
71
  </script>
72
  </body>
73
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Liquid Compute Gateway Multi-Mesh</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
 
 
 
 
 
 
 
 
 
 
8
  </head>
9
+ <body class="bg-slate-950 text-slate-100 min-h-screen flex flex-col items-center justify-center p-4">
10
+ <div class="max-w-xl w-full bg-slate-900 border border-slate-800 rounded-2xl p-6 shadow-2xl">
 
 
11
 
12
+ <div class="flex items-center justify-between border-b border-slate-800 pb-4 mb-6">
13
+ <div>
14
+ <h1 class="text-xl font-bold text-white flex items-center gap-2">
15
+ <span>⚡</span> Liquid Compute Gateway
16
+ </h1>
17
+ <p class="text-xs text-slate-400">Autonomous Edge Arbitrage Mesh v2.0</p>
18
+ </div>
19
+ <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-950 text-emerald-400 border border-emerald-800">
20
+ Live 🟢
21
+ </span>
22
+ </div>
23
 
24
+ <form id="arbitrageForm" class="space-y-4">
25
+ <div>
26
+ <label for="gpu" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Select Hardware Node</label>
27
+ <select id="gpu" class="w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2.5 text-sm text-white focus:outline-none focus:border-indigo-500">
28
+ <option value="NVIDIA H200">NVIDIA H200 (Extreme Cluster - $5.30/hr)</option>
29
+ <option value="NVIDIA H100" selected>NVIDIA H100 (Enterprise Fine-Tuning - $3.85/hr)</option>
30
+ <option value="NVIDIA A100">NVIDIA A100 (Deep Learning Standard - $2.40/hr)</option>
31
+ <option value="RTX 4090">RTX 4090 (Mid-tier Inference - $0.85/hr)</option>
32
+ <option value="RTX 3090">RTX 3090 (Budget Open-Source - $0.46/hr)</option>
33
+ </select>
34
+ </div>
35
 
36
+ <div>
37
+ <label for="hours" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Compute Duration (Hours)</label>
38
+ <input type="number" id="hours" min="1" max="168" value="1" class="w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2.5 text-sm text-white focus:outline-none focus:border-indigo-500">
39
+ </div>
40
+
41
+ <div>
42
+ <label for="txSig" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Solana Settlement Tx Signature (Optional for Quote)</label>
43
+ <input type="text" id="txSig" placeholder="Paste SPL-USDC Tx Hash after payment" class="w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2.5 text-sm text-white focus:outline-none focus:border-indigo-500 font-mono">
44
+ </div>
45
 
46
+ <button type="submit" id="submitBtn" class="w-full bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white font-medium py-2.5 rounded-lg text-sm transition-all shadow-lg shadow-indigo-600/30">
47
+ Fetch Instant Mesh Route
48
+ </button>
49
+ </form>
50
 
51
+ <div id="outputContainer" class="mt-6 hidden">
52
+ <div class="flex items-center justify-between mb-2">
53
+ <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Gateway Dispatch Response</span>
54
+ <span id="badgeStatus" class="text-xs font-mono text-emerald-400"></span>
55
+ </div>
56
+ <pre id="output" class="bg-slate-950 border border-slate-800 rounded-lg p-3 text-xs font-mono text-slate-300 overflow-x-auto max-h-64"></pre>
57
+ </div>
58
+
59
+ <div class="mt-6 pt-4 border-t border-slate-800 flex items-center justify-between text-xs text-slate-500">
60
+ <span>Settlement: Solana SPL-USDC</span>
61
+ <a href="https://compute-arbitrage-engine.sarkarirojgarofficials.workers.dev/openapi.json" target="_blank" class="text-indigo-400 hover:underline">OpenAPI 3.0.0 Spec</a>
62
+ </div>
63
 
 
64
  </div>
65
 
66
  <script>
67
+ const WORKER_URL = "https://compute-arbitrage-engine.sarkarirojgarofficials.workers.dev";
 
 
 
 
 
 
68
 
69
+ document.getElementById("arbitrageForm").addEventListener("submit", async (e) => {
70
+ e.preventDefault();
71
+ const btn = document.getElementById("submitBtn");
72
+ const outBox = document.getElementById("outputContainer");
73
+ const out = document.getElementById("output");
74
+ const badge = document.getElementById("badgeStatus");
75
+
76
+ btn.disabled = true;
77
+ btn.innerText = "Routing across Mesh...";
78
+
79
+ const payload = {
80
+ gpu: document.getElementById("gpu").value,
81
+ hours: Number(document.getElementById("hours").value) || 1,
82
+ tx_signature: document.getElementById("txSig").value.trim() || null
83
+ };
84
 
85
+ try {
86
+ const res = await fetch(WORKER_URL, {
87
  method: "POST",
88
  headers: { "Content-Type": "application/json" },
89
  body: JSON.stringify(payload)
90
  });
91
+
92
  const data = await res.json();
93
+ outBox.classList.remove("hidden");
94
+ badge.innerText = data.status || "ROUTED";
95
+ out.textContent = JSON.stringify(data, null, 2);
96
  } catch (err) {
97
+ outBox.classList.remove("hidden");
98
+ badge.innerText = "ERROR";
99
+ out.textContent = JSON.stringify({ error: "Failed to connect to Edge Gateway", details: err.message }, null, 2);
100
+ } finally {
101
+ btn.disabled = false;
102
+ btn.innerText = "Fetch Instant Mesh Route";
103
  }
104
+ });
105
  </script>
106
  </body>
107
  </html>