blockyard 0.0.1 → 0.0.9

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 (107) hide show
  1. package/CHANGELOG.md +679 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +4 -0
  4. package/README.md +172 -4
  5. package/SECURITY.md +38 -0
  6. package/bin/blockyard.js +40 -0
  7. package/config/pool-map.json +2620 -0
  8. package/docs/API.md +1575 -0
  9. package/docs/ARCHITECTURE.md +1307 -0
  10. package/docs/AUTO-UPDATE.md +269 -0
  11. package/docs/CONFIGURATION.md +840 -0
  12. package/docs/DEFECTS.md +813 -0
  13. package/docs/EFFECTS-AGENTS.md +448 -0
  14. package/docs/GETTING-STARTED.md +202 -0
  15. package/docs/INSTALL.md +490 -0
  16. package/docs/MEASUREMENTS.md +1254 -0
  17. package/docs/PRIVATE-LEADERBOARD.md +230 -0
  18. package/docs/RULES.md +681 -0
  19. package/docs/SECURITY-AUDIT-2026-09-14.md +177 -0
  20. package/docs/SECURITY-AUDIT.md +258 -0
  21. package/docs/SECURITY.md +195 -0
  22. package/docs/STATE-2026-09-09.md +200 -0
  23. package/docs/TROUBLESHOOTING.md +298 -0
  24. package/docs/USER-GUIDE.md +1022 -0
  25. package/package.json +53 -5
  26. package/public/404.html +9 -0
  27. package/public/css/app.css +1785 -0
  28. package/public/index.html +893 -0
  29. package/public/js/about.js +112 -0
  30. package/public/js/agents.js +964 -0
  31. package/public/js/app.js +1312 -0
  32. package/public/js/arkanoid.js +806 -0
  33. package/public/js/blockanoid.js +347 -0
  34. package/public/js/blockout.js +347 -0
  35. package/public/js/blockpack.js +428 -0
  36. package/public/js/blockscene3d.js +2678 -0
  37. package/public/js/breakout.js +224 -0
  38. package/public/js/charts.js +635 -0
  39. package/public/js/depthchart.js +311 -0
  40. package/public/js/details3d.js +2957 -0
  41. package/public/js/explorer.js +405 -0
  42. package/public/js/feepalette.js +149 -0
  43. package/public/js/fmt.js +162 -0
  44. package/public/js/goggles.js +886 -0
  45. package/public/js/kiosk.js +41 -0
  46. package/public/js/login.js +83 -0
  47. package/public/js/markets.js +357 -0
  48. package/public/js/mining.js +1138 -0
  49. package/public/js/panels.js +966 -0
  50. package/public/js/pricechart.js +188 -0
  51. package/public/js/settings.js +1014 -0
  52. package/public/js/tetris.js +226 -0
  53. package/public/js/tetrust.js +356 -0
  54. package/public/js/tetsound.js +175 -0
  55. package/public/login.html +33 -0
  56. package/scripts/blockfile-measure.js +156 -0
  57. package/scripts/browser-check.mjs +286 -0
  58. package/scripts/check.js +173 -0
  59. package/scripts/decode-check.js +81 -0
  60. package/scripts/doc-counts.js +109 -0
  61. package/scripts/donate-qr.py +20 -0
  62. package/scripts/fake-node.js +534 -0
  63. package/scripts/index-bench.js +216 -0
  64. package/scripts/index-benchmark.js +117 -0
  65. package/scripts/index-build.js +40 -0
  66. package/scripts/live-render-check.mjs +89 -0
  67. package/scripts/manage-users.js +132 -0
  68. package/scripts/motion-check.mjs +138 -0
  69. package/scripts/pool-map.js +157 -0
  70. package/scripts/setup.js +410 -0
  71. package/scripts/shots.mjs +272 -0
  72. package/scripts/smoke.sh +327 -0
  73. package/scripts/ui.js +174 -0
  74. package/server/auth/sessions.js +221 -0
  75. package/server/auth/users.js +243 -0
  76. package/server/chain/blockfile.js +234 -0
  77. package/server/chain/index/build.js +193 -0
  78. package/server/chain/index/heights.js +36 -0
  79. package/server/chain/index/live.js +276 -0
  80. package/server/chain/index/rows.js +145 -0
  81. package/server/chain/index/store.js +154 -0
  82. package/server/chain/index/worker.js +109 -0
  83. package/server/chain/tx.js +310 -0
  84. package/server/collect/gbt.js +229 -0
  85. package/server/collect/logparse.js +765 -0
  86. package/server/collect/logtail.js +189 -0
  87. package/server/collect/markets.js +333 -0
  88. package/server/collect/mining.js +333 -0
  89. package/server/collect/monitor.js +2516 -0
  90. package/server/collect/nextblock.js +275 -0
  91. package/server/collect/sync.js +386 -0
  92. package/server/config.js +620 -0
  93. package/server/http/api.js +1275 -0
  94. package/server/http/explorer.js +418 -0
  95. package/server/http/server.js +412 -0
  96. package/server/http/sse.js +176 -0
  97. package/server/http/static.js +212 -0
  98. package/server/main.js +628 -0
  99. package/server/netinfo.js +253 -0
  100. package/server/rpc/allowlist.js +130 -0
  101. package/server/rpc/client.js +414 -0
  102. package/server/store/audit.js +148 -0
  103. package/server/store/history.js +220 -0
  104. package/server/store/ledger.js +290 -0
  105. package/server/store/ring.js +173 -0
  106. package/server/util/fmt.js +29 -0
  107. package/systemd/blockyard.service +100 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 BobClawblaw and contributors
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ BlockYard
2
+ Copyright 2026 BobClawblaw and contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0.
package/README.md CHANGED
@@ -1,6 +1,174 @@
1
- # blockyard
1
+ # BlockYard
2
2
 
3
- This package name is reserved for **Blockyard**, a self-hosted monitor for a Bitcoin
4
- node: live charts, a 3D block-space viewer, a block explorer and a markets view.
3
+ A live, multi-user web monitor and block explorer for
4
+ [Bitcoin Core](https://github.com/bitcoin/bitcoin).
5
5
 
6
- Nothing is published here yet. Source: https://github.com/BobClawblaw/blockyard
6
+ Point it at your node and open a browser: live charts, a 3D block-space viewer,
7
+ a block / transaction / address explorer, exchange prices with order-book depth, and a
8
+ kiosk view for a wall screen. No dependencies to install, no CDN, no telemetry, and
9
+ read-only toward your node by default.
10
+
11
+ **This is 100% machine-generated code, directed by a human operator.** Every line of the
12
+ server, the browser app, the 3D engine, the tests and these documents was written by an AI
13
+ under a human's direction, and all auditing has been performed by AI and is published in this
14
+ repository ([docs/SECURITY-AUDIT.md](docs/SECURITY-AUDIT.md), [docs/SECURITY-AUDIT-2026-09-14.md](docs/SECURITY-AUDIT-2026-09-14.md), [docs/DEFECTS.md](docs/DEFECTS.md),
15
+ [docs/MEASUREMENTS.md](docs/MEASUREMENTS.md)). It is **experimental pre-release software: expect
16
+ bugs.**
17
+
18
+ ![Overview](docs/images/overview.jpg)
19
+
20
+ ## Highlights
21
+
22
+ | | |
23
+ |---|---|
24
+ | **Block space, in 3D.** The next block's worth of the mempool as a board of glowing tiles: area is vbytes, colour is feerate. Refreshes are choreographed — blocks lift, travel in collision-free lanes and land under gravity — and the board comes alive at rest with **30 idle effects**, from ripples and light cycles to a lightning ball, ball lightning, a UFO's tractor beam, Missile Command, fireworks, code rain and a demoscene plasma. Two viewer modes: **Simple** (the richest few hundred transactions as cubes) and **Detailed** (every transaction in the block). | ![Block space, Detailed mode](docs/images/block-space-mode2.jpg) |
25
+ | **A board you can tune.** Neon-tube blocks, a metallic sheen or a chrome finish that mirrors a horizon, a movable lamp, a touch of perspective, a spiral galaxy behind the board, and a switch for every one of the 30 effects — in a tabbed settings panel. Stored on the server (`config/blockyard.json`), so every screen sees the same board; they change how things are *drawn*, never what is measured. | ![Neon blocks and the metallic sheen](docs/images/block-space-neon.jpg) |
26
+ | **An explorer that looks the part.** Search a height, block hash, txid or address. Transaction pages with fee, fee rate and dollar value, feature badges, a flow diagram from inputs to outputs, and links to where every coin came from and went. **Address pages with full history and balance** — Bitcoin Core has no address index, so BlockYard builds its own from the node's block files (**a few hours** on first start, 124 GB) and keeps it current as blocks arrive. | ![Explorer transaction](docs/images/explorer-tx.jpg) |
27
+ | **Markets.** Five exchanges' public prices: a 3D candle chart with a neon price line, a precise flat candlestick chart, an exchange table, and a bitcoinity-style order-book depth chart with change bars. Fetched by the server only while someone is looking. | ![Markets](docs/images/markets.jpg) |
28
+ | **Kiosk.** The 3D markets board, a price panel and the block-space board side by side, full screen with one click. | ![Kiosk](docs/images/kiosk.jpg) |
29
+ | **Tetrust, Blockout and Blockanoid.** Three playable games built on the same 3D engine — trust, but verify. Tetrust is Tetris: the well is the block-space board and the music is synthesised in the browser. Blockout is Breakout, where the wall is made of block-space stones and the bat follows your mouse. Blockanoid is Arkanoid: a different wall every level, silver bricks that take more than one hit, gold that takes none, and capsules that fall out of what you break — laser, wide, catch, slow, three balls, a life. All three pause when you look away and keep high scores per browser. | ![Tetrust](docs/images/tetrust.jpg) |
30
+
31
+ Also on board: a sync viewer with an honest ETA, Block flow (projected blocks, the block
32
+ being built, recent blocks), mempool and fee charts, a peer table, bandwidth, the node's
33
+ event stream, a provenance table for every figure, a read-only RPC console behind a
34
+ default-deny allowlist, and a tabbed **Display settings** panel (the gear) that tunes every
35
+ board without a reload.
36
+
37
+ ## Quick start
38
+
39
+ You need **Node.js 22 or newer** and a running **Bitcoin Core 25.0 or later** with `server=1`
40
+ and `txindex=1`, **on the same machine** — BlockYard reads the node's block files to build the
41
+ explorer's address index, and a node on another machine is not supported. Without `txindex` the
42
+ explorer cannot look a confirmed transaction up by id; everything else works without it (see
43
+ [Requirements](docs/INSTALL.md#1-requirements)). Plan for disk: the index is about **125 GB**, on
44
+ top of the node's own ~875 GB of block files.
45
+
46
+ ```bash
47
+ git clone https://github.com/BobClawblaw/blockyard.git
48
+ cd blockyard
49
+ npm test # optional: 862 unit tests, all built in
50
+ npm run setup # reads the node's bitcoin.conf, checks the node, writes config/local.json
51
+ npm start # builds the address index in the background (a few hours); open http://127.0.0.1:21000
52
+ ```
53
+
54
+ `npm run setup` asks for the node's data directory, reads its `bitcoin.conf` for the rest,
55
+ proves the credentials, the chain, `txindex`, the block files and how fast the node answers,
56
+ writes `config/local.json`, and offers to start BlockYard there and then. The address index is
57
+ built **by BlockYard itself, in the background**, the first time it starts, and **it takes a few
58
+ hours** — about two on the default four workers on NVMe, longer on spinning disks (30 minutes on
59
+ 16 workers) — with progress on the Overview and a notification when it is done; every other page
60
+ works meanwhile, and address pages fill in once it finishes. Step by step for macOS and Linux: **[docs/GETTING-STARTED.md](docs/GETTING-STARTED.md)**.
61
+ To try it first without a node: `npm run dev` runs against a built-in fake one on port 18088.
62
+ To check a setup again later: `npm run check`.
63
+
64
+ **Why the same machine?** Running BlockYard elsewhere and reading a node over RPC alone was
65
+ tried (2026-09-13) and abandoned: the charts filled in, but the explorer could not be made to
66
+ work in real time over RPC — Core has no address index, and the one RPC that can answer a
67
+ balance holds the node's RPC thread for tens of seconds per query. The address data has to be
68
+ rebuilt from the block files and stored locally, the way mempool.space's `electrs` does it, so
69
+ BlockYard lives next to the node. See
70
+ [It runs on the node's machine](docs/INSTALL.md#it-runs-on-the-nodes-machine).
71
+
72
+ The full walkthrough — service install, network exposure, accounts, TLS, a reverse proxy —
73
+ is in **[docs/INSTALL.md](docs/INSTALL.md)**.
74
+
75
+ ## Documentation
76
+
77
+ | document | what it covers |
78
+ |---|---|
79
+ | [Getting started](docs/GETTING-STARTED.md) | macOS or Linux, from a command prompt: Core settings, Node 22, `npm run setup`, the background index build, running it |
80
+ | [Install](docs/INSTALL.md) | requirements, first run, systemd service, exposure, accounts, TLS, reverse proxy, updating |
81
+ | [Configuration](docs/CONFIGURATION.md) | every config key and environment variable, with examples |
82
+ | [User guide](docs/USER-GUIDE.md) | a tour of every tab and panel, and how to read them |
83
+ | [API](docs/API.md) | the JSON HTTP API and the Server-Sent Events stream |
84
+ | [Architecture](docs/ARCHITECTURE.md) | server, RPC lane, collectors, browser app and the 3D engine |
85
+ | [Security & privacy](docs/SECURITY.md) | the access model, hardening, and every outbound connection |
86
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | the problems people actually hit, and the fixes |
87
+ | [Contributing](CONTRIBUTING.md) | development setup, tests, and the project's rules |
88
+ | [Changelog](CHANGELOG.md) | release history |
89
+
90
+ Deeper reference material: [docs/RULES.md](docs/RULES.md) (the rules, each with the defect
91
+ that produced it), [docs/MEASUREMENTS.md](docs/MEASUREMENTS.md) (the node measurements the
92
+ design rests on) and [docs/DEFECTS.md](docs/DEFECTS.md) (known limits).
93
+
94
+ ## Design principles
95
+
96
+ - **Read-only by default.** The monitor never writes to your node unless you enable
97
+ individual actions, with accounts on and a typed confirmation per call.
98
+ - **A good guest.** Every request goes through one serialized, prioritised, batched lane,
99
+ so the monitor never opens a burst of parallel calls against your node's RPC threads.
100
+ It would rather skip a poll than slow your node down.
101
+ - **Honest data.** A missing figure is shown as missing, never as zero; stale data looks
102
+ stale; inferred numbers are labelled as inferences; every figure's source is listed on
103
+ the Node & RPC page.
104
+ - **Zero dependencies.** Node built-ins on the server; vanilla ES modules and hand-written
105
+ canvas rendering in the browser. No build step, no CDN, nothing fetched from third
106
+ parties by your browser.
107
+
108
+ ## Security at a glance
109
+
110
+ - **Open, read-only access by default** — like a block explorer, anyone who can reach the
111
+ port can look. Accounts, roles, sessions, CSRF protection and a per-user audit trail turn
112
+ on with `BLOCKYARD_AUTH=1`.
113
+ - **Where it listens is your decision** — bind to `127.0.0.1`, a LAN address, a VPN
114
+ address, or several. Built-in HTTPS with `BLOCKYARD_TLS_CERT` / `BLOCKYARD_TLS_KEY`.
115
+ - **Outbound connections are limited and on demand**: exchange APIs only while someone has
116
+ the Markets, Kiosk or Overview tab open — Overview's price line is on by default, so the landing
117
+ page reaches out unless you switch it off — plus a cached spot price for the explorer's dollar
118
+ figures. `BLOCKYARD_MARKETS=0` turns all of it off.
119
+
120
+ Details in [docs/SECURITY.md](docs/SECURITY.md). To report a vulnerability, see
121
+ [SECURITY.md](SECURITY.md).
122
+
123
+ ## Development
124
+
125
+ ```bash
126
+ npm run dev # fake node doing a simulated sync, port 18088
127
+ npm run setup # interactive install: read bitcoin.conf, check the node, write config/local.json
128
+ npm run check # the same checks (every call timed) against every configured node; exits 1 on a FAIL
129
+ npm test # 862 unit tests (node:test, no dependencies)
130
+ npm run smoke # boots the real server and checks the HTTP contract
131
+ npm run counts:fix # keep the documented test count in step with the suite
132
+ ```
133
+
134
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the project's rules (CSP, canvas, privacy,
135
+ RPC etiquette) and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for how it fits together.
136
+
137
+ ## Status
138
+
139
+ Version **0.0.9** — the initial release, and pre-release software: the word is meant literally. The test suite is
140
+ comprehensive (862 tests, plus a live smoke run), the monitoring side is solid, and the
141
+ explorer's biggest gap is closed: **address history and balances**, which Bitcoin Core cannot
142
+ answer at any setting, now come from an **address index BlockYard builds itself** from the
143
+ node's block and undo files and keeps current as blocks arrive. It is checked against the node
144
+ (every balance equal to `scantxoutset`, to the satoshi) and costs ~30 minutes on 16 workers and
145
+ 124 GB of disk, built in the background the first time BlockYard starts and paced so the node's
146
+ RPC stays responsive; without one, the address page says *not indexed* rather than showing a
147
+ zero. An address's unspent outputs are listed too (for a history of up to 100 transactions).
148
+ What it does not yet have: an address's mempool transactions.
149
+
150
+ Everything here was written by an AI directed by a human, and audited by AI:
151
+ [docs/SECURITY-AUDIT.md](docs/SECURITY-AUDIT.md) and
152
+ [docs/SECURITY-AUDIT-2026-09-14.md](docs/SECURITY-AUDIT-2026-09-14.md) are the audits, findings
153
+ and remediation included. The test suite runs in CI on Ubuntu, macOS and Windows (Node 22 and 24);
154
+ a real install has been done on macOS (Core 29.1) and Linux, and Windows has only the test suite.
155
+ [docs/DEFECTS.md](docs/DEFECTS.md) lists five open items, honestly stated, with the
156
+ measurements behind each. Read it before deploying: several are node-capability limits
157
+ rather than bugs, and knowing which is which matters.
158
+
159
+ ## Acknowledgements
160
+
161
+ The block-space view and the explorer are inspired by the look of
162
+ [mempool.space](https://mempool.space); the markets tab by
163
+ [bitcoinity.org](https://data.bitcoinity.org). Market data comes from the public APIs of
164
+ Coinbase, Kraken, Bitstamp, Bitfinex and OKX. The mining-pool labels shipped in
165
+ `config/pool-map.json` are mempool.space's curated
166
+ [mining-pools](https://github.com/mempool/mining-pools) list (MIT, 151 pools).
167
+
168
+ ## License
169
+
170
+ Apache License 2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE). The block-space packer and feerate palette are an original implementation (public/js/blockpack.js, public/js/feepalette.js), inspired by the look of mempool.space but containing none of its code.
171
+
172
+ ---
173
+
174
+ <sub>If BlockYard is useful to you: `bc1q249cv27lc2q7y0x53vkczgfvvgsjzhwxwv42gc`</sub>
package/SECURITY.md ADDED
@@ -0,0 +1,38 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ | version | supported |
6
+ |---|---|
7
+ | 0.0.9 | yes |
8
+ | anything else | no (never released) |
9
+
10
+ ## Reporting a vulnerability
11
+
12
+ Please report security problems **privately**, not in a public issue:
13
+
14
+ 1. On GitHub, open the repository's **Security** tab and choose **Report a vulnerability**
15
+ (private vulnerability reporting), or
16
+ 2. contact the maintainer through their GitHub profile and ask for a private channel.
17
+
18
+ Include what you found, the version or commit, how to reproduce it, and the impact you
19
+ expect. If you have a fix in mind, describe it — but please do not open a public pull request
20
+ for an unpatched vulnerability.
21
+
22
+ What to expect:
23
+
24
+ - an acknowledgement within a few days;
25
+ - an assessment and, if confirmed, a fix and a release with credit to you (unless you prefer
26
+ otherwise);
27
+ - coordinated disclosure once a fixed release is available.
28
+
29
+ ## Scope
30
+
31
+ In scope: the monitor's server and browser code in this repository — authentication and
32
+ sessions, the RPC allowlist and node-write gates, the HTTP API, the CSP and other headers, and
33
+ anything that could leak node data or credentials.
34
+
35
+ Out of scope: vulnerabilities in the Bitcoin node itself (report those to the node's project),
36
+ in Node.js, or in the exchanges whose public APIs the Markets tab reads; and deployments that
37
+ deliberately expose an open (no-accounts) monitor to untrusted networks — that is a
38
+ configuration choice described in [docs/SECURITY.md](docs/SECURITY.md).
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ // THE COMMAND, for an install from npm (`npm install -g blockyard`):
3
+ //
4
+ // blockyard setup ask where the node is, check it, write the config, build the index
5
+ // blockyard start run the monitor
6
+ // blockyard check the same checks as setup, any time
7
+ // blockyard index-build build the address index by hand (--out <dir> [--workers N])
8
+ // blockyard users manage accounts (list / create / passwd / role)
9
+ //
10
+ // A global install lives wherever npm puts packages, which is nowhere to keep a config or 124 GB
11
+ // of index; so unless the environment says otherwise, this command keeps everything under
12
+ // ~/.blockyard: local.json (the config), data/ (state, and the index at data/index). A checkout
13
+ // run with `npm run …` keeps config/ and data/ inside the checkout, as before, because it does
14
+ // not come through here.
15
+ import path from 'node:path';
16
+ import os from 'node:os';
17
+ import { fileURLToPath } from 'node:url';
18
+
19
+ const home = process.env.BLOCKYARD_HOME ?? path.join(os.homedir(), '.blockyard');
20
+ process.env.BLOCKYARD_CONFIG ??= path.join(home, 'local.json');
21
+ process.env.BLOCKYARD_DATA ??= path.join(home, 'data');
22
+
23
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
24
+ const COMMANDS = {
25
+ setup: 'scripts/setup.js',
26
+ check: 'scripts/check.js',
27
+ start: 'server/main.js',
28
+ 'index-build': 'scripts/index-build.js',
29
+ users: 'scripts/manage-users.js',
30
+ };
31
+ const cmd = process.argv[2];
32
+ if (!COMMANDS[cmd]) {
33
+ const version = JSON.parse((await import('node:fs')).readFileSync(path.join(root, 'package.json'), 'utf8')).version;
34
+ process.stdout.write(`BlockYard ${version}\n\n blockyard setup ask where the node is, check it, write the config, build the index\n blockyard start run the monitor\n blockyard check the same checks as setup, any time\n blockyard index-build build the address index by hand (--out <dir> [--workers N])\n blockyard users manage accounts\n\nconfig ${process.env.BLOCKYARD_CONFIG}\ndata ${process.env.BLOCKYARD_DATA}\n`);
35
+ process.exit(cmd ? 2 : 0);
36
+ }
37
+ // the scripts decide "am I being run directly?" by comparing argv[1] to their own path, so hand
38
+ // them the path they expect rather than this file's
39
+ process.argv.splice(1, 2, path.join(root, COMMANDS[cmd]));
40
+ await import(path.join(root, COMMANDS[cmd]));