@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.
- package/CHANGELOG.md +127 -0
- package/LICENSE +201 -0
- package/README.md +283 -0
- package/dist/app.module.js +55 -0
- package/dist/app.module.js.map +1 -0
- package/dist/auth.js +151 -0
- package/dist/auth.js.map +1 -0
- package/dist/chain/cost-models.js +81 -0
- package/dist/chain/cost-models.js.map +1 -0
- package/dist/chain/provider.js +269 -0
- package/dist/chain/provider.js.map +1 -0
- package/dist/chain/socket.js +48 -0
- package/dist/chain/socket.js.map +1 -0
- package/dist/cli/doctor.js +43 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/hexcore.js +435 -0
- package/dist/cli/hexcore.js.map +1 -0
- package/dist/common/auth.guard.js +66 -0
- package/dist/common/auth.guard.js.map +1 -0
- package/dist/common/http.js +171 -0
- package/dist/common/http.js.map +1 -0
- package/dist/common/zod-validation.pipe.js +47 -0
- package/dist/common/zod-validation.pipe.js.map +1 -0
- package/dist/config.js +354 -0
- package/dist/config.js.map +1 -0
- package/dist/config.module.js +35 -0
- package/dist/config.module.js.map +1 -0
- package/dist/controllers/cardano.controller.js +173 -0
- package/dist/controllers/cardano.controller.js.map +1 -0
- package/dist/controllers/heads.controller.js +225 -0
- package/dist/controllers/heads.controller.js.map +1 -0
- package/dist/controllers/setup.controller.js +127 -0
- package/dist/controllers/setup.controller.js.map +1 -0
- package/dist/controllers/system.controller.js +153 -0
- package/dist/controllers/system.controller.js.map +1 -0
- package/dist/db/database.module.js +73 -0
- package/dist/db/database.module.js.map +1 -0
- package/dist/db/index.js +135 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/repositories.js +220 -0
- package/dist/db/repositories.js.map +1 -0
- package/dist/docker/container-stats.js +134 -0
- package/dist/docker/container-stats.js.map +1 -0
- package/dist/docker/docker.service.js +335 -0
- package/dist/docker/docker.service.js.map +1 -0
- package/dist/hydra/argv.js +172 -0
- package/dist/hydra/argv.js.map +1 -0
- package/dist/hydra/blockfrost-keys.js +15 -0
- package/dist/hydra/blockfrost-keys.js.map +1 -0
- package/dist/hydra/boot-progress.js +165 -0
- package/dist/hydra/boot-progress.js.map +1 -0
- package/dist/hydra/capabilities.js +131 -0
- package/dist/hydra/capabilities.js.map +1 -0
- package/dist/hydra/head.service.js +1072 -0
- package/dist/hydra/head.service.js.map +1 -0
- package/dist/hydra/keys.js +301 -0
- package/dist/hydra/keys.js.map +1 -0
- package/dist/hydra/node-monitor.service.js +265 -0
- package/dist/hydra/node-monitor.service.js.map +1 -0
- package/dist/hydra/ws-client.js +177 -0
- package/dist/hydra/ws-client.js.map +1 -0
- package/dist/main.js +106 -0
- package/dist/main.js.map +1 -0
- package/dist/preflight.js +215 -0
- package/dist/preflight.js.map +1 -0
- package/dist/settings.js +243 -0
- package/dist/settings.js.map +1 -0
- package/dist/setup.service.js +257 -0
- package/dist/setup.service.js.map +1 -0
- package/dist/version.js +46 -0
- package/dist/version.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/api.d.ts +730 -0
- package/node_modules/@hexcore/shared/dist/cjs/api.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/api.js +358 -0
- package/node_modules/@hexcore/shared/dist/cjs/api.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/domain.d.ts +298 -0
- package/node_modules/@hexcore/shared/dist/cjs/domain.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/domain.js +49 -0
- package/node_modules/@hexcore/shared/dist/cjs/domain.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.d.ts +279 -0
- package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.js +453 -0
- package/node_modules/@hexcore/shared/dist/cjs/hydra-versions.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/index.d.ts +7 -0
- package/node_modules/@hexcore/shared/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/index.js +23 -0
- package/node_modules/@hexcore/shared/dist/cjs/index.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/naming.d.ts +118 -0
- package/node_modules/@hexcore/shared/dist/cjs/naming.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/naming.js +103 -0
- package/node_modules/@hexcore/shared/dist/cjs/naming.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/offline.d.ts +73 -0
- package/node_modules/@hexcore/shared/dist/cjs/offline.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/offline.js +80 -0
- package/node_modules/@hexcore/shared/dist/cjs/offline.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/protocol-params.d.ts +79 -0
- package/node_modules/@hexcore/shared/dist/cjs/protocol-params.d.ts.map +1 -0
- package/node_modules/@hexcore/shared/dist/cjs/protocol-params.js +223 -0
- package/node_modules/@hexcore/shared/dist/cjs/protocol-params.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/api.js +355 -0
- package/node_modules/@hexcore/shared/dist/esm/api.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/domain.js +46 -0
- package/node_modules/@hexcore/shared/dist/esm/domain.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/hydra-versions.js +441 -0
- package/node_modules/@hexcore/shared/dist/esm/hydra-versions.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/index.js +7 -0
- package/node_modules/@hexcore/shared/dist/esm/index.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/naming.js +95 -0
- package/node_modules/@hexcore/shared/dist/esm/naming.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/offline.js +75 -0
- package/node_modules/@hexcore/shared/dist/esm/offline.js.map +1 -0
- package/node_modules/@hexcore/shared/dist/esm/package.json +3 -0
- package/node_modules/@hexcore/shared/dist/esm/protocol-params.js +217 -0
- package/node_modules/@hexcore/shared/dist/esm/protocol-params.js.map +1 -0
- package/node_modules/@hexcore/shared/package.json +15 -0
- package/package.json +67 -0
- package/web/200.html +23 -0
- package/web/404.html +23 -0
- package/web/_nuxt/2MxohCD-.js +1 -0
- package/web/_nuxt/4pFXjB_u.js +1 -0
- package/web/_nuxt/B-v0dEQX.js +1 -0
- package/web/_nuxt/B4yE3U25.js +1 -0
- package/web/_nuxt/BFh8Ai0L.js +1 -0
- package/web/_nuxt/BgPn4NJH.js +1 -0
- package/web/_nuxt/Bj1xviSh.js +1 -0
- package/web/_nuxt/BnotlrL7.js +1 -0
- package/web/_nuxt/C1YRg2ic.js +1 -0
- package/web/_nuxt/CGD7MYQH.js +1 -0
- package/web/_nuxt/CQcG7Bu4.js +1 -0
- package/web/_nuxt/CS3KqpH_.js +1 -0
- package/web/_nuxt/CT-yt694.js +1 -0
- package/web/_nuxt/CZK6xUH-.js +1 -0
- package/web/_nuxt/CcdyYRYz.js +1 -0
- package/web/_nuxt/CePNTU1S.js +1 -0
- package/web/_nuxt/CgPLsCeU.js +5 -0
- package/web/_nuxt/CkCrahXt.js +1 -0
- package/web/_nuxt/CnOqDT9k.js +3 -0
- package/web/_nuxt/CqsSss-D.js +1 -0
- package/web/_nuxt/Cr8dL64Q.js +1 -0
- package/web/_nuxt/D3CwzwU0.js +1 -0
- package/web/_nuxt/DDANn6-H.js +1 -0
- package/web/_nuxt/DDl9uKIA.js +1 -0
- package/web/_nuxt/DL9i0ayn.js +1 -0
- package/web/_nuxt/DLNoK9BC.js +1 -0
- package/web/_nuxt/DLztFeOQ.js +1 -0
- package/web/_nuxt/DPihKXdt.js +1 -0
- package/web/_nuxt/DXyr6Naa.js +1 -0
- package/web/_nuxt/DeDg5p0D.js +1 -0
- package/web/_nuxt/DgDlQiDU.js +1 -0
- package/web/_nuxt/DyPI7qJE.js +30 -0
- package/web/_nuxt/LGfPBi70.js +1 -0
- package/web/_nuxt/Onf26W-r.js +1 -0
- package/web/_nuxt/QZNQe_OX.js +1 -0
- package/web/_nuxt/Y8IJM-iz.js +1 -0
- package/web/_nuxt/YUGC0nt0.js +1 -0
- package/web/_nuxt/builds/latest.json +1 -0
- package/web/_nuxt/builds/meta/7e461629-93e2-4694-b237-6d5c6a85c97c.json +1 -0
- package/web/_nuxt/builds/meta/dev.json +1 -0
- package/web/_nuxt/entry.BxsAxZxf.css +1 -0
- package/web/_nuxt/error-404.XbtAw-qw.css +1 -0
- package/web/_nuxt/error-500.CNHVltWM.css +1 -0
- package/web/_nuxt/rS90pPZ_.js +1 -0
- package/web/_nuxt/rhEiP908.js +1 -0
- package/web/_nuxt/vSj9Ec0g.js +1 -0
- package/web/_nuxt/woNjBJMN.js +1 -0
- package/web/favicon.svg +28 -0
- package/web/heads/index.html +23 -0
- package/web/heads/new/index.html +23 -0
- package/web/index.html +23 -0
- package/web/login/index.html +23 -0
- package/web/logo.svg +56 -0
- package/web/settings/index.html +23 -0
- package/web/setup/index.html +23 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydra Head / Node domain model shared between control-plane and web UI.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/** Lifecycle of a Head as tracked by the control-plane (not the on-chain Hydra state). */
|
|
6
|
+
export declare const headStatusSchema: z.ZodEnum<["CONFIGURED", "STARTING", "RUNNING", "STOPPED", "FAILED"]>;
|
|
7
|
+
export type HeadStatus = z.infer<typeof headStatusSchema>;
|
|
8
|
+
/**
|
|
9
|
+
* On-chain Hydra protocol state, mirrored from the node's Greetings frame.
|
|
10
|
+
*
|
|
11
|
+
* Sourced from `Hydra.API.ServerOutput.HeadStatus`. FANNING_OUT landed after
|
|
12
|
+
* the 2.3.0 tag (selective partial fanout) and is accepted ahead of time so a
|
|
13
|
+
* newer image degrades to a correct label rather than UNKNOWN.
|
|
14
|
+
*/
|
|
15
|
+
export declare const hydraStateSchema: z.ZodEnum<["IDLE", "INITIALIZING", "OPEN", "CLOSED", "FANOUT_POSSIBLE", "FANNING_OUT", "FINAL", "UNKNOWN"]>;
|
|
16
|
+
export type HydraState = z.infer<typeof hydraStateSchema>;
|
|
17
|
+
export declare const nodeStatusSchema: z.ZodEnum<["CREATED", "STARTING", "RUNNING", "STOPPED", "FAILED"]>;
|
|
18
|
+
export type NodeStatus = z.infer<typeof nodeStatusSchema>;
|
|
19
|
+
export declare const networkSchema: z.ZodEnum<["preprod", "preview", "mainnet"]>;
|
|
20
|
+
export type CardanoNetwork = z.infer<typeof networkSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* How a head talks to layer 1 — or whether it does at all.
|
|
23
|
+
*
|
|
24
|
+
* `offline` is not a variant of the other two: hydra-node's option parser puts
|
|
25
|
+
* `--offline-head-seed` on a different branch than `--blockfrost` /
|
|
26
|
+
* `--node-socket`, and mixing them aborts startup. See offline.ts.
|
|
27
|
+
*/
|
|
28
|
+
export declare const chainBackendSchema: z.ZodEnum<["blockfrost", "cardano-node", "offline"]>;
|
|
29
|
+
export type ChainBackend = z.infer<typeof chainBackendSchema>;
|
|
30
|
+
/** Network magic per network — used for --testnet-magic / --mainnet. */
|
|
31
|
+
export declare const NETWORK_MAGIC: Record<CardanoNetwork, number | null>;
|
|
32
|
+
export interface HydraNodeView {
|
|
33
|
+
id: number;
|
|
34
|
+
headId: number;
|
|
35
|
+
/** 0-based index inside the head; drives the deterministic container name. */
|
|
36
|
+
index: number;
|
|
37
|
+
name: string;
|
|
38
|
+
apiPort: number;
|
|
39
|
+
p2pPort: number;
|
|
40
|
+
monitoringPort: number;
|
|
41
|
+
status: NodeStatus;
|
|
42
|
+
/** Cardano enterprise address funding this node (needs tADA to commit). */
|
|
43
|
+
cardanoAddress: string | null;
|
|
44
|
+
hydraVkey: string | null;
|
|
45
|
+
containerId: string | null;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
/**
|
|
48
|
+
* Which Blockfrost key this node will boot with — never the key itself, so
|
|
49
|
+
* the value can be shown in a UI that is not trusted with secrets.
|
|
50
|
+
* 'none' means nothing would be written and the head cannot start.
|
|
51
|
+
*/
|
|
52
|
+
blockfrostKeySource: BlockfrostKeySource;
|
|
53
|
+
}
|
|
54
|
+
/** Where a node's Blockfrost project id comes from, most specific first. */
|
|
55
|
+
export type BlockfrostKeySource = 'node' | 'head' | 'server' | 'none';
|
|
56
|
+
/**
|
|
57
|
+
* Logging knobs that apply to every node of a head.
|
|
58
|
+
*
|
|
59
|
+
* `quiet` is hydra-node's own `-q`; the rotation pair is Docker's json-file
|
|
60
|
+
* driver. They live together because they answer one question — how much log a
|
|
61
|
+
* long-running head is allowed to accumulate — and getting it wrong fills a
|
|
62
|
+
* disk with JSON nobody reads.
|
|
63
|
+
*/
|
|
64
|
+
export interface HeadLoggingView {
|
|
65
|
+
/** `--quiet`: hydra-node emits nothing at all. */
|
|
66
|
+
quiet: boolean;
|
|
67
|
+
/** Docker json-file `max-size`, in MB, per log file. */
|
|
68
|
+
maxSizeMb: number;
|
|
69
|
+
/** Docker json-file `max-file`: how many rotated files are kept. */
|
|
70
|
+
maxFiles: number;
|
|
71
|
+
}
|
|
72
|
+
/** Offline-mode settings, present only when `chainBackend` is `offline`. */
|
|
73
|
+
export interface OfflineHeadView {
|
|
74
|
+
/** `--offline-head-seed`, derived from the head id unless overridden. */
|
|
75
|
+
headSeed: string;
|
|
76
|
+
/** Lovelace seeded to each node's own address when no UTxO set was supplied. */
|
|
77
|
+
seedLovelace: number;
|
|
78
|
+
/** True when the operator supplied the L2 starting UTxO themselves. */
|
|
79
|
+
customInitialUtxo: boolean;
|
|
80
|
+
/** True when a shelley genesis was supplied for `--ledger-genesis`. */
|
|
81
|
+
customLedgerGenesis: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface HydraHeadView {
|
|
84
|
+
id: number;
|
|
85
|
+
name: string;
|
|
86
|
+
description: string | null;
|
|
87
|
+
network: CardanoNetwork;
|
|
88
|
+
chainBackend: ChainBackend;
|
|
89
|
+
nodeCount: number;
|
|
90
|
+
contestationPeriod: number;
|
|
91
|
+
depositPeriod: number;
|
|
92
|
+
persistenceRotateAfter: number;
|
|
93
|
+
status: HeadStatus;
|
|
94
|
+
hydraState: HydraState;
|
|
95
|
+
hydraNodeImage: string;
|
|
96
|
+
logging: HeadLoggingView;
|
|
97
|
+
/** null on every backend but `offline`. */
|
|
98
|
+
offline: OfflineHeadView | null;
|
|
99
|
+
/**
|
|
100
|
+
* Protocol-parameter values pinned for this head, merged over whatever is
|
|
101
|
+
* fetched at start. Top-level keys only — see protocol-params.ts. Not a
|
|
102
|
+
* secret, so the UI can show exactly what was frozen and when.
|
|
103
|
+
*/
|
|
104
|
+
protocolParameterOverrides: Record<string, unknown> | null;
|
|
105
|
+
/** Last error surfaced while booting/stopping, cleared on next successful action. */
|
|
106
|
+
lastError: string | null;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
nodes: HydraNodeView[];
|
|
110
|
+
}
|
|
111
|
+
/** Snapshot of one node as reported live by the Hydra WebSocket API. */
|
|
112
|
+
export interface NodeLiveStatus {
|
|
113
|
+
nodeId: number;
|
|
114
|
+
name: string;
|
|
115
|
+
reachable: boolean;
|
|
116
|
+
hydraState: HydraState;
|
|
117
|
+
/** Hydra node version reported in Greetings. */
|
|
118
|
+
version?: string;
|
|
119
|
+
snapshotUtxoCount?: number;
|
|
120
|
+
error?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Peers this node has reported dropping, and not seen come back.
|
|
123
|
+
*
|
|
124
|
+
* Departures rather than membership on purpose: the control-plane attaches
|
|
125
|
+
* to a node without replaying its history, so it never learns which peers
|
|
126
|
+
* connected before it was watching. An empty list therefore means "nothing
|
|
127
|
+
* known to be wrong", not "no peers" — a connected-peer count would sit at
|
|
128
|
+
* zero on a healthy head and read as a permanent fault.
|
|
129
|
+
*/
|
|
130
|
+
peersDown?: string[];
|
|
131
|
+
/**
|
|
132
|
+
* Whether the container exists and is running, straight from Docker.
|
|
133
|
+
*
|
|
134
|
+
* Deliberately separate from `reachable`: a container that is up but whose
|
|
135
|
+
* API never answers is a different failure from one that is gone, and
|
|
136
|
+
* collapsing the two is what made a dead head keep reporting RUNNING.
|
|
137
|
+
*/
|
|
138
|
+
containerRunning?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Whether the node still has its Hydra network. False after
|
|
141
|
+
* `NetworkDisconnected`, which is what a peer dropping out looks like from
|
|
142
|
+
* the surviving nodes — the head's own state stays Open, so this is the only
|
|
143
|
+
* signal that the head is degraded.
|
|
144
|
+
*/
|
|
145
|
+
networkConnected?: boolean;
|
|
146
|
+
/** `InSync` / `CatchingUp` from the node itself. */
|
|
147
|
+
chainSynced?: 'InSync' | 'CatchingUp';
|
|
148
|
+
/** Head id the node reports, so two nodes on different heads are visible. */
|
|
149
|
+
headId?: string;
|
|
150
|
+
/** ISO timestamp of the last frame received from this node. */
|
|
151
|
+
lastMessageAt?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* What one node's container is consuming right now, from `docker stats`.
|
|
155
|
+
*
|
|
156
|
+
* This is the only number in the product that can be checked against the claim
|
|
157
|
+
* the node-count ceilings are sized on — ~500 MB of RAM per hydra-node at peak
|
|
158
|
+
* (docs/PRODUCT.md). A five-node offline head runs five of these on one machine,
|
|
159
|
+
* so "will this fit" stops being a guess.
|
|
160
|
+
*
|
|
161
|
+
* Every measure is nullable and the flags say why: a container that is gone has
|
|
162
|
+
* no numbers, and reporting 0% CPU for a dead node is worse than reporting
|
|
163
|
+
* nothing. Docker itself cannot always answer either — see `cpuPercent`.
|
|
164
|
+
*/
|
|
165
|
+
export interface NodeResourceUsage {
|
|
166
|
+
nodeId: number;
|
|
167
|
+
/** Container name, so a sample is attributable without the node row. */
|
|
168
|
+
name: string;
|
|
169
|
+
/** The container exists and is running. Everything below is null when false. */
|
|
170
|
+
running: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Percent of ONE host CPU, the same scale `docker stats` prints — so a node
|
|
173
|
+
* saturating two cores reads as 200%, not 100%. Null when the two samples
|
|
174
|
+
* Docker compares are identical, which happens on the first read after a
|
|
175
|
+
* container starts.
|
|
176
|
+
*/
|
|
177
|
+
cpuPercent: number | null;
|
|
178
|
+
/** Cores the container may spread over, for reading `cpuPercent` against. */
|
|
179
|
+
cpuCores: number | null;
|
|
180
|
+
/**
|
|
181
|
+
* Resident memory with page cache subtracted, which is what `docker stats`
|
|
182
|
+
* shows and what actually competes for RAM. The raw cgroup `usage` counts
|
|
183
|
+
* file cache the kernel will drop under pressure, and reading a hydra-node's
|
|
184
|
+
* 400 MB trusted-setup file makes that number meaningless.
|
|
185
|
+
*/
|
|
186
|
+
memoryBytes: number | null;
|
|
187
|
+
/** The container's limit, or the host's memory when it has none. */
|
|
188
|
+
memoryLimitBytes: number | null;
|
|
189
|
+
memoryPercent: number | null;
|
|
190
|
+
netRxBytes: number | null;
|
|
191
|
+
netTxBytes: number | null;
|
|
192
|
+
blockReadBytes: number | null;
|
|
193
|
+
blockWriteBytes: number | null;
|
|
194
|
+
pids: number | null;
|
|
195
|
+
sampledAt: string;
|
|
196
|
+
}
|
|
197
|
+
/** Every node of a head sampled together, so the head's own footprint adds up. */
|
|
198
|
+
export interface HeadResourceUsage {
|
|
199
|
+
headId: number;
|
|
200
|
+
nodes: NodeResourceUsage[];
|
|
201
|
+
/** Sum over running nodes. Null when nothing could be sampled. */
|
|
202
|
+
totalMemoryBytes: number | null;
|
|
203
|
+
totalCpuPercent: number | null;
|
|
204
|
+
sampledAt: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* What this server can actually do, as opposed to what it is configured to
|
|
208
|
+
* prefer. The UI needs the difference: a backend whose credential is missing
|
|
209
|
+
* has to be steered away from at creation, not discovered at boot.
|
|
210
|
+
*
|
|
211
|
+
* Deliberately carries no secrets — `blockfrost.configured` is a boolean, never
|
|
212
|
+
* the project id.
|
|
213
|
+
*/
|
|
214
|
+
export interface SystemConfig {
|
|
215
|
+
network: CardanoNetwork;
|
|
216
|
+
/** Backend a head gets when the create request names none. */
|
|
217
|
+
defaultChainBackend: ChainBackend;
|
|
218
|
+
defaultHydraNodeImage: string;
|
|
219
|
+
maxActiveNodes: number;
|
|
220
|
+
stateDir: string;
|
|
221
|
+
blockfrost: {
|
|
222
|
+
/** A server-wide BLOCKFROST_PROJECT_ID exists to fall back on. */
|
|
223
|
+
configured: boolean;
|
|
224
|
+
};
|
|
225
|
+
cardanoNode: {
|
|
226
|
+
/** CARDANO_NODE_SOCKET is set. */
|
|
227
|
+
configured: boolean;
|
|
228
|
+
/** …and the socket exists and is readable/writable right now. */
|
|
229
|
+
available: boolean;
|
|
230
|
+
/** Why not, when unavailable. */
|
|
231
|
+
reason?: string;
|
|
232
|
+
socketPath: string | null;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Boot progress for a head that is starting.
|
|
237
|
+
*
|
|
238
|
+
* Starting a head is not one action, it is six, and on a cold machine the image
|
|
239
|
+
* pull alone can run for minutes. A spinner covering all of that tells the
|
|
240
|
+
* operator nothing about whether anything is happening, and when it fails, the
|
|
241
|
+
* one error left on the row rarely says which part gave up. This is the same
|
|
242
|
+
* sequence the control-plane actually walks, reported as it happens.
|
|
243
|
+
*/
|
|
244
|
+
export type BootStepState = 'pending' | 'active' | 'done' | 'failed';
|
|
245
|
+
export interface BootStep {
|
|
246
|
+
key: string;
|
|
247
|
+
label: string;
|
|
248
|
+
state: BootStepState;
|
|
249
|
+
/** Live sub-status: pull progress, "2/3 nodes ready", the failure reason. */
|
|
250
|
+
detail?: string;
|
|
251
|
+
startedAt?: string;
|
|
252
|
+
endedAt?: string;
|
|
253
|
+
}
|
|
254
|
+
export interface BootLogLine {
|
|
255
|
+
at: string;
|
|
256
|
+
level: 'info' | 'warn' | 'error';
|
|
257
|
+
/** `hexcore` for the control-plane's own lines, else the container name. */
|
|
258
|
+
source: string;
|
|
259
|
+
message: string;
|
|
260
|
+
}
|
|
261
|
+
export interface HeadBootProgress {
|
|
262
|
+
headId: number;
|
|
263
|
+
status: 'running' | 'succeeded' | 'failed';
|
|
264
|
+
startedAt: string;
|
|
265
|
+
endedAt?: string;
|
|
266
|
+
steps: BootStep[];
|
|
267
|
+
/**
|
|
268
|
+
* The control-plane's own progress lines interleaved with what the
|
|
269
|
+
* containers printed while we waited for them. hydra-node explains its own
|
|
270
|
+
* refusals — an unknown flag, a bad key, a chain it cannot reach — and
|
|
271
|
+
* without this the operator only ever saw "node never became ready".
|
|
272
|
+
*/
|
|
273
|
+
logs: BootLogLine[];
|
|
274
|
+
/** Set when status is `failed`. */
|
|
275
|
+
error?: string;
|
|
276
|
+
}
|
|
277
|
+
export interface HeadLiveStatus {
|
|
278
|
+
headId: number;
|
|
279
|
+
status: HeadStatus;
|
|
280
|
+
hydraState: HydraState;
|
|
281
|
+
nodes: NodeLiveStatus[];
|
|
282
|
+
checkedAt: string;
|
|
283
|
+
/**
|
|
284
|
+
* The head is up but not whole — some containers are gone, some nodes are
|
|
285
|
+
* unreachable, or a node has lost its Hydra network.
|
|
286
|
+
*
|
|
287
|
+
* A separate axis from `status` on purpose. A three-node head with one node
|
|
288
|
+
* down is still RUNNING and still serving, but calling that healthy is how
|
|
289
|
+
* a half-dead head goes unnoticed until someone asks why a snapshot never
|
|
290
|
+
* confirms.
|
|
291
|
+
*/
|
|
292
|
+
degraded: boolean;
|
|
293
|
+
/** Why, when degraded. Empty otherwise. */
|
|
294
|
+
degradedReasons: string[];
|
|
295
|
+
/** Containers running, out of the head's node count. */
|
|
296
|
+
containersRunning: number;
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=domain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/domain.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,uEAM3B,CAAC;A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AC;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB;;;;;OAKG;IACH,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;OAQG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,wDAAwD;IACxD,iBAAiB,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NETWORK_MAGIC = exports.chainBackendSchema = exports.networkSchema = exports.nodeStatusSchema = exports.hydraStateSchema = exports.headStatusSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Hydra Head / Node domain model shared between control-plane and web UI.
|
|
6
|
+
*/
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
/** Lifecycle of a Head as tracked by the control-plane (not the on-chain Hydra state). */
|
|
9
|
+
exports.headStatusSchema = zod_1.z.enum([
|
|
10
|
+
'CONFIGURED', // rows + keys exist on disk, no containers
|
|
11
|
+
'STARTING', // containers created, waiting for all nodes to greet
|
|
12
|
+
'RUNNING', // all nodes answered Greetings
|
|
13
|
+
'STOPPED', // containers removed on purpose
|
|
14
|
+
'FAILED', // boot failed, containers cleaned up
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* On-chain Hydra protocol state, mirrored from the node's Greetings frame.
|
|
18
|
+
*
|
|
19
|
+
* Sourced from `Hydra.API.ServerOutput.HeadStatus`. FANNING_OUT landed after
|
|
20
|
+
* the 2.3.0 tag (selective partial fanout) and is accepted ahead of time so a
|
|
21
|
+
* newer image degrades to a correct label rather than UNKNOWN.
|
|
22
|
+
*/
|
|
23
|
+
exports.hydraStateSchema = zod_1.z.enum([
|
|
24
|
+
'IDLE',
|
|
25
|
+
'INITIALIZING',
|
|
26
|
+
'OPEN',
|
|
27
|
+
'CLOSED',
|
|
28
|
+
'FANOUT_POSSIBLE',
|
|
29
|
+
'FANNING_OUT',
|
|
30
|
+
'FINAL',
|
|
31
|
+
'UNKNOWN',
|
|
32
|
+
]);
|
|
33
|
+
exports.nodeStatusSchema = zod_1.z.enum(['CREATED', 'STARTING', 'RUNNING', 'STOPPED', 'FAILED']);
|
|
34
|
+
exports.networkSchema = zod_1.z.enum(['preprod', 'preview', 'mainnet']);
|
|
35
|
+
/**
|
|
36
|
+
* How a head talks to layer 1 — or whether it does at all.
|
|
37
|
+
*
|
|
38
|
+
* `offline` is not a variant of the other two: hydra-node's option parser puts
|
|
39
|
+
* `--offline-head-seed` on a different branch than `--blockfrost` /
|
|
40
|
+
* `--node-socket`, and mixing them aborts startup. See offline.ts.
|
|
41
|
+
*/
|
|
42
|
+
exports.chainBackendSchema = zod_1.z.enum(['blockfrost', 'cardano-node', 'offline']);
|
|
43
|
+
/** Network magic per network — used for --testnet-magic / --mainnet. */
|
|
44
|
+
exports.NETWORK_MAGIC = {
|
|
45
|
+
preprod: 1,
|
|
46
|
+
preview: 2,
|
|
47
|
+
mainnet: null, // mainnet uses --mainnet, no magic
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../src/domain.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,6BAAwB;AAExB,0FAA0F;AAC7E,QAAA,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC;IACnC,YAAY,EAAE,2CAA2C;IACzD,UAAU,EAAE,qDAAqD;IACjE,SAAS,EAAE,+BAA+B;IAC1C,SAAS,EAAE,gCAAgC;IAC3C,QAAQ,EAAE,qCAAqC;CAClD,CAAC,CAAC;AAGH;;;;;;GAMG;AACU,QAAA,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC;IACnC,MAAM;IACN,cAAc;IACd,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,aAAa;IACb,OAAO;IACP,SAAS;CACZ,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGnF,QAAA,aAAa,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAGvE;;;;;;GAMG;AACU,QAAA,kBAAkB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;AAGpF,wEAAwE;AAC3D,QAAA,aAAa,GAA0C;IAChE,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI,EAAE,mCAAmC;CACrD,CAAC"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-version hydra-node argv profiles.
|
|
3
|
+
*
|
|
4
|
+
* hydra-node's flag set moves between releases: 0.22.x has `--blockfrost` and
|
|
5
|
+
* `--network` but neither `--unsynced-period` nor the Blockfrost timeout knobs,
|
|
6
|
+
* which arrived in the 2.x line. An unknown flag aborts hydra-node during
|
|
7
|
+
* option parsing, so the container dies instantly and the head reports a
|
|
8
|
+
* generic "node never became ready" that points nowhere near the real cause.
|
|
9
|
+
*
|
|
10
|
+
* This table is the declared answer for the versions we ship support for: which
|
|
11
|
+
* flags exist, and what values to pass when the operator has not overridden
|
|
12
|
+
* them. Adding a hydra-node release is deliberately a code change — a new entry
|
|
13
|
+
* here plus a bump of HYDRA_NODE_IMAGE — so a version's argv is reviewed and
|
|
14
|
+
* tested rather than guessed at runtime.
|
|
15
|
+
*
|
|
16
|
+
* Images that match no entry (a fork, a `master` tag, a release newer than this
|
|
17
|
+
* build) are not rejected: the control-plane falls back to probing
|
|
18
|
+
* `hydra-node --help`. See capabilities.ts.
|
|
19
|
+
*
|
|
20
|
+
* Lives in shared because the UI lists the same versions in the create form
|
|
21
|
+
* that the control-plane accepts.
|
|
22
|
+
*/
|
|
23
|
+
import type { ChainBackend } from './domain';
|
|
24
|
+
/**
|
|
25
|
+
* A known upstream defect in some range of hydra-node releases.
|
|
26
|
+
*
|
|
27
|
+
* Separate from the flag table because it answers a different question. Flags
|
|
28
|
+
* decide whether a head can BOOT; this decides whether the version someone is
|
|
29
|
+
* about to pin for the life of a head is one they will regret. A head's image
|
|
30
|
+
* cannot be changed under running persistence, so the warning has to arrive
|
|
31
|
+
* while the create form is open, not the first time the bug bites.
|
|
32
|
+
*
|
|
33
|
+
* Matched by version range rather than by profile, so it also covers an image
|
|
34
|
+
* this build ships no profile for — a 2.2.0 pinned by hand is affected by the
|
|
35
|
+
* same bugs as one we declare.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* The machine the containers will actually run on.
|
|
39
|
+
*
|
|
40
|
+
* It belongs in this table because one of the things that decides whether an
|
|
41
|
+
* image works is not the image at all — every upstream hydra-node is amd64-only,
|
|
42
|
+
* and that is invisible on an amd64 host and fatal on Apple Silicon.
|
|
43
|
+
*
|
|
44
|
+
* OS as well as architecture, because on arm64 the two produce different
|
|
45
|
+
* failures and want different answers:
|
|
46
|
+
*
|
|
47
|
+
* - **darwin-arm64**: Docker Desktop runs the amd64 image under Rosetta, so it
|
|
48
|
+
* starts, stalls inside the KZG warm-up, and prints nothing. The worst kind
|
|
49
|
+
* of failure — it looks like a timeout with no cause.
|
|
50
|
+
* - **linux-arm64**: without qemu binfmt the daemon refuses the image outright
|
|
51
|
+
* ("no matching manifest for linux/arm64"), which is loud and self-explaining.
|
|
52
|
+
*
|
|
53
|
+
* `unknown` is a real answer, not a placeholder: an older control-plane, or a
|
|
54
|
+
* client asking before the server has said. Anything keyed on this must decide
|
|
55
|
+
* deliberately what to do with it.
|
|
56
|
+
*/
|
|
57
|
+
export type HostPlatform = 'darwin-arm64' | 'darwin-x64' | 'linux-arm64' | 'linux-x64' | 'unknown';
|
|
58
|
+
/** Every platform this table distinguishes, for entries that apply to all. */
|
|
59
|
+
export declare const HOST_PLATFORMS: readonly HostPlatform[];
|
|
60
|
+
/** True on a platform whose Docker cannot run an amd64 image natively. */
|
|
61
|
+
export declare function isArm64(platform: HostPlatform): boolean;
|
|
62
|
+
export interface HydraKnownIssue {
|
|
63
|
+
/**
|
|
64
|
+
* Issue number on cardano-scaling/hydra.
|
|
65
|
+
*
|
|
66
|
+
* Absent when the defect has no upstream issue — a packaging or platform
|
|
67
|
+
* fact rather than a bug report. `url` then points at our own record of it,
|
|
68
|
+
* so the claim is still checkable. Never invent a number to fill this in.
|
|
69
|
+
*/
|
|
70
|
+
id?: number;
|
|
71
|
+
url: string;
|
|
72
|
+
title: string;
|
|
73
|
+
/** What it means for someone running this version, in plain terms. */
|
|
74
|
+
impact: string;
|
|
75
|
+
/**
|
|
76
|
+
* `blocker` — the head stops or dies. `warning` — degraded but usable.
|
|
77
|
+
* Nothing here refuses a version: an operator may have a reason, and
|
|
78
|
+
* refusing would make an existing head unrunnable after an upgrade.
|
|
79
|
+
*/
|
|
80
|
+
severity: 'blocker' | 'warning';
|
|
81
|
+
/** First release WITHOUT the bug. Undefined means still open upstream. */
|
|
82
|
+
fixedIn?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Oldest release the defect is known to affect.
|
|
85
|
+
*
|
|
86
|
+
* Bounds the range at the bottom so a 2.x bug is not claimed against the
|
|
87
|
+
* 0.22 line, which is a different protocol with different scripts and a
|
|
88
|
+
* different head logic — the code the issue points at often does not exist
|
|
89
|
+
* there. Omit only when the defect plainly predates every version we offer.
|
|
90
|
+
* Guessing here is worse than staying quiet: a warning nobody can verify is
|
|
91
|
+
* one people learn to click past.
|
|
92
|
+
*/
|
|
93
|
+
affectedFrom?: string;
|
|
94
|
+
/** Only bites on these chain backends; omitted means all of them. */
|
|
95
|
+
backends?: ChainBackend[];
|
|
96
|
+
/**
|
|
97
|
+
* Only affects images whose full REFERENCE matches this.
|
|
98
|
+
*
|
|
99
|
+
* The escape hatch from version-range matching, and it exists because one
|
|
100
|
+
* defect here is not a property of the version at all. Upstream's images are
|
|
101
|
+
* amd64-only; a rebuild of the identical source for arm64 carries the same
|
|
102
|
+
* version number and is precisely the fix. Matched on the whole reference
|
|
103
|
+
* rather than the tag, since the registry and repository are what say who
|
|
104
|
+
* built it — `tagPattern` on a profile does the opposite, deliberately.
|
|
105
|
+
*
|
|
106
|
+
* Use it only when the defect really does travel with the build rather than
|
|
107
|
+
* the code. Anything the source contains belongs in the version range, where
|
|
108
|
+
* a private mirror of an affected version is still covered.
|
|
109
|
+
*/
|
|
110
|
+
imagePattern?: RegExp;
|
|
111
|
+
/**
|
|
112
|
+
* Only bites on these platforms.
|
|
113
|
+
*
|
|
114
|
+
* A blocker badge shown to everyone on a version most of them can run
|
|
115
|
+
* perfectly is not caution, it is the thing that teaches people to click
|
|
116
|
+
* past warnings. An issue carrying this is suppressed when the host is known
|
|
117
|
+
* to be something else — and shown when the host is `unknown`, because
|
|
118
|
+
* failing to warn is the worse of the two mistakes.
|
|
119
|
+
*/
|
|
120
|
+
hostPlatforms?: HostPlatform[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Defects worth warning about, newest first.
|
|
124
|
+
*
|
|
125
|
+
* Add an entry when upstream confirms one that changes whether a version is
|
|
126
|
+
* safe to pin — with the issue link, so the claim is checkable and can be
|
|
127
|
+
* retired when it is fixed.
|
|
128
|
+
*/
|
|
129
|
+
export declare const HYDRA_KNOWN_ISSUES: readonly HydraKnownIssue[];
|
|
130
|
+
/**
|
|
131
|
+
* Numeric version from an image tag, or null when it is not a release tag
|
|
132
|
+
* (`master`, a fork, a digest). Pre-release suffixes are ignored: `2.3.0-rc1`
|
|
133
|
+
* is treated as 2.3.0, which is the right call for "does this carry the fix".
|
|
134
|
+
*/
|
|
135
|
+
export declare function parseVersionTag(tag: string): [number, number, number] | null;
|
|
136
|
+
/** True when `tag` names a release strictly older than `other`. */
|
|
137
|
+
export declare function isVersionBefore(tag: string, other: string): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Known issues that apply to an image, optionally narrowed to one backend.
|
|
140
|
+
*
|
|
141
|
+
* An unparseable tag yields nothing rather than everything: we genuinely do not
|
|
142
|
+
* know what a `master` build contains, and warning about every open issue on a
|
|
143
|
+
* version that may well have the fix is noise that trains people to ignore it.
|
|
144
|
+
*/
|
|
145
|
+
export declare function knownIssuesFor(image: string, backend?: ChainBackend, platform?: HostPlatform): HydraKnownIssue[];
|
|
146
|
+
/** Which flags an image's option parser accepts. */
|
|
147
|
+
export interface HydraFlagSupport {
|
|
148
|
+
/** `--unsynced-period SECONDS` — needed to survive Blockfrost tip drift. */
|
|
149
|
+
unsyncedPeriod: boolean;
|
|
150
|
+
/** `--blockfrost-query-timeout` / `--blockfrost-retry-timeout`. */
|
|
151
|
+
blockfrostTimeouts: boolean;
|
|
152
|
+
/** `--network NETWORK`, selecting pre-published scripts. */
|
|
153
|
+
network: boolean;
|
|
154
|
+
/** `--blockfrost FILE`. Absent on very old builds. */
|
|
155
|
+
blockfrost: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* `--offline-head-seed` — hydra-node runs with its layer-1 interface
|
|
158
|
+
* disabled. Gated like the rest because it is the flag that selects the
|
|
159
|
+
* offline branch of the option parser: an image without it treats the head
|
|
160
|
+
* as online and dies on the first unknown option.
|
|
161
|
+
*/
|
|
162
|
+
offline: boolean;
|
|
163
|
+
}
|
|
164
|
+
/** Argument values a head boots with, once profile and overrides are merged. */
|
|
165
|
+
export interface HydraVersionArgs {
|
|
166
|
+
unsyncedPeriod: number;
|
|
167
|
+
blockfrostQueryTimeout: number;
|
|
168
|
+
blockfrostRetryTimeout: number;
|
|
169
|
+
/**
|
|
170
|
+
* Flags this version needs that no other version does, passed through
|
|
171
|
+
* verbatim. The escape hatch that keeps "support a new release" a data
|
|
172
|
+
* change here instead of a new branch in argv.ts.
|
|
173
|
+
*/
|
|
174
|
+
extraArgs: string[];
|
|
175
|
+
}
|
|
176
|
+
export interface HydraVersionProfile {
|
|
177
|
+
/** Stable key, also what the API and events report. */
|
|
178
|
+
id: string;
|
|
179
|
+
/** Human label for the create form. */
|
|
180
|
+
label: string;
|
|
181
|
+
/** Image this profile installs when picked in the UI. */
|
|
182
|
+
image: string;
|
|
183
|
+
/**
|
|
184
|
+
* Tags this profile claims, matched against the tag alone (not the whole
|
|
185
|
+
* ref) so a private mirror of the same version still resolves.
|
|
186
|
+
*/
|
|
187
|
+
tagPattern: RegExp;
|
|
188
|
+
flags: HydraFlagSupport;
|
|
189
|
+
args: HydraVersionArgs;
|
|
190
|
+
/** One line on what picking this version means, shown under the select. */
|
|
191
|
+
summary: string;
|
|
192
|
+
/**
|
|
193
|
+
* Platforms on which this is the version a new head should get.
|
|
194
|
+
*
|
|
195
|
+
* Not a plain boolean, because the right default genuinely differs by
|
|
196
|
+
* machine: upstream publishes amd64 only, and on Apple Silicon the image
|
|
197
|
+
* that boots is a rebuild of the same source. A single recommendation would
|
|
198
|
+
* have to be wrong for one of the two.
|
|
199
|
+
*/
|
|
200
|
+
recommendedOn?: HostPlatform[];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Newest first — `findVersionProfile` returns the first match, so a more
|
|
204
|
+
* specific pattern must come before a broader one.
|
|
205
|
+
*/
|
|
206
|
+
export declare const HYDRA_VERSION_PROFILES: readonly HydraVersionProfile[];
|
|
207
|
+
/**
|
|
208
|
+
* Values used when an image matches no profile, so an unrecognised image still
|
|
209
|
+
* boots with the same tuning the 2.x line gets. Whether the flags are actually
|
|
210
|
+
* passed is decided separately, by probing the image.
|
|
211
|
+
*/
|
|
212
|
+
export declare const FALLBACK_HYDRA_ARGS: HydraVersionArgs;
|
|
213
|
+
/**
|
|
214
|
+
* The tag part of an image reference.
|
|
215
|
+
*
|
|
216
|
+
* Written by hand rather than with a split(':') because both `localhost:5000/x`
|
|
217
|
+
* (registry port, no tag) and `x@sha256:…` (digest, no tag) would otherwise
|
|
218
|
+
* report a tag that does not exist and match the wrong profile.
|
|
219
|
+
*/
|
|
220
|
+
export declare function imageTag(image: string): string;
|
|
221
|
+
/** The profile claiming this image, or undefined when it must be probed. */
|
|
222
|
+
export declare function findVersionProfile(image: string): HydraVersionProfile | undefined;
|
|
223
|
+
/** Overrides an operator set in the environment; unset keys keep the profile's value. */
|
|
224
|
+
export interface HydraArgOverrides {
|
|
225
|
+
unsyncedPeriod?: number;
|
|
226
|
+
blockfrostQueryTimeout?: number;
|
|
227
|
+
blockfrostRetryTimeout?: number;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Merge, in order: explicit operator override, then the version's own default,
|
|
231
|
+
* then the fallback. An override is deliberately allowed to win over the
|
|
232
|
+
* profile — someone who set HYDRA_UNSYNCED_PERIOD for a reason should not have
|
|
233
|
+
* it silently reverted by a version bump.
|
|
234
|
+
*/
|
|
235
|
+
export declare function resolveHydraArgs(profile: HydraVersionProfile | undefined, overrides?: HydraArgOverrides): HydraVersionArgs;
|
|
236
|
+
/** Serialisable view of a profile — RegExp does not survive JSON. */
|
|
237
|
+
export interface HydraVersionInfo {
|
|
238
|
+
id: string;
|
|
239
|
+
label: string;
|
|
240
|
+
image: string;
|
|
241
|
+
summary: string;
|
|
242
|
+
recommended: boolean;
|
|
243
|
+
flags: HydraFlagSupport;
|
|
244
|
+
args: HydraVersionArgs;
|
|
245
|
+
/**
|
|
246
|
+
* Upstream defects this version carries, resolved from the version range so
|
|
247
|
+
* the UI does not have to. Backend filtering stays on the client, which is
|
|
248
|
+
* the only side that knows which backend the form has selected.
|
|
249
|
+
*/
|
|
250
|
+
knownIssues: HydraKnownIssue[];
|
|
251
|
+
}
|
|
252
|
+
export declare function toVersionInfo(profile: HydraVersionProfile, platform?: HostPlatform): HydraVersionInfo;
|
|
253
|
+
/** Response of `GET /api/hydra/versions`. */
|
|
254
|
+
export interface HydraVersionsResponse {
|
|
255
|
+
/** What a head gets when the caller names no image (HYDRA_NODE_IMAGE). */
|
|
256
|
+
defaultImage: string;
|
|
257
|
+
/** Profile id claiming `defaultImage`, or null when it will be probed. */
|
|
258
|
+
defaultProfileId: string | null;
|
|
259
|
+
profiles: HydraVersionInfo[];
|
|
260
|
+
/**
|
|
261
|
+
* The platform the containers will run on, as the SERVER sees it.
|
|
262
|
+
*
|
|
263
|
+
* Sent because which image works is partly a property of the machine, and
|
|
264
|
+
* only the control-plane knows which machine that is — the browser may be
|
|
265
|
+
* on a different one entirely. It is what makes "recommended" mean something
|
|
266
|
+
* a reader can check rather than a badge that appears for no stated reason.
|
|
267
|
+
*/
|
|
268
|
+
hostPlatform: HostPlatform;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Map Node's `process.platform` and `process.arch` onto the platforms this
|
|
272
|
+
* table distinguishes.
|
|
273
|
+
*
|
|
274
|
+
* Anything outside the four becomes `unknown` rather than being carried
|
|
275
|
+
* through: the table only holds evidence about those, and a claim about a
|
|
276
|
+
* FreeBSD s390x host is one nobody has checked.
|
|
277
|
+
*/
|
|
278
|
+
export declare function toHostPlatform(os: string, arch: string): HostPlatform;
|
|
279
|
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