@vtechcom/hexcore 2.0.0-beta.1

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 (173) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/LICENSE +201 -0
  3. package/README.md +283 -0
  4. package/dist/app.module.js +55 -0
  5. package/dist/app.module.js.map +1 -0
  6. package/dist/auth.js +151 -0
  7. package/dist/auth.js.map +1 -0
  8. package/dist/chain/cost-models.js +81 -0
  9. package/dist/chain/cost-models.js.map +1 -0
  10. package/dist/chain/provider.js +269 -0
  11. package/dist/chain/provider.js.map +1 -0
  12. package/dist/chain/socket.js +48 -0
  13. package/dist/chain/socket.js.map +1 -0
  14. package/dist/cli/doctor.js +43 -0
  15. package/dist/cli/doctor.js.map +1 -0
  16. package/dist/cli/hexcore.js +435 -0
  17. package/dist/cli/hexcore.js.map +1 -0
  18. package/dist/common/auth.guard.js +66 -0
  19. package/dist/common/auth.guard.js.map +1 -0
  20. package/dist/common/http.js +171 -0
  21. package/dist/common/http.js.map +1 -0
  22. package/dist/common/zod-validation.pipe.js +47 -0
  23. package/dist/common/zod-validation.pipe.js.map +1 -0
  24. package/dist/config.js +354 -0
  25. package/dist/config.js.map +1 -0
  26. package/dist/config.module.js +35 -0
  27. package/dist/config.module.js.map +1 -0
  28. package/dist/controllers/cardano.controller.js +173 -0
  29. package/dist/controllers/cardano.controller.js.map +1 -0
  30. package/dist/controllers/heads.controller.js +225 -0
  31. package/dist/controllers/heads.controller.js.map +1 -0
  32. package/dist/controllers/setup.controller.js +127 -0
  33. package/dist/controllers/setup.controller.js.map +1 -0
  34. package/dist/controllers/system.controller.js +153 -0
  35. package/dist/controllers/system.controller.js.map +1 -0
  36. package/dist/db/database.module.js +73 -0
  37. package/dist/db/database.module.js.map +1 -0
  38. package/dist/db/index.js +135 -0
  39. package/dist/db/index.js.map +1 -0
  40. package/dist/db/repositories.js +220 -0
  41. package/dist/db/repositories.js.map +1 -0
  42. package/dist/docker/container-stats.js +134 -0
  43. package/dist/docker/container-stats.js.map +1 -0
  44. package/dist/docker/docker.service.js +335 -0
  45. package/dist/docker/docker.service.js.map +1 -0
  46. package/dist/hydra/argv.js +172 -0
  47. package/dist/hydra/argv.js.map +1 -0
  48. package/dist/hydra/blockfrost-keys.js +15 -0
  49. package/dist/hydra/blockfrost-keys.js.map +1 -0
  50. package/dist/hydra/boot-progress.js +165 -0
  51. package/dist/hydra/boot-progress.js.map +1 -0
  52. package/dist/hydra/capabilities.js +131 -0
  53. package/dist/hydra/capabilities.js.map +1 -0
  54. package/dist/hydra/head.service.js +1072 -0
  55. package/dist/hydra/head.service.js.map +1 -0
  56. package/dist/hydra/keys.js +301 -0
  57. package/dist/hydra/keys.js.map +1 -0
  58. package/dist/hydra/node-monitor.service.js +265 -0
  59. package/dist/hydra/node-monitor.service.js.map +1 -0
  60. package/dist/hydra/ws-client.js +177 -0
  61. package/dist/hydra/ws-client.js.map +1 -0
  62. package/dist/main.js +106 -0
  63. package/dist/main.js.map +1 -0
  64. package/dist/preflight.js +215 -0
  65. package/dist/preflight.js.map +1 -0
  66. package/dist/settings.js +243 -0
  67. package/dist/settings.js.map +1 -0
  68. package/dist/setup.service.js +257 -0
  69. package/dist/setup.service.js.map +1 -0
  70. package/dist/version.js +46 -0
  71. package/dist/version.js.map +1 -0
  72. package/node_modules/@hexcore/shared/dist/cjs/api.d.ts +730 -0
  73. package/node_modules/@hexcore/shared/dist/cjs/api.d.ts.map +1 -0
  74. package/node_modules/@hexcore/shared/dist/cjs/api.js +358 -0
  75. package/node_modules/@hexcore/shared/dist/cjs/api.js.map +1 -0
  76. package/node_modules/@hexcore/shared/dist/cjs/domain.d.ts +298 -0
  77. package/node_modules/@hexcore/shared/dist/cjs/domain.d.ts.map +1 -0
  78. package/node_modules/@hexcore/shared/dist/cjs/domain.js +49 -0
  79. package/node_modules/@hexcore/shared/dist/cjs/domain.js.map +1 -0
  80. package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.d.ts +279 -0
  81. package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.d.ts.map +1 -0
  82. package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.js +453 -0
  83. package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.js.map +1 -0
  84. package/node_modules/@hexcore/shared/dist/cjs/index.d.ts +7 -0
  85. package/node_modules/@hexcore/shared/dist/cjs/index.d.ts.map +1 -0
  86. package/node_modules/@hexcore/shared/dist/cjs/index.js +23 -0
  87. package/node_modules/@hexcore/shared/dist/cjs/index.js.map +1 -0
  88. package/node_modules/@hexcore/shared/dist/cjs/naming.d.ts +118 -0
  89. package/node_modules/@hexcore/shared/dist/cjs/naming.d.ts.map +1 -0
  90. package/node_modules/@hexcore/shared/dist/cjs/naming.js +103 -0
  91. package/node_modules/@hexcore/shared/dist/cjs/naming.js.map +1 -0
  92. package/node_modules/@hexcore/shared/dist/cjs/offline.d.ts +73 -0
  93. package/node_modules/@hexcore/shared/dist/cjs/offline.d.ts.map +1 -0
  94. package/node_modules/@hexcore/shared/dist/cjs/offline.js +80 -0
  95. package/node_modules/@hexcore/shared/dist/cjs/offline.js.map +1 -0
  96. package/node_modules/@hexcore/shared/dist/cjs/protocol-params.d.ts +79 -0
  97. package/node_modules/@hexcore/shared/dist/cjs/protocol-params.d.ts.map +1 -0
  98. package/node_modules/@hexcore/shared/dist/cjs/protocol-params.js +223 -0
  99. package/node_modules/@hexcore/shared/dist/cjs/protocol-params.js.map +1 -0
  100. package/node_modules/@hexcore/shared/dist/esm/api.js +355 -0
  101. package/node_modules/@hexcore/shared/dist/esm/api.js.map +1 -0
  102. package/node_modules/@hexcore/shared/dist/esm/domain.js +46 -0
  103. package/node_modules/@hexcore/shared/dist/esm/domain.js.map +1 -0
  104. package/node_modules/@hexcore/shared/dist/esm/hydra-versions.js +441 -0
  105. package/node_modules/@hexcore/shared/dist/esm/hydra-versions.js.map +1 -0
  106. package/node_modules/@hexcore/shared/dist/esm/index.js +7 -0
  107. package/node_modules/@hexcore/shared/dist/esm/index.js.map +1 -0
  108. package/node_modules/@hexcore/shared/dist/esm/naming.js +95 -0
  109. package/node_modules/@hexcore/shared/dist/esm/naming.js.map +1 -0
  110. package/node_modules/@hexcore/shared/dist/esm/offline.js +75 -0
  111. package/node_modules/@hexcore/shared/dist/esm/offline.js.map +1 -0
  112. package/node_modules/@hexcore/shared/dist/esm/package.json +3 -0
  113. package/node_modules/@hexcore/shared/dist/esm/protocol-params.js +217 -0
  114. package/node_modules/@hexcore/shared/dist/esm/protocol-params.js.map +1 -0
  115. package/node_modules/@hexcore/shared/package.json +15 -0
  116. package/package.json +67 -0
  117. package/web/200.html +23 -0
  118. package/web/404.html +23 -0
  119. package/web/_nuxt/2MxohCD-.js +1 -0
  120. package/web/_nuxt/4pFXjB_u.js +1 -0
  121. package/web/_nuxt/B-v0dEQX.js +1 -0
  122. package/web/_nuxt/B4yE3U25.js +1 -0
  123. package/web/_nuxt/BFh8Ai0L.js +1 -0
  124. package/web/_nuxt/BgPn4NJH.js +1 -0
  125. package/web/_nuxt/Bj1xviSh.js +1 -0
  126. package/web/_nuxt/BnotlrL7.js +1 -0
  127. package/web/_nuxt/C1YRg2ic.js +1 -0
  128. package/web/_nuxt/CGD7MYQH.js +1 -0
  129. package/web/_nuxt/CQcG7Bu4.js +1 -0
  130. package/web/_nuxt/CS3KqpH_.js +1 -0
  131. package/web/_nuxt/CT-yt694.js +1 -0
  132. package/web/_nuxt/CZK6xUH-.js +1 -0
  133. package/web/_nuxt/CcdyYRYz.js +1 -0
  134. package/web/_nuxt/CePNTU1S.js +1 -0
  135. package/web/_nuxt/CgPLsCeU.js +5 -0
  136. package/web/_nuxt/CkCrahXt.js +1 -0
  137. package/web/_nuxt/CnOqDT9k.js +3 -0
  138. package/web/_nuxt/CqsSss-D.js +1 -0
  139. package/web/_nuxt/Cr8dL64Q.js +1 -0
  140. package/web/_nuxt/D3CwzwU0.js +1 -0
  141. package/web/_nuxt/DDANn6-H.js +1 -0
  142. package/web/_nuxt/DDl9uKIA.js +1 -0
  143. package/web/_nuxt/DL9i0ayn.js +1 -0
  144. package/web/_nuxt/DLNoK9BC.js +1 -0
  145. package/web/_nuxt/DLztFeOQ.js +1 -0
  146. package/web/_nuxt/DPihKXdt.js +1 -0
  147. package/web/_nuxt/DXyr6Naa.js +1 -0
  148. package/web/_nuxt/DeDg5p0D.js +1 -0
  149. package/web/_nuxt/DgDlQiDU.js +1 -0
  150. package/web/_nuxt/DyPI7qJE.js +30 -0
  151. package/web/_nuxt/LGfPBi70.js +1 -0
  152. package/web/_nuxt/Onf26W-r.js +1 -0
  153. package/web/_nuxt/QZNQe_OX.js +1 -0
  154. package/web/_nuxt/Y8IJM-iz.js +1 -0
  155. package/web/_nuxt/YUGC0nt0.js +1 -0
  156. package/web/_nuxt/builds/latest.json +1 -0
  157. package/web/_nuxt/builds/meta/7e461629-93e2-4694-b237-6d5c6a85c97c.json +1 -0
  158. package/web/_nuxt/builds/meta/dev.json +1 -0
  159. package/web/_nuxt/entry.BxsAxZxf.css +1 -0
  160. package/web/_nuxt/error-404.XbtAw-qw.css +1 -0
  161. package/web/_nuxt/error-500.CNHVltWM.css +1 -0
  162. package/web/_nuxt/rS90pPZ_.js +1 -0
  163. package/web/_nuxt/rhEiP908.js +1 -0
  164. package/web/_nuxt/vSj9Ec0g.js +1 -0
  165. package/web/_nuxt/woNjBJMN.js +1 -0
  166. package/web/favicon.svg +28 -0
  167. package/web/heads/index.html +23 -0
  168. package/web/heads/new/index.html +23 -0
  169. package/web/index.html +23 -0
  170. package/web/login/index.html +23 -0
  171. package/web/logo.svg +56 -0
  172. package/web/settings/index.html +23 -0
  173. package/web/setup/index.html +23 -0
@@ -0,0 +1,453 @@
1
+ "use strict";
2
+ /**
3
+ * Per-version hydra-node argv profiles.
4
+ *
5
+ * hydra-node's flag set moves between releases: 0.22.x has `--blockfrost` and
6
+ * `--network` but neither `--unsynced-period` nor the Blockfrost timeout knobs,
7
+ * which arrived in the 2.x line. An unknown flag aborts hydra-node during
8
+ * option parsing, so the container dies instantly and the head reports a
9
+ * generic "node never became ready" that points nowhere near the real cause.
10
+ *
11
+ * This table is the declared answer for the versions we ship support for: which
12
+ * flags exist, and what values to pass when the operator has not overridden
13
+ * them. Adding a hydra-node release is deliberately a code change — a new entry
14
+ * here plus a bump of HYDRA_NODE_IMAGE — so a version's argv is reviewed and
15
+ * tested rather than guessed at runtime.
16
+ *
17
+ * Images that match no entry (a fork, a `master` tag, a release newer than this
18
+ * build) are not rejected: the control-plane falls back to probing
19
+ * `hydra-node --help`. See capabilities.ts.
20
+ *
21
+ * Lives in shared because the UI lists the same versions in the create form
22
+ * that the control-plane accepts.
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.FALLBACK_HYDRA_ARGS = exports.HYDRA_VERSION_PROFILES = exports.HYDRA_KNOWN_ISSUES = exports.HOST_PLATFORMS = void 0;
26
+ exports.isArm64 = isArm64;
27
+ exports.parseVersionTag = parseVersionTag;
28
+ exports.isVersionBefore = isVersionBefore;
29
+ exports.knownIssuesFor = knownIssuesFor;
30
+ exports.imageTag = imageTag;
31
+ exports.findVersionProfile = findVersionProfile;
32
+ exports.resolveHydraArgs = resolveHydraArgs;
33
+ exports.toVersionInfo = toVersionInfo;
34
+ exports.toHostPlatform = toHostPlatform;
35
+ /** Every platform this table distinguishes, for entries that apply to all. */
36
+ exports.HOST_PLATFORMS = [
37
+ 'darwin-arm64',
38
+ 'darwin-x64',
39
+ 'linux-arm64',
40
+ 'linux-x64',
41
+ 'unknown',
42
+ ];
43
+ /** True on a platform whose Docker cannot run an amd64 image natively. */
44
+ function isArm64(platform) {
45
+ return platform === 'darwin-arm64' || platform === 'linux-arm64';
46
+ }
47
+ /**
48
+ * Defects worth warning about, newest first.
49
+ *
50
+ * Add an entry when upstream confirms one that changes whether a version is
51
+ * safe to pin — with the issue link, so the claim is checkable and can be
52
+ * retired when it is fixed.
53
+ */
54
+ exports.HYDRA_KNOWN_ISSUES = [
55
+ {
56
+ // No upstream issue: this is how the images are built, not a bug in the
57
+ // node. Our own record carries the source references and the timings.
58
+ url: 'https://github.com/Vtechcom/hexcore-v2/issues/7',
59
+ title: 'The official image is amd64-only and will not run on an arm64 host',
60
+ impact: 'Every image cardano-scaling publishes is built for amd64 alone. On Apple Silicon it ' +
61
+ 'runs under Rosetta, and from 2.2.0 the node forces the whole KZG trusted setup into ' +
62
+ 'memory before it installs a tracer or opens its API socket — under Rosetta blst loses ' +
63
+ 'the CPU paths that make that fast, so the node stalls there printing nothing at all ' +
64
+ 'and the head fails as a plain readiness timeout with no clue in the log. On arm64 ' +
65
+ 'Linux the daemon simply refuses the image unless qemu is installed. Measured: the ' +
66
+ 'warm-up takes 0.47s on an arm64 rebuild of the same source and was never observed to ' +
67
+ 'finish under Rosetta. Use hydra-node 2.3.x (arm64) instead — same code, architecture ' +
68
+ 'fixed — or 2.1.x, which predates the warm-up but carries a double-spend defect.',
69
+ severity: 'blocker',
70
+ /**
71
+ * Keyed on the image and the host, not on the version range, and both
72
+ * halves matter. `aniadev9/hydra-node:2.3.0-arm64` parses as 2.3.0, so a
73
+ * version-range entry would put a blocker on the one image that fixes
74
+ * this; and on an amd64 host there is nothing wrong at all.
75
+ *
76
+ * Both arm64 platforms, even though only one of them fails silently —
77
+ * an image that cannot run is worth saying before someone pins it for
78
+ * the life of a head.
79
+ */
80
+ imagePattern: /(^|\/)cardano-scaling\/hydra-node(:|$)/,
81
+ hostPlatforms: ['darwin-arm64', 'linux-arm64'],
82
+ // The warm-up landed in 8ded45de4 / 016ec6ee2 (2026-05-27), tagged into
83
+ // 2.2.0. 2.1.0 predates it and boots under Rosetta.
84
+ affectedFrom: '2.2.0',
85
+ },
86
+ {
87
+ id: 2629,
88
+ url: 'https://github.com/cardano-scaling/hydra/issues/2629',
89
+ title: 'The same UTxO can end up spendable on both L1 and L2',
90
+ impact: 'After recovering an incremental-commit deposit and side-loading a snapshot, the recovered ' +
91
+ 'UTxO reappears in the L2 ledger while it is also back on L1 — spendable twice. Reported ' +
92
+ 'against 2.1.0 on preprod. Only reachable through incremental commit plus recover, but the ' +
93
+ 'consequence is a double spend, so treat a head that has done both as suspect.',
94
+ severity: 'blocker',
95
+ // Reported against 2.1.0. Incremental commit plus side-load has a
96
+ // different shape before 2.0, so the 0.22 line is not claimed here.
97
+ affectedFrom: '2.0.0',
98
+ fixedIn: '2.2.0',
99
+ },
100
+ {
101
+ id: 2642,
102
+ url: 'https://github.com/cardano-scaling/hydra/issues/2642',
103
+ title: 'Log rotation silently drops pending deposits',
104
+ impact: 'Rotation writes a checkpoint and discards the events behind it, but the replay path drops ' +
105
+ '`pendingDeposits` — so a deposit recorded before a rotation is unrecoverable after a restart ' +
106
+ 'except by hand. This one bites here in particular: every head hexcore creates sets ' +
107
+ '--persistence-rotate-after, so rotation is not a rare event.',
108
+ severity: 'blocker',
109
+ // The `Checkpoint` event and `aggregateNodeState` the issue points at
110
+ // are 2.x head logic.
111
+ affectedFrom: '2.0.0',
112
+ fixedIn: '2.3.0',
113
+ },
114
+ {
115
+ id: 2477,
116
+ url: 'https://github.com/cardano-scaling/hydra/issues/2477',
117
+ title: 'hydra-node crashes when Blockfrost rate-limits or resets the connection',
118
+ impact: 'A 403 from Blockfrost — which is what its rate limit returns — or a dropped connection ' +
119
+ 'kills the node outright. It does not retry and does not come back, so the head stays down ' +
120
+ 'until someone restarts it. Nodes sharing one project id hit the rate limit soonest.',
121
+ severity: 'blocker',
122
+ // Fixed by PR #2729, merged 2026-07-07; 2.3.0 was cut on 2026-07-15 and
123
+ // is the first release carrying it.
124
+ fixedIn: '2.3.0',
125
+ backends: ['blockfrost'],
126
+ },
127
+ {
128
+ id: 2697,
129
+ url: 'https://github.com/cardano-scaling/hydra/issues/2697',
130
+ title: 'Increment and Decrement validators omit `mustNotMintOrBurn`',
131
+ impact: 'Every other head transition guards against minting or burning; these two did not. Upstream ' +
132
+ 'found no exploit — a burn should still fail indirectly through the value check — but called ' +
133
+ 'that chain of reasoning fragile. Defence in depth rather than a known hole.',
134
+ severity: 'warning',
135
+ // Hydra.Contract.Head as it stands in the 2.x scripts; 0.22 ships
136
+ // different validators entirely.
137
+ affectedFrom: '2.0.0',
138
+ fixedIn: '2.2.0',
139
+ },
140
+ ];
141
+ /**
142
+ * Numeric version from an image tag, or null when it is not a release tag
143
+ * (`master`, a fork, a digest). Pre-release suffixes are ignored: `2.3.0-rc1`
144
+ * is treated as 2.3.0, which is the right call for "does this carry the fix".
145
+ */
146
+ function parseVersionTag(tag) {
147
+ const match = /^v?(\d+)\.(\d+)(?:\.(\d+))?/.exec(tag);
148
+ if (!match)
149
+ return null;
150
+ return [Number(match[1]), Number(match[2]), Number(match[3] ?? 0)];
151
+ }
152
+ /** True when `tag` names a release strictly older than `other`. */
153
+ function isVersionBefore(tag, other) {
154
+ const a = parseVersionTag(tag);
155
+ const b = parseVersionTag(other);
156
+ if (!a || !b)
157
+ return false;
158
+ for (let i = 0; i < 3; i++) {
159
+ if (a[i] !== b[i])
160
+ return a[i] < b[i];
161
+ }
162
+ return false;
163
+ }
164
+ /**
165
+ * Known issues that apply to an image, optionally narrowed to one backend.
166
+ *
167
+ * An unparseable tag yields nothing rather than everything: we genuinely do not
168
+ * know what a `master` build contains, and warning about every open issue on a
169
+ * version that may well have the fix is noise that trains people to ignore it.
170
+ */
171
+ function knownIssuesFor(image, backend, platform = 'unknown') {
172
+ const tag = imageTag(image);
173
+ if (!tag || !parseVersionTag(tag))
174
+ return [];
175
+ return exports.HYDRA_KNOWN_ISSUES.filter(issue => {
176
+ if (issue.fixedIn && !isVersionBefore(tag, issue.fixedIn))
177
+ return false;
178
+ if (issue.affectedFrom && isVersionBefore(tag, issue.affectedFrom))
179
+ return false;
180
+ if (backend && issue.backends && !issue.backends.includes(backend))
181
+ return false;
182
+ if (issue.imagePattern && !issue.imagePattern.test(image))
183
+ return false;
184
+ /**
185
+ * A platform-specific issue is hidden only when the host is known to be
186
+ * one it does not affect. `unknown` still shows it: a warning someone
187
+ * does not need is a smaller failure than a head that never boots and
188
+ * says nothing about why.
189
+ */
190
+ if (issue.hostPlatforms && platform !== 'unknown' && !issue.hostPlatforms.includes(platform))
191
+ return false;
192
+ return true;
193
+ });
194
+ }
195
+ /**
196
+ * Newest first — `findVersionProfile` returns the first match, so a more
197
+ * specific pattern must come before a broader one.
198
+ */
199
+ exports.HYDRA_VERSION_PROFILES = [
200
+ /**
201
+ * 2.3.0 rebuilt for arm64 — the same source, the architecture fixed.
202
+ *
203
+ * First in the list because `findVersionProfile` takes the first match and
204
+ * `2.3.0-arm64` also satisfies the 2.3 pattern below.
205
+ *
206
+ * It exists because upstream publishes amd64 only, and from 2.2.0 the node
207
+ * forces the KZG trusted setup into memory before it installs a tracer —
208
+ * under Rosetta that never finishes and prints nothing while failing. Native
209
+ * on arm64 the same warm-up takes 0.47s. See Vtechcom/hexcore-v2#7 for the
210
+ * measurements and docs/FIELD_NOTES.md for how they were taken.
211
+ *
212
+ * The flags are 2.3.0's because the code IS 2.3.0; nothing here was probed
213
+ * separately, and nothing needs to be.
214
+ *
215
+ * **This is a personal Docker Hub account, not one this project controls**,
216
+ * and recommending it makes that a supply-chain dependency for whoever takes
217
+ * the recommendation. It is offered anyway because the alternative on Apple
218
+ * Silicon is a version with a known double spend, and because it is
219
+ * reproducible: `tagPattern` matches the TAG, so anyone who rebuilds 2.3.0
220
+ * themselves and pushes `you/hydra-node:2.3.0-arm64` lands on this exact
221
+ * profile. Replace it the moment an image we own, or a multi-arch upstream
222
+ * one, exists.
223
+ */
224
+ {
225
+ id: '2.3-arm64',
226
+ label: 'hydra-node 2.3.x (arm64)',
227
+ image: 'aniadev9/hydra-node:2.3.0-arm64',
228
+ tagPattern: /^2\.3(\.\d+)?-arm64$/,
229
+ flags: {
230
+ unsyncedPeriod: true,
231
+ blockfrostTimeouts: true,
232
+ network: true,
233
+ blockfrost: true,
234
+ offline: true,
235
+ },
236
+ args: {
237
+ unsyncedPeriod: 180,
238
+ blockfrostQueryTimeout: 30,
239
+ blockfrostRetryTimeout: 300,
240
+ extraArgs: [],
241
+ },
242
+ summary: '2.3.0 rebuilt for arm64. Identical code and flags, but it boots natively on Apple ' +
243
+ 'Silicon instead of stalling under Rosetta. Community-built image.',
244
+ /**
245
+ * macOS on Apple Silicon only, and not arm64 Linux — which the image
246
+ * would also run on.
247
+ *
248
+ * The narrowing is about what happens when we say nothing. On Docker
249
+ * Desktop the amd64 image *starts* and then stalls in silence, so an
250
+ * operator with no recommendation is left with a head that failed for
251
+ * no visible reason: that is worth spending a third-party image on. On
252
+ * arm64 Linux the daemon rejects the image immediately and says exactly
253
+ * why, so the operator can see the problem and choose — including by
254
+ * rebuilding it themselves, which the known-issue text points at.
255
+ *
256
+ * Pointing people at an account this project does not own is a cost.
257
+ * It is paid where it buys the most and nowhere else.
258
+ */
259
+ recommendedOn: ['darwin-arm64'],
260
+ },
261
+ {
262
+ id: '2.3',
263
+ label: 'hydra-node 2.3.x',
264
+ image: 'ghcr.io/cardano-scaling/hydra-node:2.3.0',
265
+ tagPattern: /^2\.3(\.|-|$)/,
266
+ flags: {
267
+ unsyncedPeriod: true,
268
+ blockfrostTimeouts: true,
269
+ network: true,
270
+ blockfrost: true,
271
+ offline: true,
272
+ },
273
+ args: {
274
+ // 180s is upstream's tested value: it clears Blockfrost's 50-80s tip
275
+ // drift while still catching a genuinely stalled node. See argv.ts
276
+ // for why the node's own default (half the contestation period) is
277
+ // too tight on this backend.
278
+ unsyncedPeriod: 180,
279
+ blockfrostQueryTimeout: 30,
280
+ blockfrostRetryTimeout: 300,
281
+ extraArgs: [],
282
+ },
283
+ summary: 'Full Blockfrost drift tolerance. No commit phase (ADR-33), SQLite event store.',
284
+ /**
285
+ * Upstream's own build, and the default everywhere except macOS on
286
+ * Apple Silicon. `unknown` gets it too: when we cannot tell what the
287
+ * machine is, the image published by the project is more defensible
288
+ * than one rebuilt by an individual.
289
+ *
290
+ * `linux-arm64` is in this list knowingly. The image will not run there
291
+ * either — but the daemon says so immediately and by name, and that is
292
+ * a better place to leave someone than pointed at a personal registry.
293
+ * The known-issue entry still fires and names the alternative.
294
+ */
295
+ recommendedOn: ['darwin-x64', 'linux-x64', 'linux-arm64', 'unknown'],
296
+ },
297
+ /**
298
+ * 2.1 is the one concession to machines that cannot run 2.3.0's image.
299
+ *
300
+ * Every hydra-node image is amd64-only, and from 2.2.0 on the node forces
301
+ * the entire KZG trusted setup into memory before it opens a socket or
302
+ * installs a tracer — under Rosetta that outlasts the readiness budget
303
+ * without printing a single line, so the node simply never greets. 2.1.0
304
+ * predates the warm-up and is the only version measured to boot on Apple
305
+ * Silicon. See docs/FIELD_NOTES.md for how that was established.
306
+ *
307
+ * 2.2 is deliberately NOT offered. It carries the same warm-up, so it
308
+ * solves nothing 2.3 does not, while still carrying two blockers 2.3 fixed
309
+ * — an option whose only distinguishing feature is being worse. Pinning it
310
+ * by hand still works, and HYDRA_KNOWN_ISSUES still warns, because that
311
+ * matches by version range rather than by profile.
312
+ *
313
+ * The real answer for arm64 is a rebuilt 2.3 image, which the create form
314
+ * takes as a custom reference. `tagPattern` matches the TAG, so a private
315
+ * `you/hydra-node:2.3.0` resolves to the 2.3 profile with no probe needed.
316
+ *
317
+ * Flags below were read from `hydra-node --help` on the actual image, not
318
+ * inferred from the version line: 2.1.0 accepts everything 2.3.0 does,
319
+ * including the offline branch and the Blockfrost timeouts.
320
+ */
321
+ {
322
+ id: '2.1',
323
+ label: 'hydra-node 2.1.x',
324
+ image: 'ghcr.io/cardano-scaling/hydra-node:2.1.0',
325
+ tagPattern: /^2\.1(\.|-|$)/,
326
+ flags: {
327
+ unsyncedPeriod: true,
328
+ blockfrostTimeouts: true,
329
+ network: true,
330
+ blockfrost: true,
331
+ offline: true,
332
+ },
333
+ args: {
334
+ unsyncedPeriod: 180,
335
+ blockfrostQueryTimeout: 30,
336
+ blockfrostRetryTimeout: 300,
337
+ extraArgs: [],
338
+ },
339
+ summary: 'Oldest 2.x with the full flag set. Carries a double-spend defect fixed in 2.2.0 — use it ' +
340
+ 'for testing where 2.3.0 will not run, not for a head holding anything real.',
341
+ },
342
+ {
343
+ id: '0.22',
344
+ label: 'hydra-node 0.22.x',
345
+ image: 'ghcr.io/cardano-scaling/hydra-node:0.22.3',
346
+ tagPattern: /^0\.22(\.|-|$)/,
347
+ flags: {
348
+ // Neither the unsynced period nor the Blockfrost timeouts exist on
349
+ // this line; passing them kills the container at startup.
350
+ unsyncedPeriod: false,
351
+ blockfrostTimeouts: false,
352
+ network: true,
353
+ blockfrost: true,
354
+ // Offline mode predates both lines, so it is the one advanced
355
+ // capability 0.22.x shares with 2.x.
356
+ offline: true,
357
+ },
358
+ args: {
359
+ // Carried for completeness — the flags above gate them out of argv.
360
+ unsyncedPeriod: 180,
361
+ blockfrostQueryTimeout: 30,
362
+ blockfrostRetryTimeout: 300,
363
+ extraArgs: [],
364
+ },
365
+ summary: 'Legacy protocol (commit phase, older scripts). Runs with a 60s unsynced budget ' +
366
+ 'inside Blockfrost’s 50-80s drift band — prefer 2.3.x on Blockfrost.',
367
+ },
368
+ ];
369
+ /**
370
+ * Values used when an image matches no profile, so an unrecognised image still
371
+ * boots with the same tuning the 2.x line gets. Whether the flags are actually
372
+ * passed is decided separately, by probing the image.
373
+ */
374
+ exports.FALLBACK_HYDRA_ARGS = {
375
+ unsyncedPeriod: 180,
376
+ blockfrostQueryTimeout: 30,
377
+ blockfrostRetryTimeout: 300,
378
+ extraArgs: [],
379
+ };
380
+ /**
381
+ * The tag part of an image reference.
382
+ *
383
+ * Written by hand rather than with a split(':') because both `localhost:5000/x`
384
+ * (registry port, no tag) and `x@sha256:…` (digest, no tag) would otherwise
385
+ * report a tag that does not exist and match the wrong profile.
386
+ */
387
+ function imageTag(image) {
388
+ const at = image.indexOf('@');
389
+ const ref = at === -1 ? image : image.slice(0, at);
390
+ const colon = ref.indexOf(':', ref.lastIndexOf('/') + 1);
391
+ return colon === -1 ? '' : ref.slice(colon + 1);
392
+ }
393
+ /** The profile claiming this image, or undefined when it must be probed. */
394
+ function findVersionProfile(image) {
395
+ const tag = imageTag(image);
396
+ if (!tag)
397
+ return undefined;
398
+ return exports.HYDRA_VERSION_PROFILES.find(p => p.tagPattern.test(tag));
399
+ }
400
+ /**
401
+ * Merge, in order: explicit operator override, then the version's own default,
402
+ * then the fallback. An override is deliberately allowed to win over the
403
+ * profile — someone who set HYDRA_UNSYNCED_PERIOD for a reason should not have
404
+ * it silently reverted by a version bump.
405
+ */
406
+ function resolveHydraArgs(profile, overrides = {}) {
407
+ const base = profile?.args ?? exports.FALLBACK_HYDRA_ARGS;
408
+ return {
409
+ unsyncedPeriod: overrides.unsyncedPeriod ?? base.unsyncedPeriod,
410
+ blockfrostQueryTimeout: overrides.blockfrostQueryTimeout ?? base.blockfrostQueryTimeout,
411
+ blockfrostRetryTimeout: overrides.blockfrostRetryTimeout ?? base.blockfrostRetryTimeout,
412
+ extraArgs: [...base.extraArgs],
413
+ };
414
+ }
415
+ function toVersionInfo(profile, platform = 'unknown') {
416
+ return {
417
+ id: profile.id,
418
+ label: profile.label,
419
+ image: profile.image,
420
+ summary: profile.summary,
421
+ recommended: profile.recommendedOn?.includes(platform) ?? false,
422
+ flags: { ...profile.flags },
423
+ args: { ...profile.args, extraArgs: [...profile.args.extraArgs] },
424
+ // `imagePattern` is a RegExp and would cross the wire as `{}` — the same
425
+ // trap `tagPattern` sets on the profile. It has done its job by the time
426
+ // an issue is in this list, so it is dropped rather than shipped broken.
427
+ knownIssues: knownIssuesFor(profile.image, undefined, platform).map(stripPatterns),
428
+ };
429
+ }
430
+ function stripPatterns(issue) {
431
+ const { imagePattern: _dropped, ...rest } = issue;
432
+ return rest;
433
+ }
434
+ /**
435
+ * Map Node's `process.platform` and `process.arch` onto the platforms this
436
+ * table distinguishes.
437
+ *
438
+ * Anything outside the four becomes `unknown` rather than being carried
439
+ * through: the table only holds evidence about those, and a claim about a
440
+ * FreeBSD s390x host is one nobody has checked.
441
+ */
442
+ function toHostPlatform(os, arch) {
443
+ if (os === 'darwin' && arch === 'arm64')
444
+ return 'darwin-arm64';
445
+ if (os === 'darwin' && arch === 'x64')
446
+ return 'darwin-x64';
447
+ if (os === 'linux' && arch === 'arm64')
448
+ return 'linux-arm64';
449
+ if (os === 'linux' && arch === 'x64')
450
+ return 'linux-x64';
451
+ return 'unknown';
452
+ }
453
+ //# sourceMappingURL=hydra-versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydra-versions.js","sourceRoot":"","sources":["../../src/hydra-versions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAiDH,0BAEC;AAwKD,0CAIC;AAGD,0CAQC;AASD,wCAqBC;AAkQD,4BAKC;AAGD,gDAIC;AAeD,4CAWC;AAmBD,sCAcC;AAiCD,wCAMC;AAjlBD,8EAA8E;AACjE,QAAA,cAAc,GAA4B;IACnD,cAAc;IACd,YAAY;IACZ,aAAa;IACb,WAAW;IACX,SAAS;CACZ,CAAC;AAEF,0EAA0E;AAC1E,SAAgB,OAAO,CAAC,QAAsB;IAC1C,OAAO,QAAQ,KAAK,cAAc,IAAI,QAAQ,KAAK,aAAa,CAAC;AACrE,CAAC;AA+DD;;;;;;GAMG;AACU,QAAA,kBAAkB,GAA+B;IAC1D;QACI,wEAAwE;QACxE,sEAAsE;QACtE,GAAG,EAAE,iDAAiD;QACtD,KAAK,EAAE,oEAAoE;QAC3E,MAAM,EACF,sFAAsF;YACtF,sFAAsF;YACtF,wFAAwF;YACxF,sFAAsF;YACtF,oFAAoF;YACpF,oFAAoF;YACpF,uFAAuF;YACvF,uFAAuF;YACvF,iFAAiF;QACrF,QAAQ,EAAE,SAAS;QACnB;;;;;;;;;WASG;QACH,YAAY,EAAE,wCAAwC;QACtD,aAAa,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC;QAC9C,wEAAwE;QACxE,oDAAoD;QACpD,YAAY,EAAE,OAAO;KACxB;IACD;QACI,EAAE,EAAE,IAAI;QACR,GAAG,EAAE,sDAAsD;QAC3D,KAAK,EA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,OAAO,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,WAAW,CAAC;IACzD,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './domain';
2
+ export * from './api';
3
+ export * from './naming';
4
+ export * from './hydra-versions';
5
+ export * from './offline';
6
+ export * from './protocol-params';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./domain"), exports);
18
+ __exportStar(require("./api"), exports);
19
+ __exportStar(require("./naming"), exports);
20
+ __exportStar(require("./hydra-versions"), exports);
21
+ __exportStar(require("./offline"), exports);
22
+ __exportStar(require("./protocol-params"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wCAAsB;AACtB,2CAAyB;AACzB,mDAAiC;AACjC,4CAA0B;AAC1B,oDAAkC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Deterministic naming + path conventions.
3
+ *
4
+ * v1 derived container names from the DB primary key of the node, which meant
5
+ * you could not tell which head a container belonged to without a DB lookup,
6
+ * and recreating a head produced unpredictable names. v2 names everything from
7
+ * (headId, nodeIndex) so the whole layout is reproducible and greppable.
8
+ */
9
+ export declare const CONTAINER_PREFIX = "hexcore";
10
+ export declare const DOCKER_NETWORK = "hexcore-net";
11
+ export declare const LABEL_MANAGED = "io.hexcore.managed";
12
+ export declare const LABEL_HEAD_ID = "io.hexcore.head-id";
13
+ export declare const LABEL_NODE_ID = "io.hexcore.node-id";
14
+ export declare const LABEL_NODE_INDEX = "io.hexcore.node-index";
15
+ /**
16
+ * Which Hexcore installation owns this container.
17
+ *
18
+ * `LABEL_MANAGED` says "Hexcore made this" and nothing more, so it cannot tell
19
+ * two installations apart — and more than one is normal: a developer running
20
+ * the repo has one state dir, an `npm i -g hexcore` on the same machine has
21
+ * another, and both talk to the same Docker daemon. A bulk operation matched on
22
+ * `LABEL_MANAGED` alone therefore reaches across installations, which is how
23
+ * `hexcore clean` destroyed the containers of a head it had never heard of.
24
+ *
25
+ * The value is a random id kept in the state dir, so it identifies the state
26
+ * dir rather than the machine, the user or the checkout.
27
+ */
28
+ export declare const LABEL_INSTALL = "io.hexcore.install";
29
+ /** e.g. head 3, index 0 -> `hexcore-h3-n0` (also the Hydra --node-id and DNS name). */
30
+ export declare function nodeContainerName(headId: number, nodeIndex: number): string;
31
+ export declare function headDirName(headId: number): string;
32
+ /** Layout under the state dir: heads/head-1/{keys,persistence,...} */
33
+ export declare const headPaths: (stateDir: string, headId: number) => {
34
+ root: string;
35
+ keys: string;
36
+ persistence: string;
37
+ protocolParameters: string;
38
+ /**
39
+ * Offline mode only. `--initial-utxo` is the L2 ledger's entire
40
+ * starting state and `--ledger-genesis` the simulated L1's block-time
41
+ * parameters; both are written at start, next to everything else the
42
+ * head owns, so deleting the head takes them with it.
43
+ */
44
+ initialUtxo: string;
45
+ ledgerGenesis: string;
46
+ /**
47
+ * Written by v2 up to the per-node keys change, and still removed on
48
+ * every start so a stale project id does not sit on disk unused.
49
+ */
50
+ legacyBlockfrostToken: string;
51
+ /**
52
+ * One token file per node: hydra-node takes `--blockfrost FILE`, so a
53
+ * per-node key can only be expressed as a per-node file. Nodes sharing
54
+ * a key simply get the same contents written to each of theirs.
55
+ */
56
+ nodeBlockfrostToken: (nodeIndex: number) => string;
57
+ nodePersistence: (nodeIndex: number) => string;
58
+ nodeKeys: (nodeIndex: number) => {
59
+ hydraSk: string;
60
+ hydraVk: string;
61
+ cardanoSk: string;
62
+ cardanoVk: string;
63
+ };
64
+ };
65
+ /**
66
+ * Same layout as seen from inside the container, where the state dir is always
67
+ * bind-mounted at /data. Keeping the two in lockstep avoids the class of bug
68
+ * where a host path leaks into a container argument.
69
+ */
70
+ export declare const CONTAINER_DATA_DIR = "/data";
71
+ export declare const containerHeadPaths: (headId: number) => {
72
+ root: string;
73
+ keys: string;
74
+ persistence: string;
75
+ protocolParameters: string;
76
+ /**
77
+ * Offline mode only. `--initial-utxo` is the L2 ledger's entire
78
+ * starting state and `--ledger-genesis` the simulated L1's block-time
79
+ * parameters; both are written at start, next to everything else the
80
+ * head owns, so deleting the head takes them with it.
81
+ */
82
+ initialUtxo: string;
83
+ ledgerGenesis: string;
84
+ /**
85
+ * Written by v2 up to the per-node keys change, and still removed on
86
+ * every start so a stale project id does not sit on disk unused.
87
+ */
88
+ legacyBlockfrostToken: string;
89
+ /**
90
+ * One token file per node: hydra-node takes `--blockfrost FILE`, so a
91
+ * per-node key can only be expressed as a per-node file. Nodes sharing
92
+ * a key simply get the same contents written to each of theirs.
93
+ */
94
+ nodeBlockfrostToken: (nodeIndex: number) => string;
95
+ nodePersistence: (nodeIndex: number) => string;
96
+ nodeKeys: (nodeIndex: number) => {
97
+ hydraSk: string;
98
+ hydraVk: string;
99
+ cardanoSk: string;
100
+ cardanoVk: string;
101
+ };
102
+ };
103
+ /**
104
+ * Port allocation. Each node gets a contiguous triple so a head of N nodes
105
+ * occupies a predictable, non-overlapping range:
106
+ * api = base + slot*10
107
+ * p2p = base + slot*10 + 1
108
+ * monitoring = base + slot*10 + 2
109
+ */
110
+ export declare const PORT_BASE = 14000;
111
+ export declare const PORTS_PER_NODE = 10;
112
+ export interface NodePorts {
113
+ api: number;
114
+ p2p: number;
115
+ monitoring: number;
116
+ }
117
+ export declare function portsForSlot(slot: number, base?: number): NodePorts;
118
+ //# sourceMappingURL=naming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/naming.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AACxD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAElD,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,sEAAsE;AACtE,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,EAAE,QAAQ,MAAM;;;;;IAOlD;;;;;OAKG;;;IAGH;;;OAGG;;IAEH;;;;OAIG;qCAC8B,MAAM;iCACV,MAAM;0BACb,MAAM;;;;;;CAOnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC;A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