Every TLD registered on the beacon. Operators
+ (signed-in) can toggle a TLD's visibility on the public /api/tlds listing — hidden TLDs stop
+ appearing in the name-search UIs, but on-chain registrations under them keep resolving.
+
+
+
+
+
+
+
+
Loading current registry…
@@ -222,7 +233,26 @@ async function enterAdmin() {
}
}
-// ---------- TLD registry (always visible, signed-in or not) ----------
+// ---------- operator token ----------
+// Stored in sessionStorage so refreshing the tab keeps the token for the
+// session but a full browser close forgets it. Not localStorage — the
+// weaker persistence is the right default for a POST-write credential.
+const opToken = () => { try { return sessionStorage.getItem("bnsOperatorToken") || ""; } catch { return ""; } };
+function setOpTokenMsg(text, ok) {
+ const el = $("op-token-msg"); el.textContent = text;
+ el.style.color = ok === true ? "var(--ok)" : ok === false ? "var(--taken)" : "var(--dim)";
+}
+$("op-token").value = opToken();
+$("op-token-save").addEventListener("click", () => {
+ try { sessionStorage.setItem("bnsOperatorToken", $("op-token").value.trim()); } catch {}
+ setOpTokenMsg(opToken() ? "saved for this session" : "cleared", opToken() ? true : null);
+});
+
+// ---------- TLD registry with hide/unhide ----------
+// Fetches BOTH /api/tlds?include_hidden=1 (so we see the hidden ones the
+// public listing filters out) and the current /api/tld-visibility. Renders
+// one row per TLD with a checkbox for the hidden flag — flipping it POSTs
+// to /api/tld-visibility with the operator token.
async function loadRegistry() {
const status = $("registry-status");
const table = $("registry-table");
@@ -230,22 +260,64 @@ async function loadRegistry() {
status.textContent = "Loading current registry from the chain…";
table.innerHTML = "";
try {
- const r = await fetch("https://navigate.st/api/tlds");
- if (!r.ok) throw new Error("API " + r.status);
- const body = await r.json();
- // /api/tlds returns { source, root, count, legend, tlds: [{tld, certificate:{category, owner, regHeight,...}, records}] }
- const tlds = body.tlds || [];
+ const [rTlds, rVis] = await Promise.all([
+ fetch("https://silentmode.st/api/tlds?include_hidden=1"),
+ fetch("https://silentmode.st/api/tld-visibility"),
+ ]);
+ if (!rTlds.ok) throw new Error("api/tlds " + rTlds.status);
+ if (!rVis.ok) throw new Error("api/tld-visibility " + rVis.status);
+ const body = await rTlds.json();
+ const vis = await rVis.json();
+ const hidden = new Set(vis.hidden || []);
+ const tlds = (body.tlds || []).sort((a, b) => a.tld.localeCompare(b.tld));
status.className = "status ok";
- status.textContent = `${tlds.length} TLDs on the beacon` + (body.root ? ` · root ${body.root.slice(0, 16)}…` : "");
- let html = '
TLD
Category
Records
Height
';
- for (const t of tlds.sort((a, b) => a.tld.localeCompare(b.tld))) {
- const cat = (t.certificate?.category || t.category || "").slice(0, 16);
- const recs = t.records && Object.keys(t.records).length ? JSON.stringify(t.records) : "";
- const h = t.certificate?.regHeight ?? t.regHeight ?? "";
- html += `
.${esc(t.tld)}
${esc(cat)}${cat ? "…" : ""}
${esc(recs)}
${esc(String(h))}
`;
+ status.textContent = `${tlds.length} TLDs on the beacon · ${hidden.size} hidden from public listing`;
+ let html = '
TLD
Names
Advertised
Hidden from public
';
+ for (const t of tlds) {
+ const isHidden = hidden.has(t.tld);
+ html += `