flop-guild 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/content.js +9 -4
- package/dist/mcp.js +1 -1
- package/dist/minerpage.js +41 -16
- package/dist/net.js +13 -0
- package/dist/server.js +10 -9
- package/dist/shell.js +2 -1
- package/dist/sync-docs.js +2 -1
- package/dist/testnet.js +18 -3
- package/networks.json +1 -0
- package/package.json +1 -1
- package/skill.md +1 -1
package/dist/cli.js
CHANGED
|
@@ -83,7 +83,7 @@ async function main() {
|
|
|
83
83
|
const { pos, opt, get, num, need } = parse(rest);
|
|
84
84
|
const key = get("key") ?? process.env.FLOP_GUILD_KEY ?? "default";
|
|
85
85
|
const room = get("room") ?? DEFAULT_ROOM;
|
|
86
|
-
const network = get("network") ?? "
|
|
86
|
+
const network = get("network") ?? (await import("./net.js")).activeNetwork();
|
|
87
87
|
const agent = { name: pos[0] ?? key };
|
|
88
88
|
const flows = (get("flow") ? [get("flow")] : undefined);
|
|
89
89
|
let out;
|
package/dist/content.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Text uses a small Markdown subset: `code`, [text](url), and the word PROVISIONAL.
|
|
4
4
|
import { render } from "./config.js";
|
|
5
5
|
import { esc } from "./shell.js";
|
|
6
|
+
import { testnetLine } from "./testnet.js";
|
|
6
7
|
export const ROLES = [
|
|
7
8
|
{
|
|
8
9
|
id: "agent",
|
|
@@ -41,7 +42,7 @@ export const ROLES = [
|
|
|
41
42
|
{ title: "Verify", before: "Find your did:key in the [{{ROOM}}]({{ROOM_URL}}) room on Technocore." },
|
|
42
43
|
],
|
|
43
44
|
notes: [
|
|
44
|
-
"
|
|
45
|
+
"{{TESTNET_LINE}} No airdrop is promised.",
|
|
45
46
|
"More: [Start](/start) (make a key in the browser), [Agent quick start](/guides/agent-quickstart), [Autopilot](/guides/autopilot), [Join the guild](/guides/join-guild).",
|
|
46
47
|
],
|
|
47
48
|
},
|
|
@@ -205,11 +206,15 @@ export function guidesMd() {
|
|
|
205
206
|
return GUIDES.map((g) => `- [${g.title}]({{PUBLIC_URL}}/guides/${g.slug}) ([Markdown]({{PUBLIC_URL}}/guides/${g.slug}.md)): ${g.summary}`).join("\n");
|
|
206
207
|
}
|
|
207
208
|
/** Fill {{ROLES_MD}}, {{ROLE_MD:agent}}, {{GUIDES_MD}}, then the host and room placeholders. */
|
|
208
|
-
export function expand(template) {
|
|
209
|
-
return render(template
|
|
209
|
+
export function expand(template, line) {
|
|
210
|
+
return withTestnetLine(render(template
|
|
210
211
|
.replace(/\{\{ROLE_MD:(agent|miner|validator)\}\}/g, (_m, id) => roleMd(ROLES.find((r) => r.id === id), 2))
|
|
211
212
|
.replaceAll("{{ROLES_MD}}", rolesMd(2))
|
|
212
|
-
.replaceAll("{{GUIDES_MD}}", guidesMd()));
|
|
213
|
+
.replaceAll("{{GUIDES_MD}}", guidesMd())), line === undefined ? undefined : render(line));
|
|
214
|
+
}
|
|
215
|
+
/** Fill {{TESTNET_LINE}} with the sentence the testnet watcher's state calls for. */
|
|
216
|
+
export function withTestnetLine(text, line = testnetLine()) {
|
|
217
|
+
return text.replaceAll("{{TESTNET_LINE}}", line);
|
|
213
218
|
}
|
|
214
219
|
function cmdHtml(c) {
|
|
215
220
|
return `<pre${c.runin ? ` data-runin="${esc(c.runin)}"` : ""}><code>${esc(c.code)}</code></pre>`;
|
package/dist/mcp.js
CHANGED
|
@@ -72,7 +72,7 @@ const tools = [
|
|
|
72
72
|
async function withChain(network, fn) {
|
|
73
73
|
const { loadNetwork, connect } = await import("./net.js");
|
|
74
74
|
const f = await import("./flop.js");
|
|
75
|
-
const net = loadNetwork(network ?? "
|
|
75
|
+
const net = loadNetwork(network ?? (await import("./net.js")).activeNetwork());
|
|
76
76
|
const { api } = await connect(net);
|
|
77
77
|
try {
|
|
78
78
|
return await fn(net, api, f);
|
package/dist/minerpage.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// /miner: demand by UTC hour (7 days, cached 10 min) and a rent vs airdrop calculator.
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { CALC_DEFAULTS, loadDemand, minerCalc } from "./econ.js";
|
|
4
|
-
import { networksPath } from "./net.js";
|
|
5
|
-
|
|
4
|
+
import { activeNetwork, networksPath } from "./net.js";
|
|
5
|
+
import { testnetLine } from "./testnet.js";
|
|
6
6
|
export const MINER_FOOTER = "Unofficial community tool. Estimates only. Draft Flop rules may change. No airdrop promises.";
|
|
7
7
|
const TTL = 10 * 60 * 1000;
|
|
8
8
|
export const PARTIAL_NOTE = "Partial data, showing last complete read";
|
|
@@ -24,8 +24,20 @@ function view() {
|
|
|
24
24
|
return undefined;
|
|
25
25
|
return { shown: lastComplete ?? latest, latest, partial: !latest.complete };
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* For the /miner page: if the explorer read times out or fails, retry twice, 3 s apart.
|
|
29
|
+
* Returns undefined when there is still no data; the page then shows "unavailable", never 0 miners.
|
|
30
|
+
*/
|
|
31
|
+
export async function demandWithRetry(sleep = (ms) => new Promise((r) => setTimeout(r, ms)), load = demand) {
|
|
32
|
+
let v = await load(undefined, 20_000).catch(() => undefined);
|
|
33
|
+
for (let i = 0; i < 2 && !v; i++) {
|
|
34
|
+
await sleep(3_000);
|
|
35
|
+
v = await load(undefined, 8_000).catch(() => undefined);
|
|
36
|
+
}
|
|
37
|
+
return v;
|
|
38
|
+
}
|
|
27
39
|
/** Cached demand: refresh after 10 minutes (2 after a partial read); a partial read never replaces a complete one. */
|
|
28
|
-
export async function demand(network = process.env.MINER_NETWORK ||
|
|
40
|
+
export async function demand(network = process.env.MINER_NETWORK || activeNetwork(), waitMs = 25_000) {
|
|
29
41
|
const age = Date.now() - lastAttemptAt;
|
|
30
42
|
const stale = !lastAttempt || age > (lastAttempt.complete ? TTL : PARTIAL_RETRY);
|
|
31
43
|
if (stale && !inflight) {
|
|
@@ -77,15 +89,18 @@ function chart(byHour) {
|
|
|
77
89
|
.join("");
|
|
78
90
|
return `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Sessions opened per UTC hour over the last 7 days" class="chart">${bars}${ticks}</svg>`;
|
|
79
91
|
}
|
|
80
|
-
|
|
92
|
+
export const NA = "n/a (explorer unavailable)";
|
|
93
|
+
/** Without a miner count, every row that depends on it is n/a; only the rent is known. */
|
|
94
|
+
function calcRows(o, known = true) {
|
|
95
|
+
const k = (v) => (known ? v : NA);
|
|
81
96
|
const rows = [
|
|
82
97
|
["out-rent", "Total rent", usd(o.totalRent)],
|
|
83
|
-
["out-share", "Your share of the miner pool (estimate)", pct(o.share)],
|
|
84
|
-
["out-airdrop", "Airdrop FLOP (estimate)", flop(o.airdropFlop)],
|
|
85
|
-
["out-liquid", "Liquid FLOP at launch (estimate)", flop(o.liquidFlop)],
|
|
86
|
-
["out-be-liquid", "Break-even FLOP price, liquid FLOP only", price(o.breakEvenLiquid)],
|
|
87
|
-
["out-be-all", "Break-even FLOP price, if all airdrop FLOP unlocked", price(o.breakEvenAll)],
|
|
88
|
-
["out-net", "Liquid value minus rent, at your FLOP price", o.net === null ? "enter a FLOP price" : usd(o.net)],
|
|
98
|
+
["out-share", "Your share of the miner pool (estimate)", k(pct(o.share))],
|
|
99
|
+
["out-airdrop", "Airdrop FLOP (estimate)", k(flop(o.airdropFlop))],
|
|
100
|
+
["out-liquid", "Liquid FLOP at launch (estimate)", k(flop(o.liquidFlop))],
|
|
101
|
+
["out-be-liquid", "Break-even FLOP price, liquid FLOP only", k(price(o.breakEvenLiquid))],
|
|
102
|
+
["out-be-all", "Break-even FLOP price, if all airdrop FLOP unlocked", k(price(o.breakEvenAll))],
|
|
103
|
+
["out-net", "Liquid value minus rent, at your FLOP price", known ? (o.net === null ? "enter a FLOP price" : usd(o.net)) : NA],
|
|
89
104
|
];
|
|
90
105
|
return rows.map(([id, label, v]) => `<tr><th scope="row">${label}</th><td id="${id}">${v}</td></tr>`).join("");
|
|
91
106
|
}
|
|
@@ -96,6 +111,7 @@ export const MINER_STYLE = `
|
|
|
96
111
|
.note{font-size:.88rem}`;
|
|
97
112
|
export function minerPage(v, err) {
|
|
98
113
|
const d = v?.shown;
|
|
114
|
+
const known = !!d; // no explorer data: show "unavailable", never compute with 0 miners
|
|
99
115
|
const minerCount = d?.minerCount ?? 0;
|
|
100
116
|
const utc = (t) => new Date(t).toISOString().slice(0, 16).replace("T", " ");
|
|
101
117
|
const partialHtml = v?.partial
|
|
@@ -111,14 +127,15 @@ ${partialHtml}
|
|
|
111
127
|
${chart(d.byHour)}
|
|
112
128
|
<p>Busiest UTC hours: ${d.busiest.map((b) => `<strong>${hh(b.hour)}</strong> (${b.sessions.toLocaleString("en-US")})`).join(", ")}.</p>
|
|
113
129
|
<p class="note">Source: ${esc(d.explorer)}/api/compute-channels, bucketed by the hour each session opened. Updated ${new Date(d.fetchedAt).toISOString().slice(11, 16)} UTC, refreshed every 10 minutes.</p>`
|
|
114
|
-
: `<p
|
|
130
|
+
: `<p>The explorer is unavailable${err ? ` (${esc(err)})` : " (no answer after 3 tries)"}. Demand and the miner count cannot be shown right now.</p>
|
|
131
|
+
<p><a class="btn" href="/miner" role="button">Retry</a></p>`;
|
|
115
132
|
return `<h1>Miner economics</h1>
|
|
116
133
|
<p>What miners are paid for: how much inference demand there is, by hour, and what renting a GPU costs against an estimated airdrop share.</p>
|
|
117
134
|
<h2>Demand by UTC hour, last 7 days</h2>
|
|
118
|
-
|
|
135
|
+
<p><strong>${esc(testnetLine())}</strong></p>
|
|
119
136
|
${demandHtml}
|
|
120
137
|
<h2>Rent vs airdrop calculator</h2>
|
|
121
|
-
<form id="calc" class="grid" data-miners="${minerCount}">
|
|
138
|
+
<form id="calc" class="grid" data-miners="${known ? minerCount : ""}">
|
|
122
139
|
<label>Rent, $ per hour<input id="in-rent" type="number" step="0.01" min="0" value="${CALC_DEFAULTS.rentPerHour}"></label>
|
|
123
140
|
<label>Hours per day<input id="in-hours" type="number" step="1" min="0" max="24" value="${CALC_DEFAULTS.hoursPerDay}"></label>
|
|
124
141
|
<label>Days<input id="in-days" type="number" step="1" min="0" value="${CALC_DEFAULTS.days}"></label>
|
|
@@ -128,8 +145,9 @@ ${demandHtml}
|
|
|
128
145
|
<label>Miner pool, FLOP<input id="in-pool" type="number" step="1" min="0" value="${CALC_DEFAULTS.poolFlop}"></label>
|
|
129
146
|
<label>Liquid share, %<input id="in-liquid" type="number" step="1" min="0" max="100" value="${CALC_DEFAULTS.liquidShare * 100}"></label>
|
|
130
147
|
</form>
|
|
131
|
-
<p>Miners active in the last 7 days (live from the explorer): <strong id="miner-count">${minerCount.toLocaleString("en-US")}</strong>${readInfo}</p>
|
|
132
|
-
<
|
|
148
|
+
<p>Miners active in the last 7 days (live from the explorer): <strong id="miner-count">${known ? minerCount.toLocaleString("en-US") : "unavailable"}</strong>${readInfo}</p>
|
|
149
|
+
${known ? "" : '<p><a class="btn" href="/miner" role="button">Retry</a></p>'}
|
|
150
|
+
<table><tbody>${calcRows(out, known)}</tbody></table>
|
|
133
151
|
<p class="note">Share estimate = your weight / (miner count × average weight) × (hours per day / 24). The share assumes the average miner runs 24 hours a day.</p>
|
|
134
152
|
<p class="note">The real share is your verified compute divided by all verified compute, which nobody can know in advance. No FLOP token or price exists yet.</p>`;
|
|
135
153
|
}
|
|
@@ -140,7 +158,10 @@ ${minerCalc.toString()}
|
|
|
140
158
|
(function () {
|
|
141
159
|
var f = document.getElementById("calc");
|
|
142
160
|
if (!f) return;
|
|
143
|
-
var
|
|
161
|
+
var raw = f.getAttribute("data-miners");
|
|
162
|
+
var known = raw !== "" && raw !== null; // empty: explorer unavailable, never treat as 0 miners
|
|
163
|
+
var miners = known ? Number(raw) || 0 : 0;
|
|
164
|
+
var NA = "n/a (explorer unavailable)";
|
|
144
165
|
function v(id) { var x = document.getElementById(id).value; return x === "" ? undefined : Number(x); }
|
|
145
166
|
function usd(n) { return "$" + n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); }
|
|
146
167
|
function fl(n) { return Math.round(n).toLocaleString("en-US") + " FLOP"; }
|
|
@@ -151,6 +172,10 @@ ${minerCalc.toString()}
|
|
|
151
172
|
gpuWeight: v("in-weight") || 0, avgWeight: v("in-avg") || 0, minerCount: miners,
|
|
152
173
|
poolFlop: v("in-pool") || 0, liquidShare: (v("in-liquid") || 0) / 100, flopPrice: v("in-price") });
|
|
153
174
|
set("out-rent", usd(o.totalRent));
|
|
175
|
+
if (!known) {
|
|
176
|
+
["out-share", "out-airdrop", "out-liquid", "out-be-liquid", "out-be-all", "out-net"].forEach(function (id) { set(id, NA); });
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
154
179
|
set("out-share", (o.share * 100).toPrecision(3) + "%");
|
|
155
180
|
set("out-airdrop", fl(o.airdropFlop));
|
|
156
181
|
set("out-liquid", fl(o.liquidFlop));
|
package/dist/net.js
CHANGED
|
@@ -9,6 +9,19 @@ export const FLOP = 10n ** 18n;
|
|
|
9
9
|
export function networksPath() {
|
|
10
10
|
return process.env.FLOP_GUILD_NETWORKS || join(dirname(fileURLToPath(import.meta.url)), "..", "networks.json");
|
|
11
11
|
}
|
|
12
|
+
/** The kit's active network: FLOP_NETWORK, else "default" in networks.json, else devnet. Never changed automatically. */
|
|
13
|
+
export function activeNetwork() {
|
|
14
|
+
const env = process.env.FLOP_NETWORK?.trim();
|
|
15
|
+
if (env)
|
|
16
|
+
return env;
|
|
17
|
+
try {
|
|
18
|
+
const d = JSON.parse(readFileSync(networksPath(), "utf8")).default;
|
|
19
|
+
if (typeof d === "string" && /^[a-z0-9_-]+$/.test(d))
|
|
20
|
+
return d;
|
|
21
|
+
}
|
|
22
|
+
catch { }
|
|
23
|
+
return "devnet";
|
|
24
|
+
}
|
|
12
25
|
export function loadNetwork(name) {
|
|
13
26
|
const all = JSON.parse(readFileSync(networksPath(), "utf8"));
|
|
14
27
|
const n = all[name];
|
package/dist/server.js
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
import { GUILD_ROOM, publicHost, render } from "./config.js";
|
|
9
9
|
import { networksPath } from "./net.js";
|
|
10
10
|
import { DISCLAIMER, esc, ICONS, page } from "./shell.js";
|
|
11
|
-
import { expand, GUIDES, guidesHtml, mdToHtml, ROLES, roleMd, rolesHtml, rolesMd } from "./content.js";
|
|
11
|
+
import { expand, GUIDES, guidesHtml, mdToHtml, ROLES, roleMd, rolesHtml, rolesMd, withTestnetLine } from "./content.js";
|
|
12
12
|
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
13
13
|
const SITE = join(ROOT, "site");
|
|
14
14
|
const VERSION = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8")).version;
|
|
@@ -43,7 +43,7 @@ async function networkStatus(network) {
|
|
|
43
43
|
const all = JSON.parse(readFileSync(networksPath(), "utf8"));
|
|
44
44
|
const net = all[network];
|
|
45
45
|
if (!net)
|
|
46
|
-
throw new Error(`unknown network "${network}"; known: ${Object.keys(all).join(", ")}`);
|
|
46
|
+
throw new Error(`unknown network "${network}"; known: ${Object.keys(all).filter((k) => typeof all[k] === "object").join(", ")}`);
|
|
47
47
|
if (!net.faucet || !net.genesis)
|
|
48
48
|
return JSON.stringify({ network, configured: false }, null, 2);
|
|
49
49
|
return cached(`status:${network}`, 30_000, async () => {
|
|
@@ -128,7 +128,7 @@ const tools = [
|
|
|
128
128
|
name: "network_status",
|
|
129
129
|
description: "Public FLOP network status: genesis match (faucet and explorer vs networks.json), faucet state, indexer lag, gateway models. Cached 30 s.",
|
|
130
130
|
inputSchema: { type: "object", properties: { network: { type: "string", description: "default devnet" } } },
|
|
131
|
-
run: (a) => networkStatus(String(a.network ?? "
|
|
131
|
+
run: async (a) => networkStatus(String(a.network ?? (await import("./net.js")).activeNetwork())),
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
name: "get_role_steps",
|
|
@@ -268,7 +268,7 @@ let limitsCache;
|
|
|
268
268
|
let limitsInflight;
|
|
269
269
|
/** Faucet /limits (the same endpoint network_status reads). Never blocks a page for more than 1.5 s. */
|
|
270
270
|
async function faucetLimits() {
|
|
271
|
-
const net = JSON.parse(readFileSync(networksPath(), "utf8")).
|
|
271
|
+
const net = JSON.parse(readFileSync(networksPath(), "utf8"))[(await import("./net.js")).activeNetwork()];
|
|
272
272
|
if ((!limitsCache || Date.now() - limitsCache.at > 60_000) && !limitsInflight && net?.faucet) {
|
|
273
273
|
limitsInflight = getJson(`${net.faucet}/limits`)
|
|
274
274
|
.then((v) => void (limitsCache = { at: Date.now(), v }))
|
|
@@ -288,11 +288,12 @@ async function homeStats() {
|
|
|
288
288
|
const mp = await import("./minerpage.js");
|
|
289
289
|
const [v, limits] = await Promise.all([mp.demand(undefined, 0).catch(() => undefined), faucetLimits().catch(() => undefined)]);
|
|
290
290
|
const nets = JSON.parse(readFileSync(networksPath(), "utf8"));
|
|
291
|
-
const
|
|
291
|
+
const active = (await import("./net.js")).activeNetwork();
|
|
292
|
+
const devnet = `<span class="tag">${esc(active)}</span>`;
|
|
292
293
|
const d = v?.shown;
|
|
293
294
|
const miners = d
|
|
294
|
-
? stat(ICONS.miner,
|
|
295
|
-
: stat(ICONS.miner,
|
|
295
|
+
? stat(ICONS.miner, `Miners on ${active}`, d.minerCount.toLocaleString("en-US"), `active in the last 7 days${d.complete ? "" : ", partial read"} ${devnet}`, "on", "LIVE")
|
|
296
|
+
: stat(ICONS.miner, `Miners on ${active}`, DASH, `explorer read in progress, refresh in a minute ${devnet}`, "off", "NO DATA");
|
|
296
297
|
const validators = stat(ICONS.validator, "Validators", DASH, `not read by this kit yet ${devnet}`, "off", "NO DATA");
|
|
297
298
|
const cap = Number(limits?.faucet?.dailyCap?.limitFlop);
|
|
298
299
|
const grant = Number(limits?.faucet?.anonymous?.grantFlop);
|
|
@@ -405,7 +406,7 @@ export function startServer(port, host = "0.0.0.0") {
|
|
|
405
406
|
const mp = await import("./minerpage.js");
|
|
406
407
|
if (path === "/miner.js")
|
|
407
408
|
return send(res, 200, "text/javascript; charset=utf-8", mp.minerScript());
|
|
408
|
-
const v = await mp.demand();
|
|
409
|
+
const v = path === "/miner" ? await mp.demandWithRetry() : await mp.demand();
|
|
409
410
|
const d = v?.shown;
|
|
410
411
|
const fresh = { "cache-control": "public, max-age=60" };
|
|
411
412
|
if (path === "/api/miner-stats") {
|
|
@@ -420,7 +421,7 @@ export function startServer(port, host = "0.0.0.0") {
|
|
|
420
421
|
if (path === "/") {
|
|
421
422
|
const body = render(readFileSync(join(SITE, "index.html"), "utf8"))
|
|
422
423
|
.replace(/\{\{icon:([a-z]+)\}\}/g, (_m, k) => ICONS[k] ?? "")
|
|
423
|
-
.replace("{{ROLES}}", render(rolesHtml(ICONS)))
|
|
424
|
+
.replace("{{ROLES}}", withTestnetLine(render(rolesHtml(ICONS))))
|
|
424
425
|
.replace("{{GUIDES}}", guidesHtml(ICONS.doc))
|
|
425
426
|
.replace("{{STATS}}", await homeStats());
|
|
426
427
|
return send(res, 200, "text/html; charset=utf-8", page("flopguild: pick your role", body, { footerNote: START_FOOTER, style: HOME_STYLE, script: "/tabs.js" }), { "cache-control": "public, max-age=60" });
|
package/dist/shell.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Shared page shell for the site: top bar, cards, terminal-style code blocks, fonts. Dark only.
|
|
2
2
|
// Everything is served from this site: fonts from /fonts, scripts from /copy.js and page scripts.
|
|
3
3
|
import { GUILD_ROOM, GUILD_ROOM_URL } from "./config.js";
|
|
4
|
+
import { activeNetwork } from "./net.js";
|
|
4
5
|
export const esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
5
6
|
export const RUN_IN_SHELL = "Run in: Ubuntu, macOS Terminal, or WSL on Windows (not PowerShell)";
|
|
6
7
|
export const RUN_IN_POWERSHELL = "Run in: PowerShell";
|
|
@@ -171,7 +172,7 @@ ${o.style ?? ""}
|
|
|
171
172
|
</style>${copy}${o.script ? `<script ${o.module ? 'type="module"' : "defer"} src="${o.script}"></script>` : ""}</head><body>
|
|
172
173
|
<header class="topbar"><div class="wrap">
|
|
173
174
|
<a class="brand" href="/" aria-label="flopguild home"><img src="/logo.svg" alt="" width="28" height="28"><span class="wm"><span>flop</span><b>guild</b></span></a>
|
|
174
|
-
<span class="pill" title="The
|
|
175
|
+
<span class="pill" title="The network this kit is set to use (networks.json)">${esc(activeNetwork().toUpperCase())}</span>
|
|
175
176
|
${NAV}
|
|
176
177
|
<a class="btn" href="/#agent">Start your agent</a>
|
|
177
178
|
</div></header>
|
package/dist/sync-docs.js
CHANGED
|
@@ -13,7 +13,8 @@ const a = text.indexOf(START);
|
|
|
13
13
|
const b = text.indexOf(END);
|
|
14
14
|
if (a < 0 || b < a)
|
|
15
15
|
throw new Error("skill.md: generated markers not found");
|
|
16
|
-
|
|
16
|
+
// The package is built once; the testnet line changes over time, so point to the live status instead.
|
|
17
|
+
const body = expand("## Roles\n\n{{ROLES_MD}}\n## Guides\n\n{{GUIDES_MD}}\n", "Testnet status changes over time: see {{PUBLIC_URL}}/api/status. This kit runs on devnet, which earns nothing.");
|
|
17
18
|
const next = `${text.slice(0, a)}${START}\n\n${body.trim()}\n\n${text.slice(b)}`;
|
|
18
19
|
if (next !== text)
|
|
19
20
|
writeFileSync(path, next);
|
package/dist/testnet.js
CHANGED
|
@@ -254,17 +254,32 @@ export async function checkOnce(o = {}) {
|
|
|
254
254
|
await notify(message(next, firstFlip), log);
|
|
255
255
|
return next;
|
|
256
256
|
}
|
|
257
|
+
const LABEL = { rpc: "RPC", gateway: "gateway", faucet: "faucet", genesis: "genesis hash", chainId: "chain ID" };
|
|
258
|
+
const list = (xs) => (xs.length < 2 ? xs.join("") : `${xs.slice(0, -1).join(", ")} and ${xs.at(-1)}`);
|
|
259
|
+
/** The one sentence the site uses for testnet, from the watcher's state. Never mentions an airdrop. */
|
|
260
|
+
export function testnetLine(st = status()) {
|
|
261
|
+
if (st.published)
|
|
262
|
+
return "Flop has published testnet endpoints. They are not enabled in the kit yet.";
|
|
263
|
+
if (!st.found.length)
|
|
264
|
+
return "Testnet endpoints are not published yet. This kit runs on devnet, which earns nothing.";
|
|
265
|
+
const waitFor = st.missing.filter((f) => f === "gateway" || f === "faucet" || f === "rpc").map((f) => LABEL[f]);
|
|
266
|
+
const pending = waitFor.length ? waitFor : st.missing.map((f) => LABEL[f]);
|
|
267
|
+
return `Flop has published part of its testnet details (found: ${list(st.found.map((f) => LABEL[f]))}; missing: ${list(st.missing.map((f) => LABEL[f]))}). The kit stays on devnet until the ${list(pending)} ${pending.length > 1 ? "are" : "is"} published.`;
|
|
268
|
+
}
|
|
257
269
|
/** Public summary for /api/status and the home page card. */
|
|
258
270
|
export function status() {
|
|
259
271
|
const s = loadState();
|
|
260
|
-
|
|
261
|
-
|
|
272
|
+
const missing = (s.missing ?? [...FIELDS]).filter((f) => FIELDS.includes(f));
|
|
273
|
+
const base = {
|
|
274
|
+
published: !!s.published,
|
|
275
|
+
found: FIELDS.filter((f) => !missing.includes(f)),
|
|
262
276
|
lastChecked: s.lastChecked ?? null,
|
|
263
277
|
lastChanged: s.lastChanged ?? null,
|
|
264
|
-
missing
|
|
278
|
+
missing,
|
|
265
279
|
lastError: s.lastError ?? null,
|
|
266
280
|
note: "Endpoints are never enabled in the kit automatically.",
|
|
267
281
|
};
|
|
282
|
+
return { ...base, line: testnetLine(base) };
|
|
268
283
|
}
|
|
269
284
|
let timer;
|
|
270
285
|
/** Start the 5-minute loop inside the site server. TESTNET_WATCH=0 turns it off. */
|
package/networks.json
CHANGED
package/package.json
CHANGED
package/skill.md
CHANGED
|
@@ -124,7 +124,7 @@ Run in: Ubuntu, macOS Terminal, or WSL on Windows (not PowerShell)
|
|
|
124
124
|
|
|
125
125
|
Find your did:key in the [d-flopguild](https://technocore.chat/r/d-flopguild) room on Technocore.
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
Testnet status changes over time: see https://flopguild.xyz/api/status. This kit runs on devnet, which earns nothing. No airdrop is promised.
|
|
128
128
|
|
|
129
129
|
More: [Start](https://flopguild.xyz/start) (make a key in the browser), [Agent quick start](https://flopguild.xyz/guides/agent-quickstart), [Autopilot](https://flopguild.xyz/guides/autopilot), [Join the guild](https://flopguild.xyz/guides/join-guild).
|
|
130
130
|
|