@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,730 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request/response contracts. Imported by the control-plane (validation) AND the
|
|
3
|
+
* web UI (typed fetch) so the two can never drift.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { type CardanoNetwork } from './domain';
|
|
7
|
+
/**
|
|
8
|
+
* Creating a head in v2 only needs a name and a node count — the control-plane
|
|
9
|
+
* generates every Hydra/Cardano key itself. In v1 the caller had to supply
|
|
10
|
+
* pre-generated key material for every node, which was the single biggest
|
|
11
|
+
* source of setup friction.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* A Blockfrost project id carries the network in its prefix. Checking the shape
|
|
15
|
+
* here turns a typo into a field error on the create form instead of a head
|
|
16
|
+
* that boots and then never observes its own init transaction.
|
|
17
|
+
*/
|
|
18
|
+
export declare const blockfrostProjectIdSchema: z.ZodString;
|
|
19
|
+
/**
|
|
20
|
+
* Offline-mode settings. Only read when `chainBackend` is `offline`; the flags
|
|
21
|
+
* they produce are mutually exclusive with every online one (see offline.ts).
|
|
22
|
+
*/
|
|
23
|
+
export declare const offlineConfigSchema: z.ZodObject<{
|
|
24
|
+
/**
|
|
25
|
+
* `--offline-head-seed`. Left out, it is derived from the head id, which is
|
|
26
|
+
* both unique per head and stable across restarts — two heads sharing a
|
|
27
|
+
* seed would derive the same head id.
|
|
28
|
+
*/
|
|
29
|
+
headSeed: z.ZodOptional<z.ZodString>;
|
|
30
|
+
/**
|
|
31
|
+
* The L2 ledger's entire starting state, verbatim, as hydra-node's
|
|
32
|
+
* `--initial-utxo` file. Left out, each node's own address is seeded with
|
|
33
|
+
* `seedLovelace` — so the operator holds the keys to everything in the head
|
|
34
|
+
* without having to write this by hand.
|
|
35
|
+
*/
|
|
36
|
+
initialUtxo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
37
|
+
/**
|
|
38
|
+
* Bounded well below Number.MAX_SAFE_INTEGER: the value ends up in a JSON
|
|
39
|
+
* file read as JSON, and a seed large enough to round is a typo, not a
|
|
40
|
+
* requirement.
|
|
41
|
+
*/
|
|
42
|
+
seedLovelace: z.ZodDefault<z.ZodNumber>;
|
|
43
|
+
/**
|
|
44
|
+
* Shelley genesis for `--ledger-genesis`, which gives the simulated L1 its
|
|
45
|
+
* slot/time arithmetic. Genuinely optional — hydra-node's own default is
|
|
46
|
+
* "no genesis file" — so it is omitted rather than invented when absent: a
|
|
47
|
+
* hand-built partial genesis fails to decode and kills the node at startup.
|
|
48
|
+
*/
|
|
49
|
+
ledgerGenesis: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
seedLovelace: number;
|
|
52
|
+
headSeed?: string | undefined;
|
|
53
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
54
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
headSeed?: string | undefined;
|
|
57
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
58
|
+
seedLovelace?: number | undefined;
|
|
59
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
export type OfflineConfigInput = z.infer<typeof offlineConfigSchema>;
|
|
62
|
+
/** Per-head logging. See HeadLoggingView for why hydra-node and Docker knobs sit together. */
|
|
63
|
+
export declare const headLoggingSchema: z.ZodObject<{
|
|
64
|
+
/** hydra-node `--quiet`. */
|
|
65
|
+
quiet: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
/** Docker json-file max-size per file, in MB. */
|
|
67
|
+
maxSizeMb: z.ZodDefault<z.ZodNumber>;
|
|
68
|
+
/** Docker json-file max-file. */
|
|
69
|
+
maxFiles: z.ZodDefault<z.ZodNumber>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
quiet: boolean;
|
|
72
|
+
maxSizeMb: number;
|
|
73
|
+
maxFiles: number;
|
|
74
|
+
}, {
|
|
75
|
+
quiet?: boolean | undefined;
|
|
76
|
+
maxSizeMb?: number | undefined;
|
|
77
|
+
maxFiles?: number | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
export type HeadLoggingInput = z.infer<typeof headLoggingSchema>;
|
|
80
|
+
export declare const createHeadSchema: z.ZodEffects<z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
description: z.ZodOptional<z.ZodString>;
|
|
83
|
+
/** 1 = solo head (useful for smoke tests), up to 10 peers. */
|
|
84
|
+
nodeCount: z.ZodDefault<z.ZodNumber>;
|
|
85
|
+
network: z.ZodOptional<z.ZodEnum<["preprod", "preview", "mainnet"]>>;
|
|
86
|
+
chainBackend: z.ZodOptional<z.ZodEnum<["blockfrost", "cardano-node", "offline"]>>;
|
|
87
|
+
contestationPeriod: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
depositPeriod: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
persistenceRotateAfter: z.ZodDefault<z.ZodNumber>;
|
|
90
|
+
/**
|
|
91
|
+
* Overrides merged on top of whatever protocol parameters are fetched at
|
|
92
|
+
* start. TOP-LEVEL keys only: the merge is a shallow spread, so a partial
|
|
93
|
+
* nested object replaces its whole key and drops the siblings. The create
|
|
94
|
+
* form builds these with `diffProtocolParameters`, which is what keeps them
|
|
95
|
+
* whole — see protocol-params.ts.
|
|
96
|
+
*/
|
|
97
|
+
protocolParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
98
|
+
/** Only read when chainBackend is `offline`. */
|
|
99
|
+
offline: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
/**
|
|
101
|
+
* `--offline-head-seed`. Left out, it is derived from the head id, which is
|
|
102
|
+
* both unique per head and stable across restarts — two heads sharing a
|
|
103
|
+
* seed would derive the same head id.
|
|
104
|
+
*/
|
|
105
|
+
headSeed: z.ZodOptional<z.ZodString>;
|
|
106
|
+
/**
|
|
107
|
+
* The L2 ledger's entire starting state, verbatim, as hydra-node's
|
|
108
|
+
* `--initial-utxo` file. Left out, each node's own address is seeded with
|
|
109
|
+
* `seedLovelace` — so the operator holds the keys to everything in the head
|
|
110
|
+
* without having to write this by hand.
|
|
111
|
+
*/
|
|
112
|
+
initialUtxo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
113
|
+
/**
|
|
114
|
+
* Bounded well below Number.MAX_SAFE_INTEGER: the value ends up in a JSON
|
|
115
|
+
* file read as JSON, and a seed large enough to round is a typo, not a
|
|
116
|
+
* requirement.
|
|
117
|
+
*/
|
|
118
|
+
seedLovelace: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
/**
|
|
120
|
+
* Shelley genesis for `--ledger-genesis`, which gives the simulated L1 its
|
|
121
|
+
* slot/time arithmetic. Genuinely optional — hydra-node's own default is
|
|
122
|
+
* "no genesis file" — so it is omitted rather than invented when absent: a
|
|
123
|
+
* hand-built partial genesis fails to decode and kills the node at startup.
|
|
124
|
+
*/
|
|
125
|
+
ledgerGenesis: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
seedLovelace: number;
|
|
128
|
+
headSeed?: string | undefined;
|
|
129
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
130
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
headSeed?: string | undefined;
|
|
133
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
134
|
+
seedLovelace?: number | undefined;
|
|
135
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
136
|
+
}>>;
|
|
137
|
+
logging: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
/** hydra-node `--quiet`. */
|
|
139
|
+
quiet: z.ZodDefault<z.ZodBoolean>;
|
|
140
|
+
/** Docker json-file max-size per file, in MB. */
|
|
141
|
+
maxSizeMb: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
/** Docker json-file max-file. */
|
|
143
|
+
maxFiles: z.ZodDefault<z.ZodNumber>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
quiet: boolean;
|
|
146
|
+
maxSizeMb: number;
|
|
147
|
+
maxFiles: number;
|
|
148
|
+
}, {
|
|
149
|
+
quiet?: boolean | undefined;
|
|
150
|
+
maxSizeMb?: number | undefined;
|
|
151
|
+
maxFiles?: number | undefined;
|
|
152
|
+
}>>;
|
|
153
|
+
/**
|
|
154
|
+
* Blockfrost key for every node of this head, unless a node overrides it
|
|
155
|
+
* below. Optional: left out, nodes fall back to the server-wide key, and
|
|
156
|
+
* the control-plane refuses the head if there isn't one.
|
|
157
|
+
*/
|
|
158
|
+
blockfrostProjectId: z.ZodOptional<z.ZodString>;
|
|
159
|
+
/**
|
|
160
|
+
* Per-node keys, one per node in index order.
|
|
161
|
+
*
|
|
162
|
+
* Blockfrost meters per project id, so a head whose nodes all share one key
|
|
163
|
+
* spends a single rate limit budget N ways — fine for a smoke test, not for
|
|
164
|
+
* N independent participants. Sharing stays the default (this is left out,
|
|
165
|
+
* or filled with the same value); giving each node its own is a matter of
|
|
166
|
+
* filling the array.
|
|
167
|
+
*/
|
|
168
|
+
nodeBlockfrostProjectIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
169
|
+
/**
|
|
170
|
+
* Cardano payment keys to reuse instead of generating, one entry per node
|
|
171
|
+
* in index order; null for a node that should get a fresh pair.
|
|
172
|
+
*
|
|
173
|
+
* The point is funds: a generated node starts at a brand-new address that
|
|
174
|
+
* has to be filled from the faucet before the head can commit anything.
|
|
175
|
+
* Supplying a key that already holds test ADA skips that entirely.
|
|
176
|
+
*
|
|
177
|
+
* Hydra keys are never imported — they only sign Head protocol messages,
|
|
178
|
+
* so there is no state attached to carrying one over.
|
|
179
|
+
*/
|
|
180
|
+
nodeCardanoKeys: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodObject<{
|
|
181
|
+
/** A .skey file, its cborHex, 64 hex chars, or ed25519_sk1… */
|
|
182
|
+
signingKey: z.ZodString;
|
|
183
|
+
/** Optional .vkey, checked against the signing key. */
|
|
184
|
+
verificationKey: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
signingKey: string;
|
|
187
|
+
verificationKey?: string | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
signingKey: string;
|
|
190
|
+
verificationKey?: string | undefined;
|
|
191
|
+
}>>, "many">>;
|
|
192
|
+
/**
|
|
193
|
+
* Optional per-head hydra-node image; falls back to HYDRA_NODE_IMAGE.
|
|
194
|
+
*
|
|
195
|
+
* Any reference is accepted, not just the ones in HYDRA_VERSION_PROFILES —
|
|
196
|
+
* a tag with no profile is probed instead of refused, so a fork or a release
|
|
197
|
+
* newer than this build still boots. What the tag cannot be is empty or
|
|
198
|
+
* whitespace-bearing, which would reach Docker as an unparseable ref.
|
|
199
|
+
*/
|
|
200
|
+
hydraNodeImage: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
name: string;
|
|
203
|
+
nodeCount: number;
|
|
204
|
+
contestationPeriod: number;
|
|
205
|
+
depositPeriod: number;
|
|
206
|
+
persistenceRotateAfter: number;
|
|
207
|
+
offline?: {
|
|
208
|
+
seedLovelace: number;
|
|
209
|
+
headSeed?: string | undefined;
|
|
210
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
211
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
212
|
+
} | undefined;
|
|
213
|
+
description?: string | undefined;
|
|
214
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
215
|
+
chainBackend?: "blockfrost" | "cardano-node" | "offline" | undefined;
|
|
216
|
+
protocolParameters?: Record<string, unknown> | undefined;
|
|
217
|
+
logging?: {
|
|
218
|
+
quiet: boolean;
|
|
219
|
+
maxSizeMb: number;
|
|
220
|
+
maxFiles: number;
|
|
221
|
+
} | undefined;
|
|
222
|
+
blockfrostProjectId?: string | undefined;
|
|
223
|
+
nodeBlockfrostProjectIds?: string[] | undefined;
|
|
224
|
+
nodeCardanoKeys?: ({
|
|
225
|
+
signingKey: string;
|
|
226
|
+
verificationKey?: string | undefined;
|
|
227
|
+
} | null)[] | undefined;
|
|
228
|
+
hydraNodeImage?: string | undefined;
|
|
229
|
+
}, {
|
|
230
|
+
name: string;
|
|
231
|
+
offline?: {
|
|
232
|
+
headSeed?: string | undefined;
|
|
233
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
234
|
+
seedLovelace?: number | undefined;
|
|
235
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
236
|
+
} | undefined;
|
|
237
|
+
description?: string | undefined;
|
|
238
|
+
nodeCount?: number | undefined;
|
|
239
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
240
|
+
chainBackend?: "blockfrost" | "cardano-node" | "offline" | undefined;
|
|
241
|
+
contestationPeriod?: number | undefined;
|
|
242
|
+
depositPeriod?: number | undefined;
|
|
243
|
+
persistenceRotateAfter?: number | undefined;
|
|
244
|
+
protocolParameters?: Record<string, unknown> | undefined;
|
|
245
|
+
logging?: {
|
|
246
|
+
quiet?: boolean | undefined;
|
|
247
|
+
maxSizeMb?: number | undefined;
|
|
248
|
+
maxFiles?: number | undefined;
|
|
249
|
+
} | undefined;
|
|
250
|
+
blockfrostProjectId?: string | undefined;
|
|
251
|
+
nodeBlockfrostProjectIds?: string[] | undefined;
|
|
252
|
+
nodeCardanoKeys?: ({
|
|
253
|
+
signingKey: string;
|
|
254
|
+
verificationKey?: string | undefined;
|
|
255
|
+
} | null)[] | undefined;
|
|
256
|
+
hydraNodeImage?: string | undefined;
|
|
257
|
+
}>, {
|
|
258
|
+
name: string;
|
|
259
|
+
nodeCount: number;
|
|
260
|
+
contestationPeriod: number;
|
|
261
|
+
depositPeriod: number;
|
|
262
|
+
persistenceRotateAfter: number;
|
|
263
|
+
offline?: {
|
|
264
|
+
seedLovelace: number;
|
|
265
|
+
headSeed?: string | undefined;
|
|
266
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
267
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
268
|
+
} | undefined;
|
|
269
|
+
description?: string | undefined;
|
|
270
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
271
|
+
chainBackend?: "blockfrost" | "cardano-node" | "offline" | undefined;
|
|
272
|
+
protocolParameters?: Record<string, unknown> | undefined;
|
|
273
|
+
logging?: {
|
|
274
|
+
quiet: boolean;
|
|
275
|
+
maxSizeMb: number;
|
|
276
|
+
maxFiles: number;
|
|
277
|
+
} | undefined;
|
|
278
|
+
blockfrostProjectId?: string | undefined;
|
|
279
|
+
nodeBlockfrostProjectIds?: string[] | undefined;
|
|
280
|
+
nodeCardanoKeys?: ({
|
|
281
|
+
signingKey: string;
|
|
282
|
+
verificationKey?: string | undefined;
|
|
283
|
+
} | null)[] | undefined;
|
|
284
|
+
hydraNodeImage?: string | undefined;
|
|
285
|
+
}, {
|
|
286
|
+
name: string;
|
|
287
|
+
offline?: {
|
|
288
|
+
headSeed?: string | undefined;
|
|
289
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
290
|
+
seedLovelace?: number | undefined;
|
|
291
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
292
|
+
} | undefined;
|
|
293
|
+
description?: string | undefined;
|
|
294
|
+
nodeCount?: number | undefined;
|
|
295
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
296
|
+
chainBackend?: "blockfrost" | "cardano-node" | "offline" | undefined;
|
|
297
|
+
contestationPeriod?: number | undefined;
|
|
298
|
+
depositPeriod?: number | undefined;
|
|
299
|
+
persistenceRotateAfter?: number | undefined;
|
|
300
|
+
protocolParameters?: Record<string, unknown> | undefined;
|
|
301
|
+
logging?: {
|
|
302
|
+
quiet?: boolean | undefined;
|
|
303
|
+
maxSizeMb?: number | undefined;
|
|
304
|
+
maxFiles?: number | undefined;
|
|
305
|
+
} | undefined;
|
|
306
|
+
blockfrostProjectId?: string | undefined;
|
|
307
|
+
nodeBlockfrostProjectIds?: string[] | undefined;
|
|
308
|
+
nodeCardanoKeys?: ({
|
|
309
|
+
signingKey: string;
|
|
310
|
+
verificationKey?: string | undefined;
|
|
311
|
+
} | null)[] | undefined;
|
|
312
|
+
hydraNodeImage?: string | undefined;
|
|
313
|
+
}>;
|
|
314
|
+
export type CreateHeadInput = z.infer<typeof createHeadSchema>;
|
|
315
|
+
export declare const updateHeadSchema: z.ZodObject<{
|
|
316
|
+
offline: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
317
|
+
/**
|
|
318
|
+
* `--offline-head-seed`. Left out, it is derived from the head id, which is
|
|
319
|
+
* both unique per head and stable across restarts — two heads sharing a
|
|
320
|
+
* seed would derive the same head id.
|
|
321
|
+
*/
|
|
322
|
+
headSeed: z.ZodOptional<z.ZodString>;
|
|
323
|
+
/**
|
|
324
|
+
* The L2 ledger's entire starting state, verbatim, as hydra-node's
|
|
325
|
+
* `--initial-utxo` file. Left out, each node's own address is seeded with
|
|
326
|
+
* `seedLovelace` — so the operator holds the keys to everything in the head
|
|
327
|
+
* without having to write this by hand.
|
|
328
|
+
*/
|
|
329
|
+
initialUtxo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
330
|
+
/**
|
|
331
|
+
* Bounded well below Number.MAX_SAFE_INTEGER: the value ends up in a JSON
|
|
332
|
+
* file read as JSON, and a seed large enough to round is a typo, not a
|
|
333
|
+
* requirement.
|
|
334
|
+
*/
|
|
335
|
+
seedLovelace: z.ZodDefault<z.ZodNumber>;
|
|
336
|
+
/**
|
|
337
|
+
* Shelley genesis for `--ledger-genesis`, which gives the simulated L1 its
|
|
338
|
+
* slot/time arithmetic. Genuinely optional — hydra-node's own default is
|
|
339
|
+
* "no genesis file" — so it is omitted rather than invented when absent: a
|
|
340
|
+
* hand-built partial genesis fails to decode and kills the node at startup.
|
|
341
|
+
*/
|
|
342
|
+
ledgerGenesis: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
343
|
+
}, "strip", z.ZodTypeAny, {
|
|
344
|
+
seedLovelace: number;
|
|
345
|
+
headSeed?: string | undefined;
|
|
346
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
347
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
348
|
+
}, {
|
|
349
|
+
headSeed?: string | undefined;
|
|
350
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
351
|
+
seedLovelace?: number | undefined;
|
|
352
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
353
|
+
}>>>;
|
|
354
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
355
|
+
network: z.ZodOptional<z.ZodOptional<z.ZodEnum<["preprod", "preview", "mainnet"]>>>;
|
|
356
|
+
chainBackend: z.ZodOptional<z.ZodOptional<z.ZodEnum<["blockfrost", "cardano-node", "offline"]>>>;
|
|
357
|
+
contestationPeriod: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
358
|
+
depositPeriod: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
359
|
+
persistenceRotateAfter: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
360
|
+
protocolParameters: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
361
|
+
logging: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
362
|
+
/** hydra-node `--quiet`. */
|
|
363
|
+
quiet: z.ZodDefault<z.ZodBoolean>;
|
|
364
|
+
/** Docker json-file max-size per file, in MB. */
|
|
365
|
+
maxSizeMb: z.ZodDefault<z.ZodNumber>;
|
|
366
|
+
/** Docker json-file max-file. */
|
|
367
|
+
maxFiles: z.ZodDefault<z.ZodNumber>;
|
|
368
|
+
}, "strip", z.ZodTypeAny, {
|
|
369
|
+
quiet: boolean;
|
|
370
|
+
maxSizeMb: number;
|
|
371
|
+
maxFiles: number;
|
|
372
|
+
}, {
|
|
373
|
+
quiet?: boolean | undefined;
|
|
374
|
+
maxSizeMb?: number | undefined;
|
|
375
|
+
maxFiles?: number | undefined;
|
|
376
|
+
}>>>;
|
|
377
|
+
blockfrostProjectId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
378
|
+
nodeBlockfrostProjectIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
379
|
+
nodeCardanoKeys: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodObject<{
|
|
380
|
+
/** A .skey file, its cborHex, 64 hex chars, or ed25519_sk1… */
|
|
381
|
+
signingKey: z.ZodString;
|
|
382
|
+
/** Optional .vkey, checked against the signing key. */
|
|
383
|
+
verificationKey: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, "strip", z.ZodTypeAny, {
|
|
385
|
+
signingKey: string;
|
|
386
|
+
verificationKey?: string | undefined;
|
|
387
|
+
}, {
|
|
388
|
+
signingKey: string;
|
|
389
|
+
verificationKey?: string | undefined;
|
|
390
|
+
}>>, "many">>>;
|
|
391
|
+
hydraNodeImage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
392
|
+
} & {
|
|
393
|
+
name: z.ZodOptional<z.ZodString>;
|
|
394
|
+
}, "strip", z.ZodTypeAny, {
|
|
395
|
+
offline?: {
|
|
396
|
+
seedLovelace: number;
|
|
397
|
+
headSeed?: string | undefined;
|
|
398
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
399
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
400
|
+
} | undefined;
|
|
401
|
+
name?: string | undefined;
|
|
402
|
+
description?: string | undefined;
|
|
403
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
404
|
+
chainBackend?: "blockfrost" | "cardano-node" | "offline" | undefined;
|
|
405
|
+
contestationPeriod?: number | undefined;
|
|
406
|
+
depositPeriod?: number | undefined;
|
|
407
|
+
persistenceRotateAfter?: number | undefined;
|
|
408
|
+
protocolParameters?: Record<string, unknown> | undefined;
|
|
409
|
+
logging?: {
|
|
410
|
+
quiet: boolean;
|
|
411
|
+
maxSizeMb: number;
|
|
412
|
+
maxFiles: number;
|
|
413
|
+
} | undefined;
|
|
414
|
+
blockfrostProjectId?: string | undefined;
|
|
415
|
+
nodeBlockfrostProjectIds?: string[] | undefined;
|
|
416
|
+
nodeCardanoKeys?: ({
|
|
417
|
+
signingKey: string;
|
|
418
|
+
verificationKey?: string | undefined;
|
|
419
|
+
} | null)[] | undefined;
|
|
420
|
+
hydraNodeImage?: string | undefined;
|
|
421
|
+
}, {
|
|
422
|
+
offline?: {
|
|
423
|
+
headSeed?: string | undefined;
|
|
424
|
+
initialUtxo?: Record<string, unknown> | undefined;
|
|
425
|
+
seedLovelace?: number | undefined;
|
|
426
|
+
ledgerGenesis?: Record<string, unknown> | undefined;
|
|
427
|
+
} | undefined;
|
|
428
|
+
name?: string | undefined;
|
|
429
|
+
description?: string | undefined;
|
|
430
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
431
|
+
chainBackend?: "blockfrost" | "cardano-node" | "offline" | undefined;
|
|
432
|
+
contestationPeriod?: number | undefined;
|
|
433
|
+
depositPeriod?: number | undefined;
|
|
434
|
+
persistenceRotateAfter?: number | undefined;
|
|
435
|
+
protocolParameters?: Record<string, unknown> | undefined;
|
|
436
|
+
logging?: {
|
|
437
|
+
quiet?: boolean | undefined;
|
|
438
|
+
maxSizeMb?: number | undefined;
|
|
439
|
+
maxFiles?: number | undefined;
|
|
440
|
+
} | undefined;
|
|
441
|
+
blockfrostProjectId?: string | undefined;
|
|
442
|
+
nodeBlockfrostProjectIds?: string[] | undefined;
|
|
443
|
+
nodeCardanoKeys?: ({
|
|
444
|
+
signingKey: string;
|
|
445
|
+
verificationKey?: string | undefined;
|
|
446
|
+
} | null)[] | undefined;
|
|
447
|
+
hydraNodeImage?: string | undefined;
|
|
448
|
+
}>;
|
|
449
|
+
export type UpdateHeadInput = z.infer<typeof updateHeadSchema>;
|
|
450
|
+
/**
|
|
451
|
+
* Check a Cardano key before it is committed to a head.
|
|
452
|
+
*
|
|
453
|
+
* Pasting a key is the one step of head creation with no feedback: the address
|
|
454
|
+
* it produces is not visible until the head exists, and by then a wrong key
|
|
455
|
+
* means deleting and starting over. This answers "what address is this, and
|
|
456
|
+
* does it hold anything" while the form is still open.
|
|
457
|
+
*/
|
|
458
|
+
export declare const verifyCardanoKeySchema: z.ZodObject<{
|
|
459
|
+
signingKey: z.ZodString;
|
|
460
|
+
/** Optional, and only ever cross-checked against the signing key. */
|
|
461
|
+
verificationKey: z.ZodOptional<z.ZodString>;
|
|
462
|
+
/** Defaults to the server's network — the address differs per network. */
|
|
463
|
+
network: z.ZodOptional<z.ZodEnum<["preprod", "preview", "mainnet"]>>;
|
|
464
|
+
/**
|
|
465
|
+
* Key to look the balance up with, for a head that will carry its own.
|
|
466
|
+
* Falls back to the server-wide one; without either, the address still
|
|
467
|
+
* comes back and the balance does not.
|
|
468
|
+
*/
|
|
469
|
+
blockfrostProjectId: z.ZodOptional<z.ZodString>;
|
|
470
|
+
}, "strip", z.ZodTypeAny, {
|
|
471
|
+
signingKey: string;
|
|
472
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
473
|
+
blockfrostProjectId?: string | undefined;
|
|
474
|
+
verificationKey?: string | undefined;
|
|
475
|
+
}, {
|
|
476
|
+
signingKey: string;
|
|
477
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
478
|
+
blockfrostProjectId?: string | undefined;
|
|
479
|
+
verificationKey?: string | undefined;
|
|
480
|
+
}>;
|
|
481
|
+
export type VerifyCardanoKeyInput = z.infer<typeof verifyCardanoKeySchema>;
|
|
482
|
+
export interface VerifyCardanoKeyResult {
|
|
483
|
+
/** Enterprise address the signing key produces on `network`. */
|
|
484
|
+
address: string;
|
|
485
|
+
network: CardanoNetwork;
|
|
486
|
+
/** Present only when the pair was supplied and agrees. */
|
|
487
|
+
verificationKeyMatches?: boolean;
|
|
488
|
+
/** null when no chain connection was available to ask. */
|
|
489
|
+
balance: {
|
|
490
|
+
lovelace: string;
|
|
491
|
+
utxoCount: number;
|
|
492
|
+
} | null;
|
|
493
|
+
/** Why the balance is null — a missing key, or the lookup failing. */
|
|
494
|
+
balanceUnavailable?: string;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* The protocol parameters a head created right now would boot with.
|
|
498
|
+
*
|
|
499
|
+
* The create form needs the effective baseline before it can offer to edit it:
|
|
500
|
+
* overrides merge at the top level, so a field can only be changed safely by
|
|
501
|
+
* starting from the whole current value and diffing. Asking the server also
|
|
502
|
+
* keeps the browser out of the business of holding a Blockfrost key.
|
|
503
|
+
*/
|
|
504
|
+
export declare const protocolParametersQuerySchema: z.ZodObject<{
|
|
505
|
+
network: z.ZodOptional<z.ZodEnum<["preprod", "preview", "mainnet"]>>;
|
|
506
|
+
/** For a head that will carry its own key, before it exists. */
|
|
507
|
+
blockfrostProjectId: z.ZodOptional<z.ZodString>;
|
|
508
|
+
/** Set false to see real L1 fees instead of the zeroed L2 ones. */
|
|
509
|
+
zeroFees: z.ZodOptional<z.ZodBoolean>;
|
|
510
|
+
}, "strip", z.ZodTypeAny, {
|
|
511
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
512
|
+
blockfrostProjectId?: string | undefined;
|
|
513
|
+
zeroFees?: boolean | undefined;
|
|
514
|
+
}, {
|
|
515
|
+
network?: "preprod" | "preview" | "mainnet" | undefined;
|
|
516
|
+
blockfrostProjectId?: string | undefined;
|
|
517
|
+
zeroFees?: boolean | undefined;
|
|
518
|
+
}>;
|
|
519
|
+
export type ProtocolParametersQuery = z.infer<typeof protocolParametersQuerySchema>;
|
|
520
|
+
export interface ProtocolParametersResult {
|
|
521
|
+
parameters: Record<string, unknown>;
|
|
522
|
+
/** `blockfrost` when live values were fetched, `defaults` for the static baseline. */
|
|
523
|
+
source: 'blockfrost' | 'defaults';
|
|
524
|
+
/** Why the static baseline was used, when it was. */
|
|
525
|
+
note?: string;
|
|
526
|
+
}
|
|
527
|
+
export declare const listHeadsQuerySchema: z.ZodObject<{
|
|
528
|
+
status: z.ZodOptional<z.ZodString>;
|
|
529
|
+
}, "strip", z.ZodTypeAny, {
|
|
530
|
+
status?: string | undefined;
|
|
531
|
+
}, {
|
|
532
|
+
status?: string | undefined;
|
|
533
|
+
}>;
|
|
534
|
+
/** Wipe persistence dirs so the head can restart from a clean slate. */
|
|
535
|
+
export declare const resetHeadSchema: z.ZodObject<{
|
|
536
|
+
/** Also delete generated key material (forces brand-new addresses). */
|
|
537
|
+
includeKeys: z.ZodDefault<z.ZodBoolean>;
|
|
538
|
+
}, "strip", z.ZodTypeAny, {
|
|
539
|
+
includeKeys: boolean;
|
|
540
|
+
}, {
|
|
541
|
+
includeKeys?: boolean | undefined;
|
|
542
|
+
}>;
|
|
543
|
+
export type ResetHeadInput = z.infer<typeof resetHeadSchema>;
|
|
544
|
+
export declare const loginSchema: z.ZodObject<{
|
|
545
|
+
username: z.ZodString;
|
|
546
|
+
password: z.ZodString;
|
|
547
|
+
}, "strip", z.ZodTypeAny, {
|
|
548
|
+
username: string;
|
|
549
|
+
password: string;
|
|
550
|
+
}, {
|
|
551
|
+
username: string;
|
|
552
|
+
password: string;
|
|
553
|
+
}>;
|
|
554
|
+
export type LoginInput = z.infer<typeof loginSchema>;
|
|
555
|
+
/**
|
|
556
|
+
* First-run setup.
|
|
557
|
+
*
|
|
558
|
+
* Until this exists, standing up Hexcore meant editing a 123-line `.env` by
|
|
559
|
+
* hand — which assumes the reader already knows what a Blockfrost project id is
|
|
560
|
+
* and which of thirty keys matter. docs/PRODUCT.md names non-technical
|
|
561
|
+
* operators as a first-class audience, and that file is where they stopped.
|
|
562
|
+
*
|
|
563
|
+
* The settings a wizard may write are deliberately a SMALL subset of the env
|
|
564
|
+
* schema. Two rules decide what is in:
|
|
565
|
+
*
|
|
566
|
+
* 1. It must be answerable by someone who has not read the code. `PORT_BASE`
|
|
567
|
+
* and `HYDRA_UNSYNCED_PERIOD` are not; they stay env-only, where whoever
|
|
568
|
+
* needs them will find them.
|
|
569
|
+
* 2. It must be applicable without a restart. `PORT` and `STATE_DIR` are read
|
|
570
|
+
* once while the process boots — offering them in a web form would produce
|
|
571
|
+
* a saved setting that silently does not take effect.
|
|
572
|
+
*/
|
|
573
|
+
export declare const settingsSchema: z.ZodObject<{
|
|
574
|
+
network: z.ZodEnum<["preprod", "preview", "mainnet"]>;
|
|
575
|
+
chainBackend: z.ZodEnum<["blockfrost", "cardano-node", "offline"]>;
|
|
576
|
+
/**
|
|
577
|
+
* Blank clears it. The wizard sends what the operator typed, and an empty
|
|
578
|
+
* box has to mean "no key" rather than "keep the old one" — the opposite
|
|
579
|
+
* rule is what makes a settings form unable to remove a value.
|
|
580
|
+
*/
|
|
581
|
+
blockfrostProjectId: z.ZodOptional<z.ZodString>;
|
|
582
|
+
cardanoNodeSocket: z.ZodOptional<z.ZodString>;
|
|
583
|
+
/** Default image for heads that name none; a head can still pin its own. */
|
|
584
|
+
hydraNodeImage: z.ZodOptional<z.ZodString>;
|
|
585
|
+
adminUsername: z.ZodOptional<z.ZodString>;
|
|
586
|
+
}, "strip", z.ZodTypeAny, {
|
|
587
|
+
network: "preprod" | "preview" | "mainnet";
|
|
588
|
+
chainBackend: "blockfrost" | "cardano-node" | "offline";
|
|
589
|
+
blockfrostProjectId?: string | undefined;
|
|
590
|
+
hydraNodeImage?: string | undefined;
|
|
591
|
+
cardanoNodeSocket?: string | undefined;
|
|
592
|
+
adminUsername?: string | undefined;
|
|
593
|
+
}, {
|
|
594
|
+
network: "preprod" | "preview" | "mainnet";
|
|
595
|
+
chainBackend: "blockfrost" | "cardano-node" | "offline";
|
|
596
|
+
blockfrostProjectId?: string | undefined;
|
|
597
|
+
hydraNodeImage?: string | undefined;
|
|
598
|
+
cardanoNodeSocket?: string | undefined;
|
|
599
|
+
adminUsername?: string | undefined;
|
|
600
|
+
}>;
|
|
601
|
+
export type SettingsInput = z.infer<typeof settingsSchema>;
|
|
602
|
+
/**
|
|
603
|
+
* The setup request.
|
|
604
|
+
*
|
|
605
|
+
* Carries the admin password, which is the one value that must never reach the
|
|
606
|
+
* settings file: it is handed to the auth service, hashed into `secrets.json`,
|
|
607
|
+
* and dropped. Left blank, one is generated and printed once — the same
|
|
608
|
+
* behaviour a fresh boot has always had.
|
|
609
|
+
*/
|
|
610
|
+
export declare const completeSetupSchema: z.ZodObject<{
|
|
611
|
+
network: z.ZodEnum<["preprod", "preview", "mainnet"]>;
|
|
612
|
+
chainBackend: z.ZodEnum<["blockfrost", "cardano-node", "offline"]>;
|
|
613
|
+
/**
|
|
614
|
+
* Blank clears it. The wizard sends what the operator typed, and an empty
|
|
615
|
+
* box has to mean "no key" rather than "keep the old one" — the opposite
|
|
616
|
+
* rule is what makes a settings form unable to remove a value.
|
|
617
|
+
*/
|
|
618
|
+
blockfrostProjectId: z.ZodOptional<z.ZodString>;
|
|
619
|
+
cardanoNodeSocket: z.ZodOptional<z.ZodString>;
|
|
620
|
+
/** Default image for heads that name none; a head can still pin its own. */
|
|
621
|
+
hydraNodeImage: z.ZodOptional<z.ZodString>;
|
|
622
|
+
adminUsername: z.ZodOptional<z.ZodString>;
|
|
623
|
+
} & {
|
|
624
|
+
/**
|
|
625
|
+
* Proves the caller can read the terminal Hexcore was started from.
|
|
626
|
+
*
|
|
627
|
+
* Setup is necessarily reachable without a token — it is where the password
|
|
628
|
+
* is set — so on any interface but loopback the first request wins, and on
|
|
629
|
+
* a shared network that is a takeover. The CLI prints the URL with this in
|
|
630
|
+
* it, so for the person who just ran `hexcore` it costs a click.
|
|
631
|
+
*/
|
|
632
|
+
setupToken: z.ZodString;
|
|
633
|
+
adminPassword: z.ZodOptional<z.ZodString>;
|
|
634
|
+
}, "strip", z.ZodTypeAny, {
|
|
635
|
+
network: "preprod" | "preview" | "mainnet";
|
|
636
|
+
chainBackend: "blockfrost" | "cardano-node" | "offline";
|
|
637
|
+
setupToken: string;
|
|
638
|
+
blockfrostProjectId?: string | undefined;
|
|
639
|
+
hydraNodeImage?: string | undefined;
|
|
640
|
+
cardanoNodeSocket?: string | undefined;
|
|
641
|
+
adminUsername?: string | undefined;
|
|
642
|
+
adminPassword?: string | undefined;
|
|
643
|
+
}, {
|
|
644
|
+
network: "preprod" | "preview" | "mainnet";
|
|
645
|
+
chainBackend: "blockfrost" | "cardano-node" | "offline";
|
|
646
|
+
setupToken: string;
|
|
647
|
+
blockfrostProjectId?: string | undefined;
|
|
648
|
+
hydraNodeImage?: string | undefined;
|
|
649
|
+
cardanoNodeSocket?: string | undefined;
|
|
650
|
+
adminUsername?: string | undefined;
|
|
651
|
+
adminPassword?: string | undefined;
|
|
652
|
+
}>;
|
|
653
|
+
export type CompleteSetupInput = z.infer<typeof completeSetupSchema>;
|
|
654
|
+
/** Public, pre-login: what the UI needs to decide whether to show the wizard. */
|
|
655
|
+
export interface SetupStatus {
|
|
656
|
+
/** No settings have been saved and no `.env` was found. */
|
|
657
|
+
required: boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Why setup is considered done, when it is. Worth stating: an operator
|
|
660
|
+
* whose `.env` is being read but who expected the wizard needs to know
|
|
661
|
+
* which of the two Hexcore picked.
|
|
662
|
+
*/
|
|
663
|
+
completedVia?: 'wizard' | 'env-file' | 'environment';
|
|
664
|
+
completedAt?: string;
|
|
665
|
+
/** Suggested defaults for the form, from whatever is already resolvable. */
|
|
666
|
+
defaults: SettingsInput;
|
|
667
|
+
/** True when the server is only listening on loopback. */
|
|
668
|
+
loopbackOnly: boolean;
|
|
669
|
+
}
|
|
670
|
+
/** Where a resolved setting actually came from. Answers "why is this value X". */
|
|
671
|
+
export type SettingSource = 'environment' | 'env-file' | 'settings-file' | 'default';
|
|
672
|
+
export interface SettingProvenance {
|
|
673
|
+
key: string;
|
|
674
|
+
/** Secrets are reported as whether they are set, never as their value. */
|
|
675
|
+
value: string | null;
|
|
676
|
+
secret: boolean;
|
|
677
|
+
source: SettingSource;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* How far a wipe goes.
|
|
681
|
+
*
|
|
682
|
+
* Split into three because the middle one is the one people actually want and
|
|
683
|
+
* the last one destroys money. A head's Cardano keys control addresses that may
|
|
684
|
+
* hold test ADA — or, on mainnet, ADA — and Hexcore is the only place they
|
|
685
|
+
* exist. `everything` is therefore CLI-only; see the note on cleanSchema.
|
|
686
|
+
*/
|
|
687
|
+
export declare const cleanScopeSchema: z.ZodEnum<["config", "heads", "everything"]>;
|
|
688
|
+
export type CleanScope = z.infer<typeof cleanScopeSchema>;
|
|
689
|
+
/**
|
|
690
|
+
* `everything` is deliberately absent from the API surface.
|
|
691
|
+
*
|
|
692
|
+
* Two reasons, and the second is not negotiable: it deletes the key material
|
|
693
|
+
* behind funded addresses, and it deletes the SQLite database the request is
|
|
694
|
+
* being served from. A server cannot honestly delete its own state mid-request
|
|
695
|
+
* and then answer. `hexcore clean --all` does it with the process stopped.
|
|
696
|
+
*/
|
|
697
|
+
export declare const cleanSchema: z.ZodObject<{
|
|
698
|
+
scope: z.ZodEnum<["config", "heads"]>;
|
|
699
|
+
/** Must equal the machine's own name; the UI shows which to type. */
|
|
700
|
+
confirm: z.ZodString;
|
|
701
|
+
}, "strip", z.ZodTypeAny, {
|
|
702
|
+
scope: "config" | "heads";
|
|
703
|
+
confirm: string;
|
|
704
|
+
}, {
|
|
705
|
+
scope: "config" | "heads";
|
|
706
|
+
confirm: string;
|
|
707
|
+
}>;
|
|
708
|
+
export type CleanInput = z.infer<typeof cleanSchema>;
|
|
709
|
+
export interface CleanResult {
|
|
710
|
+
scope: CleanScope;
|
|
711
|
+
headsRemoved: number;
|
|
712
|
+
containersRemoved: number;
|
|
713
|
+
/** Set when the wipe cleared settings and setup is required again. */
|
|
714
|
+
setupRequired: boolean;
|
|
715
|
+
}
|
|
716
|
+
/** Uniform envelope for every control-plane response. */
|
|
717
|
+
export interface ApiOk<T> {
|
|
718
|
+
ok: true;
|
|
719
|
+
data: T;
|
|
720
|
+
}
|
|
721
|
+
export interface ApiErr {
|
|
722
|
+
ok: false;
|
|
723
|
+
error: {
|
|
724
|
+
code: string;
|
|
725
|
+
message: string;
|
|
726
|
+
details?: unknown;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
export type ApiResponse<T> = ApiOk<T> | ApiErr;
|
|
730
|
+
//# sourceMappingURL=api.d.ts.map
|