majorly improve SOL push UI + allow for more customization.
This commit is contained in:
@@ -9,112 +9,153 @@
|
||||
<link rel="stylesheet" href="/vendor/inter/400.css" />
|
||||
<link rel="stylesheet" href="/vendor/inter/600.css" />
|
||||
<link rel="stylesheet" href="/vendor/inter/700.css" />
|
||||
<link rel="stylesheet" href="/assets/tailwind.css" />
|
||||
<link rel="stylesheet" href="/assets/tailwind.css" />
|
||||
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" />
|
||||
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
|
||||
<link rel="stylesheet" href="/assets/main.css" />
|
||||
<link rel="stylesheet" href="/assets/custom.css" />
|
||||
<style>
|
||||
#rpc-url,
|
||||
#rpc-url option {
|
||||
color: #f1f5f9;
|
||||
background-color: #0f172a;
|
||||
}
|
||||
</style>
|
||||
<script defer src="/assets/toast.js"></script>
|
||||
<script defer src="/assets/ripple.js"></script>
|
||||
</head>
|
||||
<body class="min-h-screen bg-slate-950 text-slate-100">
|
||||
<header id="top-nav"></header>
|
||||
<main class="px-5 py-6">
|
||||
<div class="max-w-3xl mx-auto flex flex-col gap-5">
|
||||
<main class="max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div class="mb-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold flex items-center gap-2">
|
||||
<i class="fa-solid fa-link-slash text-purple-400"></i> Solana Memo Publisher
|
||||
</h1>
|
||||
<p class="text-slate-400 mt-1">
|
||||
Publish an encrypted server URL as a Solana memo transaction.
|
||||
Clients configured with Solana lookup will query this address to find the server.
|
||||
<h1 class="text-2xl font-bold text-slate-100">Solana Memo Publisher</h1>
|
||||
<p class="text-slate-400 text-sm mt-1 max-w-2xl">
|
||||
Publish encrypted connection endpoints for clients configured to resolve this server through Solana.
|
||||
</p>
|
||||
</div>
|
||||
<div class="inline-flex self-start sm:self-auto items-center gap-2 px-3 py-1.5 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-xs font-medium text-emerald-300">
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-emerald-400"></span>
|
||||
Mainnet
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-slate-900/70 border border-slate-800 rounded-lg p-5 flex flex-col gap-5">
|
||||
|
||||
<!-- RPC Endpoint -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="rpc-url">RPC Endpoint</label>
|
||||
<select id="rpc-url"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg text-slate-100 focus:outline-none focus:border-purple-500 transition-colors">
|
||||
</select>
|
||||
<div id="custom-rpc-wrapper" class="hidden mt-2">
|
||||
<input type="text" id="custom-rpc-url" placeholder="https://your-rpc-endpoint.com"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-purple-500 transition-colors" />
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<section class="lg:col-span-2 bg-slate-900/60 border border-slate-800 rounded-xl p-5 sm:p-6 space-y-6">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex items-center justify-center w-9 h-9 rounded-lg bg-violet-500/10 border border-violet-500/30">
|
||||
<i class="fa-solid fa-paper-plane text-violet-400"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold">Publish connection memo</h2>
|
||||
<p class="text-sm text-slate-400">Choose a provider, sign with your wallet, and publish the latest server list.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Private Key -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="private-key">Solana Private Key (Base58)</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="password" id="private-key" placeholder="Enter your Solana wallet private key"
|
||||
class="flex-1 min-w-0 px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-purple-500 transition-colors font-mono text-sm" />
|
||||
<button type="button" id="toggle-key-visibility"
|
||||
class="shrink-0 px-3 py-2 text-xs text-slate-400 hover:text-slate-200 bg-slate-800/60 border border-slate-700 rounded-lg transition-colors">
|
||||
<i class="fa-solid fa-eye"></i> Show
|
||||
</button>
|
||||
<div class="space-y-5 pt-1">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="server-url">Server URLs</label>
|
||||
<textarea id="server-url" rows="3" placeholder="wss://your-server:5173"
|
||||
class="w-full px-3 py-2.5 rounded-lg border border-slate-700 bg-slate-950/70 text-slate-100 placeholder-slate-500 font-mono text-sm resize-y focus:outline-none focus:ring-2 focus:ring-violet-500/60 focus:border-violet-500"></textarea>
|
||||
<p class="text-xs text-slate-500 mt-1.5">Enter one WebSocket URL per line. Clients try them in the published order.</p>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-1">
|
||||
<i class="fa-solid fa-shield-halved text-amber-400"></i>
|
||||
Your private key is never stored — it's used in-memory only for signing and discarded immediately.
|
||||
</p>
|
||||
<div id="wallet-info" class="hidden mt-2 p-2 bg-slate-800/40 rounded-lg text-xs text-slate-400">
|
||||
<span id="wallet-address"></span>
|
||||
<span id="wallet-balance" class="ml-2"></span>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="rpc-url">RPC provider</label>
|
||||
<select id="rpc-url"
|
||||
class="w-full px-3 py-2.5 rounded-lg border border-slate-700 bg-slate-950/70 text-slate-100 focus:outline-none focus:ring-2 focus:ring-violet-500/60 focus:border-violet-500">
|
||||
</select>
|
||||
<div id="custom-rpc-wrapper" class="hidden mt-2">
|
||||
<input type="url" id="custom-rpc-url" placeholder="https://rpc.example.com"
|
||||
class="w-full px-3 py-2.5 rounded-lg border border-slate-700 bg-slate-950/70 text-slate-100 placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-violet-500/60 focus:border-violet-500" />
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-1.5">Used for this transaction only.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="private-key">Wallet private key</label>
|
||||
<div class="flex items-stretch">
|
||||
<input type="password" id="private-key" autocomplete="off" placeholder="Base58 private key"
|
||||
class="flex-1 min-w-0 px-3 py-2.5 rounded-l-lg border border-r-0 border-slate-700 bg-slate-950/70 text-slate-100 placeholder-slate-500 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-violet-500/60 focus:border-violet-500" />
|
||||
<button type="button" id="toggle-key-visibility"
|
||||
class="shrink-0 px-3 rounded-r-lg border border-slate-700 bg-slate-800 hover:bg-slate-700 text-xs text-slate-300 transition-colors">
|
||||
<i class="fa-solid fa-eye"></i> Show
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 mt-1.5"><i class="fa-solid fa-shield-halved text-amber-400 mr-1"></i>Used in memory and never stored.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="wallet-info" class="hidden rounded-lg border border-slate-800 bg-slate-950/60 px-3 py-2 text-xs text-slate-400">
|
||||
<i class="fa-solid fa-wallet text-violet-400 mr-1.5"></i>
|
||||
<span id="wallet-address"></span><span id="wallet-balance" class="ml-2"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Server URL -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2" for="server-url">Server URL to Publish</label>
|
||||
<input type="text" id="server-url" placeholder="wss://your-server:5173"
|
||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-purple-500 transition-colors" />
|
||||
<p class="text-xs text-slate-500 mt-1">
|
||||
The server URL that clients will connect to. Multiple URLs can be separated by newlines.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="flex gap-3 flex-wrap">
|
||||
<div class="pt-5 border-t border-slate-800 flex flex-col-reverse sm:flex-row sm:items-center sm:justify-end gap-3">
|
||||
<button type="button" id="preview-btn"
|
||||
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-slate-700 hover:bg-slate-600 text-slate-200 border border-slate-600 transition-colors">
|
||||
class="inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-medium text-sm transition-colors disabled:opacity-50">
|
||||
<i class="fa-solid fa-eye"></i> Preview Memo
|
||||
</button>
|
||||
<button type="button" id="publish-btn"
|
||||
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-purple-700 hover:bg-purple-600 text-white border border-purple-600 transition-colors">
|
||||
class="inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-lg bg-violet-600 hover:bg-violet-500 text-white border border-violet-500 font-semibold text-sm shadow-lg shadow-violet-950/30 transition-colors disabled:opacity-50">
|
||||
<i class="fa-solid fa-paper-plane"></i> Publish to Solana
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Output -->
|
||||
<div id="output-section" class="hidden">
|
||||
<label class="block text-sm font-medium text-slate-300 mb-2">Result</label>
|
||||
<div id="output" class="p-3 bg-slate-800/60 border border-slate-700 rounded-lg text-sm font-mono break-all whitespace-pre-wrap max-h-64 overflow-y-auto">
|
||||
<div id="output-section" class="hidden pt-5 border-t border-slate-800">
|
||||
<div class="flex items-center gap-2 mb-2 text-sm font-medium text-slate-300">
|
||||
<i class="fa-solid fa-terminal text-violet-400"></i> Result
|
||||
</div>
|
||||
<div id="output" class="p-4 bg-slate-950/70 border border-slate-800 rounded-lg text-sm font-mono break-all whitespace-pre-wrap max-h-72 overflow-y-auto"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="pt-5 border-t border-slate-800">
|
||||
<div class="flex items-center gap-2 mb-3">
|
||||
<i class="fa-solid fa-circle-info text-violet-400"></i>
|
||||
<h3 class="text-sm font-semibold text-slate-300">Publishing workflow</h3>
|
||||
</div>
|
||||
<ol class="grid grid-cols-1 sm:grid-cols-3 gap-3 text-xs">
|
||||
<li class="flex gap-2.5 rounded-lg border border-slate-800 bg-slate-950/40 p-3">
|
||||
<span class="flex items-center justify-center w-5 h-5 shrink-0 rounded-full bg-violet-500/10 border border-violet-500/30 font-semibold text-violet-300">1</span>
|
||||
<p class="text-slate-400 leading-relaxed">Encrypt URLs with the configured agent token.</p>
|
||||
</li>
|
||||
<li class="flex gap-2.5 rounded-lg border border-slate-800 bg-slate-950/40 p-3">
|
||||
<span class="flex items-center justify-center w-5 h-5 shrink-0 rounded-full bg-violet-500/10 border border-violet-500/30 font-semibold text-violet-300">2</span>
|
||||
<p class="text-slate-400 leading-relaxed">Sign and publish a low-cost memo transaction.</p>
|
||||
</li>
|
||||
<li class="flex gap-2.5 rounded-lg border border-slate-800 bg-slate-950/40 p-3">
|
||||
<span class="flex items-center justify-center w-5 h-5 shrink-0 rounded-full bg-violet-500/10 border border-violet-500/30 font-semibold text-violet-300">3</span>
|
||||
<p class="text-slate-400 leading-relaxed">Clients resolve the newest valid memo.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Info -->
|
||||
<div class="bg-slate-900/50 border border-slate-800 rounded-lg p-4 text-sm text-slate-400">
|
||||
<h3 class="text-slate-300 font-medium mb-2"><i class="fa-solid fa-circle-info text-blue-400"></i> How it works</h3>
|
||||
<ul class="list-disc list-inside flex flex-col gap-1">
|
||||
<li>The server URL is encrypted with AES-256-GCM using SHA-256 of your server's Agent Token as the key.</li>
|
||||
<li>The encrypted memo is published as a Solana memo transaction from your wallet.</li>
|
||||
<li>Clients built with Solana mode query your wallet address for the latest memo and decrypt it.</li>
|
||||
<li>Publishing costs approximately 0.000005 SOL (~$0.001).</li>
|
||||
<li>To update the server URL, just publish a new memo — clients always use the newest one.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section class="bg-slate-900/60 border border-slate-800 rounded-xl p-5 space-y-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex items-center justify-center w-9 h-9 rounded-lg bg-sky-500/10 border border-sky-500/30">
|
||||
<i class="fa-solid fa-network-wired text-sky-400"></i>
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<h2 class="text-base font-semibold">RPC endpoint pool</h2>
|
||||
<p class="text-xs text-slate-400">Shared by future client builds.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="rpc-endpoint-list" class="space-y-2"></div>
|
||||
|
||||
<div class="pt-3 border-t border-slate-800 space-y-2">
|
||||
<label class="block text-xs font-semibold uppercase tracking-wider text-slate-500" for="new-rpc-url">Add endpoint</label>
|
||||
<div class="flex gap-2">
|
||||
<input type="url" id="new-rpc-url" placeholder="https://rpc.example.com"
|
||||
class="flex-1 min-w-0 px-3 py-2 rounded-lg border border-slate-700 bg-slate-950/70 text-slate-100 placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/60 focus:border-sky-500" />
|
||||
<button type="button" id="add-rpc-btn"
|
||||
class="shrink-0 inline-flex items-center justify-center w-10 rounded-lg bg-sky-600 hover:bg-sky-500 text-white border border-sky-500 transition-colors" title="Add endpoint">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
<p id="rpc-manager-error" class="hidden text-xs text-red-300"></p>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg bg-sky-500/5 border border-sky-500/20 p-3 text-xs leading-relaxed text-slate-400">
|
||||
Keep every provider on the same cluster. Changes are saved server-wide and included in newly configured builds.
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user