blockyard 0.0.1 → 0.1.0

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +929 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +4 -0
  4. package/README.md +191 -4
  5. package/SECURITY.md +38 -0
  6. package/bin/blockyard.js +41 -0
  7. package/config/pool-map.json +2620 -0
  8. package/docs/API.md +1577 -0
  9. package/docs/ARCHITECTURE.md +1394 -0
  10. package/docs/AUTO-UPDATE.md +269 -0
  11. package/docs/CONFIGURATION.md +847 -0
  12. package/docs/DEFECTS.md +813 -0
  13. package/docs/EFFECTS-AGENTS.md +448 -0
  14. package/docs/GETTING-STARTED.md +205 -0
  15. package/docs/INSTALL.md +547 -0
  16. package/docs/MEASUREMENTS.md +1401 -0
  17. package/docs/RULES.md +681 -0
  18. package/docs/SECURITY-AUDIT-2026-09-14.md +177 -0
  19. package/docs/SECURITY-AUDIT.md +258 -0
  20. package/docs/SECURITY.md +212 -0
  21. package/docs/TROUBLESHOOTING.md +332 -0
  22. package/docs/USER-GUIDE.md +1262 -0
  23. package/package.json +53 -5
  24. package/public/404.html +9 -0
  25. package/public/css/app.css +2009 -0
  26. package/public/donate-qr.png +0 -0
  27. package/public/index.html +1085 -0
  28. package/public/js/about.js +112 -0
  29. package/public/js/agents.js +1141 -0
  30. package/public/js/app.js +1386 -0
  31. package/public/js/arkanoid.js +806 -0
  32. package/public/js/blockanoid.js +347 -0
  33. package/public/js/blockout.js +347 -0
  34. package/public/js/blockpack.js +428 -0
  35. package/public/js/blockscene3d.js +2830 -0
  36. package/public/js/breakout.js +224 -0
  37. package/public/js/charts.js +635 -0
  38. package/public/js/depthchart.js +315 -0
  39. package/public/js/details3d.js +4342 -0
  40. package/public/js/doom.js +31 -0
  41. package/public/js/dosaudio.js +48 -0
  42. package/public/js/dosgame.js +389 -0
  43. package/public/js/dosio.js +186 -0
  44. package/public/js/dospc.js +1353 -0
  45. package/public/js/dosworker.js +196 -0
  46. package/public/js/explorer.js +405 -0
  47. package/public/js/feepalette.js +149 -0
  48. package/public/js/fmt.js +162 -0
  49. package/public/js/goggles.js +886 -0
  50. package/public/js/kiosk.js +41 -0
  51. package/public/js/login.js +88 -0
  52. package/public/js/markets.js +395 -0
  53. package/public/js/mining.js +1416 -0
  54. package/public/js/panels.js +970 -0
  55. package/public/js/pricechart.js +189 -0
  56. package/public/js/quake.js +20 -0
  57. package/public/js/settings.js +1096 -0
  58. package/public/js/soundcard.js +459 -0
  59. package/public/js/tetris.js +226 -0
  60. package/public/js/tetrust.js +356 -0
  61. package/public/js/tetsound.js +175 -0
  62. package/public/js/theme.js +235 -0
  63. package/public/js/wolf3d.js +22 -0
  64. package/public/js/x86.js +1978 -0
  65. package/public/login.html +33 -0
  66. package/scripts/blockfile-measure.js +156 -0
  67. package/scripts/browser-check.mjs +286 -0
  68. package/scripts/check.js +173 -0
  69. package/scripts/decode-check.js +81 -0
  70. package/scripts/doc-counts.js +109 -0
  71. package/scripts/donate-qr.py +23 -0
  72. package/scripts/dos-bench.js +56 -0
  73. package/scripts/fake-node.js +534 -0
  74. package/scripts/index-bench.js +216 -0
  75. package/scripts/index-benchmark.js +117 -0
  76. package/scripts/index-build.js +40 -0
  77. package/scripts/live-render-check.mjs +89 -0
  78. package/scripts/manage-users.js +132 -0
  79. package/scripts/motion-check.mjs +138 -0
  80. package/scripts/pool-map.js +157 -0
  81. package/scripts/setup.js +432 -0
  82. package/scripts/shots.mjs +278 -0
  83. package/scripts/smoke.sh +327 -0
  84. package/scripts/tls.js +31 -0
  85. package/scripts/ui.js +174 -0
  86. package/server/auth/sessions.js +221 -0
  87. package/server/auth/users.js +243 -0
  88. package/server/chain/blockfile.js +234 -0
  89. package/server/chain/index/build.js +210 -0
  90. package/server/chain/index/heights.js +36 -0
  91. package/server/chain/index/live.js +276 -0
  92. package/server/chain/index/rows.js +145 -0
  93. package/server/chain/index/store.js +154 -0
  94. package/server/chain/index/worker.js +109 -0
  95. package/server/chain/tx.js +310 -0
  96. package/server/collect/gbt.js +229 -0
  97. package/server/collect/logparse.js +765 -0
  98. package/server/collect/logtail.js +189 -0
  99. package/server/collect/markets.js +333 -0
  100. package/server/collect/mining.js +333 -0
  101. package/server/collect/monitor.js +2545 -0
  102. package/server/collect/network.js +295 -0
  103. package/server/collect/nextblock.js +275 -0
  104. package/server/collect/sync.js +386 -0
  105. package/server/config.js +644 -0
  106. package/server/http/api.js +1319 -0
  107. package/server/http/explorer.js +418 -0
  108. package/server/http/games.js +77 -0
  109. package/server/http/server.js +420 -0
  110. package/server/http/sse.js +176 -0
  111. package/server/http/static.js +212 -0
  112. package/server/main.js +673 -0
  113. package/server/netinfo.js +253 -0
  114. package/server/rpc/allowlist.js +130 -0
  115. package/server/rpc/client.js +414 -0
  116. package/server/store/audit.js +148 -0
  117. package/server/store/history.js +220 -0
  118. package/server/store/ledger.js +290 -0
  119. package/server/store/ring.js +173 -0
  120. package/server/tls/selfsigned.js +160 -0
  121. package/server/util/fmt.js +29 -0
  122. package/systemd/blockyard.service +102 -0
@@ -0,0 +1,112 @@
1
+ // THE ABOUT PAGE (operator, 2026-09-12: "We need to add an about menu. include the github logo
2
+ // graphic, link to our github page for the project. show current version number. system info. os
3
+ // info version. bitcoin node version. Add a closing line ... have the spiral galaxy in the
4
+ // background for the about page"; and "Make clicking the BlockYard icon the About page then").
5
+ //
6
+ // Reached by clicking the monogram in the header, not by a tab of its own -- the nav is already
7
+ // full enough that it wraps to its own row below 2000 px, and About is a place you visit once.
8
+ //
9
+ // The sky is the same board3d star field every other panel draws, with the galaxy forced ON:
10
+ // this page has no data to obscure, so it is the one place the galaxy is the point rather than
11
+ // the backdrop. It is a separate canvas behind the text, at maxDpr 1, so a page nobody is
12
+ // watching costs one cheap repaint rather than a megapixel one.
13
+ import { board3d } from './details3d.js';
14
+ import { loadSettings, spaceOptions } from './settings.js';
15
+ import { copyText } from './fmt.js';
16
+
17
+ const SKY = {
18
+ gridW: 24, gridH: 16,
19
+ oblique: { ox: 0.10, oy: 0.30, headroom: 3, flight: 0 },
20
+ dome: 0, space: false, grid: false,
21
+ background: 'rgba(0,0,0,1)',
22
+ idleFx: false, shadows: false, still: true,
23
+ transition: { rise: 0, travel: 1, drop: 0 },
24
+ maxDpr: 1,
25
+ };
26
+
27
+ const S = { host: null, asked: false };
28
+
29
+ /** Draw the galaxy behind the text. Its make-up comes from the Sky settings, like every board. */
30
+ function drawSky() {
31
+ const c = document.getElementById('abSky');
32
+ if (!c) return;
33
+ const sky = spaceOptions(loadSettings());
34
+ board3d(c, [], {
35
+ ...SKY,
36
+ stars: true, galaxy: true, galaxyAt: 'center',
37
+ starDensity: sky.starDensity, starBrightness: sky.starBrightness,
38
+ nebulae: sky.nebulae, galaxies: sky.galaxies, dust: sky.dust, clusters: sky.clusters,
39
+ starColours: sky.starColours, starGlints: sky.starGlints,
40
+ });
41
+ }
42
+
43
+ const row = (k, v) => `<div class="abrow"><span>${k}</span><b>${v ?? '–'}</b></div>`;
44
+ const esc = (s) => String(s ?? '').replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
45
+
46
+ /**
47
+ * The page. Three blocks of fact and one line of credit.
48
+ *
49
+ * Every figure is something the monitor already knows, or one cheap call: the build and version
50
+ * from /api/build (which recomputes the digest per request, so this is the code on disk, not the
51
+ * code at boot), the host from /api/about, and the node's own version string from the snapshot
52
+ * that every other page is already using.
53
+ */
54
+ // the donation address copies on click, once bound (the section is static markup, so once is enough)
55
+ function bindDonate(h) {
56
+ const btn = document.getElementById('abDonate');
57
+ if (!btn || btn.__bound) return;
58
+ btn.__bound = true;
59
+ btn.addEventListener('click', () => {
60
+ copyText(btn.dataset.copy)
61
+ .then(() => { btn.classList.add('done'); btn.querySelector('.abdonhint').textContent = 'copied'; setTimeout(() => { btn.classList.remove('done'); btn.querySelector('.abdonhint').textContent = 'click to copy'; }, 1600); h.toast?.('address copied', 'ok'); })
62
+ .catch(() => h.toast?.('the browser refused to copy', 'bad'));
63
+ });
64
+ }
65
+
66
+ export function renderAbout(s, state, h) {
67
+ drawSky();
68
+ bindDonate(h);
69
+
70
+ // one fetch, once -- the host's OS does not change while the page is open
71
+ if (!S.asked) {
72
+ S.asked = true;
73
+ h.api('/api/about').then((d) => { S.host = d; h.render?.(); }).catch(() => { S.host = { error: true }; });
74
+ }
75
+
76
+ const app = document.getElementById('abApp');
77
+ const host = document.getElementById('abHost');
78
+ const node = document.getElementById('abNode');
79
+ const ver = document.getElementById('ver')?.textContent ?? '';
80
+
81
+ if (app) {
82
+ const b = S.host ?? {};
83
+ const html = row('version', esc(b.version ?? ver.replace(/^v/, '').split(' · ')[0] ?? '–'))
84
+ + row('build', esc(b.build ?? '–'))
85
+ + row('licence', 'Apache-2.0')
86
+ + row('dependencies', 'none');
87
+ if (app.__h !== html) { app.innerHTML = html; app.__h = html; }
88
+ }
89
+
90
+ if (host) {
91
+ const b = S.host;
92
+ const html = !b ? '<div class="abrow"><span>reading the host…</span><b></b></div>'
93
+ : b.error ? '<div class="abrow"><span>host details</span><b>unavailable</b></div>'
94
+ : row('operating system', `${esc(b.platform)} ${esc(b.release)}`)
95
+ + row('architecture', esc(b.arch))
96
+ + row('processors', b.cpus != null ? `${b.cpus}${b.cpuModel ? ` × ${esc(b.cpuModel)}` : ''}` : '–')
97
+ + row('memory', b.totalMemGb != null ? `${b.totalMemGb} GB` : '–')
98
+ + row('runtime', `Node.js ${esc(b.node)}`)
99
+ + row('monitor uptime', b.uptimeSec != null ? `${Math.floor(b.uptimeSec / 3600)} h ${Math.floor((b.uptimeSec % 3600) / 60)} m` : '–');
100
+ if (host.__h !== html) { host.innerHTML = html; host.__h = html; }
101
+ }
102
+
103
+ if (node) {
104
+ const n = s?.network ?? null;
105
+ const html = row('node', esc(s?.label ?? '–'))
106
+ + row('version', esc(n?.subversion ?? '–'))
107
+ + row('protocol', n?.protocol ?? '–')
108
+ + row('chain', esc(s?.chain ?? '–'))
109
+ + row('height', s?.tip?.height != null ? h.fmt.num(s.tip.height) : '–');
110
+ if (node.__h !== html) { node.innerHTML = html; node.__h = html; }
111
+ }
112
+ }