File size: 5,252 Bytes
db823d5
 
 
 
 
845bf25
 
db823d5
845bf25
 
db823d5
845bf25
 
 
 
 
 
 
 
 
 
 
db823d5
845bf25
 
 
 
 
 
 
 
 
 
 
db823d5
845bf25
 
 
 
 
 
 
 
 
994ad0d
845bf25
 
 
 
994ad0d
845bf25
 
 
 
 
 
 
 
 
 
 
 
db823d5
 
 
 
845bf25
db823d5
845bf25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
994ad0d
845bf25
 
db823d5
 
994ad0d
db823d5
845bf25
db823d5
845bf25
 
 
db823d5
845bf25
 
 
 
 
 
db823d5
845bf25
db823d5
 
397b9a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Liquid Compute Gateway Multi-Mesh</title>
  <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-slate-950 text-slate-100 min-h-screen flex flex-col items-center justify-center p-4">
  <div class="max-w-xl w-full bg-slate-900 border border-slate-800 rounded-2xl p-6 shadow-2xl">
    
    <div class="flex items-center justify-between border-b border-slate-800 pb-4 mb-6">
      <div>
        <h1 class="text-xl font-bold text-white flex items-center gap-2">
          <span>⚡</span> Liquid Compute Gateway
        </h1>
        <p class="text-xs text-slate-400">Autonomous Edge Arbitrage Mesh v2.0</p>
      </div>
      <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">
        Live 🟢
      </span>
    </div>

    <form id="arbitrageForm" class="space-y-4">
      <div>
        <label for="gpu" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Select Hardware Node</label>
        <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">
          <option value="NVIDIA H200">NVIDIA H200 (Extreme Cluster - $5.30/hr)</option>
          <option value="NVIDIA H100" selected>NVIDIA H100 (Enterprise Fine-Tuning - $3.85/hr)</option>
          <option value="NVIDIA A100">NVIDIA A100 (Deep Learning Standard - $2.40/hr)</option>
          <option value="RTX 4090">RTX 4090 (Mid-tier Inference - $0.85/hr)</option>
          <option value="RTX 3090">RTX 3090 (Budget Open-Source - $0.46/hr)</option>
        </select>
      </div>

      <div>
        <label for="hours" class="block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-2">Compute Duration (Hours)</label>
        <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">
      </div>

      <div>
        <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>
        <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">
      </div>

      <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">
        Fetch Instant Mesh Route
      </button>
    </form>

    <div id="outputContainer" class="mt-6 hidden">
      <div class="flex items-center justify-between mb-2">
        <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Gateway Dispatch Response</span>
        <span id="badgeStatus" class="text-xs font-mono text-emerald-400"></span>
      </div>
      <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>
    </div>

    <div class="mt-6 pt-4 border-t border-slate-800 flex items-center justify-between text-xs text-slate-500">
      <span>Settlement: Solana SPL-USDC</span>
      <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>
    </div>

  </div>

  <script>
    const WORKER_URL = "https://compute-arbitrage-engine.sarkarirojgarofficials.workers.dev";

    document.getElementById("arbitrageForm").addEventListener("submit", async (e) => {
      e.preventDefault();
      const btn = document.getElementById("submitBtn");
      const outBox = document.getElementById("outputContainer");
      const out = document.getElementById("output");
      const badge = document.getElementById("badgeStatus");

      btn.disabled = true;
      btn.innerText = "Routing across Mesh...";

      const payload = {
        gpu: document.getElementById("gpu").value,
        hours: Number(document.getElementById("hours").value) || 1,
        tx_signature: document.getElementById("txSig").value.trim() || null
      };

      try {
        const res = await fetch(WORKER_URL, {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify(payload)
        });

        const data = await res.json();
        outBox.classList.remove("hidden");
        badge.innerText = data.status || "ROUTED";
        out.textContent = JSON.stringify(data, null, 2);
      } catch (err) {
        outBox.classList.remove("hidden");
        badge.innerText = "ERROR";
        out.textContent = JSON.stringify({ error: "Failed to connect to Edge Gateway", details: err.message }, null, 2);
      } finally {
        btn.disabled = false;
        btn.innerText = "Fetch Instant Mesh Route";
      }
    });
  </script>
</body>
</html>