@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 @@
1
+ {"version":3,"file":"argv.js","sourceRoot":"","sources":["../../src/hydra/argv.ts"],"names":[],"mappings":";;AAiCA,8BAEC;AA2CD,kCA4DC;AASD,gCAMC;AAOD,sCA8EC;AA9OD;;;;;;;;GAQG;AACH,4CAA6E;AAE7E,i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AC;QACzB,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC;QAC3C,mEAAmE;QACnE,wEAAwE;QACxE,qEAAqE;QACrE,mEAAmE;QACnE,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;KAC5B,CAAC;AACN,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveBlockfrostKey = resolveBlockfrostKey;
4
+ function resolveBlockfrostKey(nodeKey, headKey, serverKey) {
5
+ // Empty strings come from both SQLite columns and unset env vars; treat
6
+ // them as absent rather than writing a token file with nothing in it.
7
+ if (nodeKey)
8
+ return { key: nodeKey, source: 'node' };
9
+ if (headKey)
10
+ return { key: headKey, source: 'head' };
11
+ if (serverKey)
12
+ return { key: serverKey, source: 'server' };
13
+ return { key: null, source: 'none' };
14
+ }
15
+ //# sourceMappingURL=blockfrost-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockfrost-keys.js","sourceRoot":"","sources":["../../src/hydra/blockfrost-keys.ts"],"names":[],"mappings":";;AAqBA,oDAWC;AAXD,SAAgB,oBAAoB,CAChC,OAAkC,EAClC,OAAkC,EAClC,SAAoC;IAEpC,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,OAAO;QAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrD,IAAI,OAAO;QAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrD,IAAI,SAAS;QAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC"}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BOOT_STEPS = exports.BootTracker = exports.BootRun = void 0;
4
+ /**
5
+ * The phases, in the order `start()` walks them.
6
+ *
7
+ * Labels say what is happening to the machine, not which function is running:
8
+ * the audience is someone watching a head come up, not someone reading this
9
+ * file.
10
+ */
11
+ const STEPS = [
12
+ { key: 'docker', label: 'Reaching the Docker daemon' },
13
+ { key: 'image', label: 'Fetching the hydra-node image' },
14
+ { key: 'flags', label: 'Settling which flags this version accepts' },
15
+ { key: 'config', label: 'Writing keys and ledger configuration' },
16
+ { key: 'containers', label: 'Creating the node containers' },
17
+ { key: 'ready', label: 'Waiting for every node to greet' },
18
+ ];
19
+ exports.BOOT_STEPS = STEPS;
20
+ /** Bounded so a chatty node cannot grow this without limit. */
21
+ const MAX_LOG_LINES = 500;
22
+ class BootRun {
23
+ progress;
24
+ /** Last line taken from each container, to append only what is new. */
25
+ lastLine = new Map();
26
+ constructor(headId, startedAt) {
27
+ this.progress = {
28
+ headId,
29
+ status: 'running',
30
+ startedAt,
31
+ steps: STEPS.map(s => ({ ...s, state: 'pending' })),
32
+ logs: [],
33
+ };
34
+ }
35
+ get snapshot() {
36
+ // Copied on the way out: the caller serialises it while this run may
37
+ // still be mutating.
38
+ return {
39
+ ...this.progress,
40
+ steps: this.progress.steps.map(s => ({ ...s })),
41
+ logs: [...this.progress.logs],
42
+ };
43
+ }
44
+ /**
45
+ * Enter a phase. Everything before it is marked done, so a step that
46
+ * finishes without its own call — the ones that are just a few awaits —
47
+ * cannot be left showing as active forever.
48
+ */
49
+ step(key, detail) {
50
+ const at = new Date().toISOString();
51
+ let seen = false;
52
+ for (const step of this.progress.steps) {
53
+ if (step.key === key) {
54
+ seen = true;
55
+ step.state = 'active';
56
+ step.startedAt = at;
57
+ if (detail)
58
+ step.detail = detail;
59
+ }
60
+ else if (!seen) {
61
+ if (step.state === 'active' || step.state === 'pending') {
62
+ step.state = 'done';
63
+ step.endedAt ??= at;
64
+ }
65
+ }
66
+ }
67
+ this.log(STEPS.find(s => s.key === key)?.label ?? key);
68
+ }
69
+ /** Update the live sub-status of a step without logging a line for it. */
70
+ detail(key, detail) {
71
+ const step = this.progress.steps.find(s => s.key === key);
72
+ if (step)
73
+ step.detail = detail;
74
+ }
75
+ log(message, level = 'info', source = 'hexcore') {
76
+ this.push({ at: new Date().toISOString(), level, source, message });
77
+ }
78
+ push(line) {
79
+ this.progress.logs.push(line);
80
+ if (this.progress.logs.length > MAX_LOG_LINES) {
81
+ this.progress.logs.splice(0, this.progress.logs.length - MAX_LOG_LINES);
82
+ }
83
+ }
84
+ /**
85
+ * Append whatever a container has printed since the last look.
86
+ *
87
+ * Docker's `logs --tail` is a sliding window, so the previous batch and this
88
+ * one overlap. Resuming after the last line we kept is what stops the pane
89
+ * repeating itself; when that line has already scrolled out of the window we
90
+ * take the whole batch, which duplicates less than dropping would lose.
91
+ *
92
+ * A start that shows nothing for half a minute and then dumps ten lines at
93
+ * once is NOT a bug here. hydra-node's stdout is not a TTY under Docker, so
94
+ * it block-buffers: on a measured boot, ten lines spanning 35s of the node's
95
+ * own timestamps reached Docker in a single flush. Nothing polls its way out
96
+ * of that. `at` below is therefore when WE saw the line, not when the node
97
+ * wrote it — each line carries hydra-node's own timestamp inside the JSON.
98
+ */
99
+ appendContainerLogs(source, raw) {
100
+ const lines = raw.split('\n').filter(l => l.trim().length > 0);
101
+ if (lines.length === 0)
102
+ return;
103
+ const previous = this.lastLine.get(source);
104
+ const from = previous ? lines.lastIndexOf(previous) + 1 : 0;
105
+ const fresh = from > 0 || !previous ? lines.slice(from) : lines;
106
+ for (const message of fresh) {
107
+ this.push({
108
+ at: new Date().toISOString(),
109
+ // hydra-node logs JSON; anything it labels an error is one.
110
+ level: /"(error|Error)"|\bexception\b/i.test(message) ? 'error' : 'info',
111
+ source,
112
+ message: message.length > 2000 ? `${message.slice(0, 2000)}…` : message,
113
+ });
114
+ }
115
+ this.lastLine.set(source, lines[lines.length - 1]);
116
+ }
117
+ succeed(message) {
118
+ const at = new Date().toISOString();
119
+ for (const step of this.progress.steps) {
120
+ if (step.state !== 'failed') {
121
+ step.state = 'done';
122
+ step.endedAt ??= at;
123
+ }
124
+ }
125
+ this.progress.status = 'succeeded';
126
+ this.progress.endedAt = at;
127
+ this.log(message);
128
+ }
129
+ /** Fail the step that was in flight, so the pane points at what gave up. */
130
+ fail(error) {
131
+ const at = new Date().toISOString();
132
+ const active = this.progress.steps.find(s => s.state === 'active');
133
+ if (active) {
134
+ active.state = 'failed';
135
+ active.detail = error;
136
+ active.endedAt = at;
137
+ }
138
+ this.progress.status = 'failed';
139
+ this.progress.endedAt = at;
140
+ this.progress.error = error;
141
+ this.log(error, 'error');
142
+ }
143
+ }
144
+ exports.BootRun = BootRun;
145
+ /**
146
+ * The latest run per head. Only one is kept: a finished run is still worth
147
+ * showing — it is how someone reads back a failure — but the one before it is
148
+ * not, and keeping a history here would be a memory leak with no reader.
149
+ */
150
+ class BootTracker {
151
+ runs = new Map();
152
+ begin(headId) {
153
+ const run = new BootRun(headId, new Date().toISOString());
154
+ this.runs.set(headId, run);
155
+ return run;
156
+ }
157
+ get(headId) {
158
+ return this.runs.get(headId)?.snapshot;
159
+ }
160
+ forget(headId) {
161
+ this.runs.delete(headId);
162
+ }
163
+ }
164
+ exports.BootTracker = BootTracker;
165
+ //# sourceMappingURL=boot-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-progress.js","sourceRoot":"","sources":["../../src/hydra/boot-progress.ts"],"names":[],"mappings":";;;AAgBA;;;;;;GAMG;AACH,MAAM,KAAK,GAAkD;IACzD,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,4BAA4B,EAAE;IACtD,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,+BAA+B,EAAE;IACxD,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,2CAA2C,EAAE;IACpE,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,uCAAuC,EAAE;IACjE,EAAE,G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G,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACJ;AAhID,0BAgIC;AAED;;;;GAIG;AACH,MAAa,WAAW;IACH,IAAI,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEnD,KAAK,CAAC,MAAc;QAChB,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC3B,OAAO,GAAG,CAAC;IACf,CAAC;IAED,GAAG,CAAC,MAAc;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACJ;AAhBD,kCAgBC"}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var NodeCapabilitiesService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.NodeCapabilitiesService = void 0;
14
+ exports.hasFlag = hasFlag;
15
+ /**
16
+ * What the configured hydra-node image actually supports.
17
+ *
18
+ * Flags differ across the versions people run. Concretely, 0.22.x has
19
+ * `--blockfrost` and `--network` but NOT `--unsynced-period` or the Blockfrost
20
+ * timeout knobs, which arrived in the 2.x line. Passing an unknown flag makes
21
+ * hydra-node exit during option parsing, so the container dies immediately and
22
+ * the head reports a generic "node never became ready" — the failure mode this
23
+ * whole module exists to avoid.
24
+ *
25
+ * Two sources answer that question, in order:
26
+ *
27
+ * 1. `HYDRA_VERSION_PROFILES` in @hexcore/shared — the versions this build
28
+ * declares support for. A profile wins when it claims the tag, because it
29
+ * also carries the argv values that version wants, which `--help` cannot
30
+ * tell us. Supporting a new hydra-node release is therefore a code change.
31
+ * 2. Probing the image: run `hydra-node --help` once and read which flags it
32
+ * prints. This is what keeps a fork, a `master` tag, or a release newer
33
+ * than this build bootable instead of refused.
34
+ */
35
+ const common_1 = require("@nestjs/common");
36
+ const shared_1 = require("@hexcore/shared");
37
+ const docker_service_1 = require("../docker/docker.service");
38
+ /** Assume the widest support if probing fails, minus anything version-gated. */
39
+ const CONSERVATIVE = {
40
+ unsyncedPeriod: false,
41
+ blockfrostTimeouts: false,
42
+ network: true,
43
+ blockfrost: true,
44
+ // Offline mode predates every version this build supports, so assuming it
45
+ // costs nothing — and an image that truly lacks it fails at option parsing
46
+ // either way, since there is no online argv to fall back to.
47
+ offline: true,
48
+ };
49
+ let NodeCapabilitiesService = NodeCapabilitiesService_1 = class NodeCapabilitiesService {
50
+ docker;
51
+ logger = new common_1.Logger(NodeCapabilitiesService_1.name);
52
+ /** Probing spawns a container, so cache per image tag. */
53
+ cache = new Map();
54
+ constructor(docker) {
55
+ this.docker = docker;
56
+ }
57
+ /**
58
+ * Flags + argv values for an image.
59
+ *
60
+ * A declared profile short-circuits the probe entirely: it is the reviewed
61
+ * answer for that version, and it costs no container run.
62
+ */
63
+ async resolve(image, overrides = {}) {
64
+ const profile = (0, shared_1.findVersionProfile)(image);
65
+ if (profile) {
66
+ return {
67
+ caps: { version: profile.label, ...profile.flags },
68
+ args: (0, shared_1.resolveHydraArgs)(profile, overrides),
69
+ source: 'profile',
70
+ profileId: profile.id,
71
+ };
72
+ }
73
+ this.logger.log(`${image} matches no version profile — probing the image for its flag set`);
74
+ const caps = await this.detect(image);
75
+ return {
76
+ caps,
77
+ args: (0, shared_1.resolveHydraArgs)(undefined, overrides),
78
+ source: caps.version === 'unknown' ? 'fallback' : 'probe',
79
+ };
80
+ }
81
+ async detect(image) {
82
+ const cached = this.cache.get(image);
83
+ if (cached)
84
+ return cached;
85
+ let caps;
86
+ try {
87
+ const help = await this.docker.runOnce(image, ['--help']);
88
+ const version = (await this.docker.runOnce(image, ['--version'])).trim().split('\n')[0] ?? 'unknown';
89
+ caps = {
90
+ version,
91
+ // Match the flag at a word boundary: '--blockfrost' is a prefix
92
+ // of '--blockfrost-query-timeout', so a naive includes() would
93
+ // report the timeout flags as present on 0.22.x.
94
+ unsyncedPeriod: hasFlag(help, 'unsynced-period'),
95
+ blockfrostTimeouts: hasFlag(help, 'blockfrost-query-timeout'),
96
+ network: hasFlag(help, 'network'),
97
+ blockfrost: hasFlag(help, 'blockfrost'),
98
+ offline: hasFlag(help, 'offline-head-seed'),
99
+ };
100
+ this.logger.log(`hydra-node ${version} capabilities: ` +
101
+ `unsynced-period=${caps.unsyncedPeriod} ` +
102
+ `blockfrost-timeouts=${caps.blockfrostTimeouts} ` +
103
+ `network=${caps.network}`);
104
+ }
105
+ catch (err) {
106
+ // A failed probe must not block a boot that would otherwise work,
107
+ // so fall back to the flags every supported version accepts.
108
+ this.logger.warn(`could not probe ${image} for supported flags (${err.message}); ` +
109
+ 'assuming a conservative flag set');
110
+ caps = { version: 'unknown', ...CONSERVATIVE };
111
+ }
112
+ this.cache.set(image, caps);
113
+ return caps;
114
+ }
115
+ };
116
+ exports.NodeCapabilitiesService = NodeCapabilitiesService;
117
+ exports.NodeCapabilitiesService = NodeCapabilitiesService = NodeCapabilitiesService_1 = __decorate([
118
+ (0, common_1.Injectable)(),
119
+ __metadata("design:paramtypes", [docker_service_1.DockerService])
120
+ ], NodeCapabilitiesService);
121
+ /**
122
+ * True when `--<flag>` appears as a whole option in the help text.
123
+ *
124
+ * The trailing boundary matters: hydra-node prints `--blockfrost FILE` and
125
+ * `--blockfrost-query-timeout SECONDS`, and a substring test for the former
126
+ * would also match the latter.
127
+ */
128
+ function hasFlag(helpText, flag) {
129
+ return new RegExp(`--${flag}(?![\\w-])`).test(helpText);
130
+ }
131
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/hydra/capabilities.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAmJA,0BAEC;AArJD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,2CAAoD;AACpD,4CAAsH;AACtH,6DAAyD;AAiBzD,gFAAgF;AAChF,MAAM,YAAY,GAAsC;IACpD,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,KAAK;IACzB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,0EAA0E;IAC1E,2EAA2E;IAC3E,6DAA6D;IAC7D,OAAO,EAAE,IAAI;CAChB,CAAC;AAgBK,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAKH;IAJZ,MAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IACnE,0DAA0D;IACzC,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;IAE7D,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,YAA+B,EAAE;QAC1D,MAAM,OAAO,GAAG,IAAA,2BAAkB,EAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,OAAO,EAAE,CAAC;YACV,OAAO;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE;gBAClD,IAAI,EA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