@xyo-network/xl1-cli-lib 2.0.17 → 3.0.0
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/dist/node/commands/start/startCommand.d.ts +2 -3
- package/dist/node/commands/start/startCommand.d.ts.map +1 -1
- package/dist/node/configMiddleware.d.ts +2 -2
- package/dist/node/configMiddleware.d.ts.map +1 -1
- package/dist/node/dumpProviders.d.ts.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.mjs +67 -57
- package/dist/node/index.mjs.map +4 -4
- package/dist/node/initLogger.d.ts +2 -2
- package/dist/node/initLogger.d.ts.map +1 -1
- package/dist/node/{runCLI.d.ts → runCli.d.ts} +1 -1
- package/dist/node/runCli.d.ts.map +1 -0
- package/dist/node/xl1.mjs +71 -59
- package/dist/node/xl1.mjs.map +4 -4
- package/package.json +60 -58
- package/dist/node/runCLI.d.ts.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { GetLocatorsFromConfig } from '@xyo-network/chain-orchestration';
|
|
2
|
-
import type { Config } from '@xyo-network/xl1-sdk';
|
|
1
|
+
import type { ConfigWithMnemonic, GetLocatorsFromConfig } from '@xyo-network/chain-orchestration';
|
|
3
2
|
import type { CommandModule } from 'yargs';
|
|
4
|
-
export declare function startCommand(getConfiguration: () =>
|
|
3
|
+
export declare function startCommand(getConfiguration: () => ConfigWithMnemonic, getLocatorsFromConfig: GetLocatorsFromConfig): CommandModule;
|
|
5
4
|
//# sourceMappingURL=startCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/start/startCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"startCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/start/startCommand.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACO,kBAAkB,EAAE,qBAAqB,EAC3D,MAAM,kCAAkC,CAAA;AAKzC,OAAO,KAAK,EACgB,aAAa,EACxC,MAAM,OAAO,CAAA;AAyEd,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,MAAM,kBAAkB,EAAE,qBAAqB,EAAE,qBAAqB,GAAG,aAAa,CA6BpI"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConfigWithMnemonic } from '@xyo-network/chain-orchestration';
|
|
2
2
|
/**
|
|
3
3
|
* Returns a deep clone of `config` with secret-bearing leaf values replaced by
|
|
4
4
|
* `'[REDACTED]'`. Walks plain objects and arrays. Leaves primitives, dates,
|
|
5
5
|
* and other non-plain values untouched (other than via `structuredClone`).
|
|
6
6
|
*/
|
|
7
7
|
export declare function redactConfig<T>(config: T): T;
|
|
8
|
-
export declare function configMiddleware(argv: Record<string, unknown>, setConfiguration: (config:
|
|
8
|
+
export declare function configMiddleware(argv: Record<string, unknown>, setConfiguration: (config: ConfigWithMnemonic) => void): Promise<void>;
|
|
9
9
|
//# sourceMappingURL=configMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configMiddleware.d.ts","sourceRoot":"","sources":["../../src/configMiddleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configMiddleware.d.ts","sourceRoot":"","sources":["../../src/configMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,kBAAkB,EAIxB,MAAM,kCAAkC,CAAA;AA2BzC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAI5C;AA4FD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC3I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dumpProviders.d.ts","sourceRoot":"","sources":["../../src/dumpProviders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"dumpProviders.d.ts","sourceRoot":"","sources":["../../src/dumpProviders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAA;AAuJ1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,8BAA8B,CAAC,GAAG,MAAM,CA+BnG"}
|
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.mjs
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
ActorMnemonicNotAllowedError,
|
|
5
5
|
assertNoActorMnemonics,
|
|
6
6
|
ConfigFileNotFoundError,
|
|
7
|
+
finalizeConfig,
|
|
8
|
+
stripOrchestrationOnlyConnections,
|
|
7
9
|
tryParseConfig
|
|
8
10
|
} from "@xyo-network/chain-orchestration";
|
|
9
11
|
import {
|
|
@@ -44,7 +46,7 @@ function coerceActorsArray(argv) {
|
|
|
44
46
|
if (actors === void 0 || Array.isArray(actors)) return argv;
|
|
45
47
|
if (typeof actors !== "object" || actors === null) return argv;
|
|
46
48
|
const entries = Object.entries(actors);
|
|
47
|
-
const numericEntries = entries.map(([key, value]) => [Number(key), value]).filter(([key]) => Number.
|
|
49
|
+
const numericEntries = entries.map(([key, value]) => [Number(key), value]).filter(([key]) => Number.isSafeInteger(key) && key >= 0);
|
|
48
50
|
if (numericEntries.length !== entries.length) return argv;
|
|
49
51
|
const asArray = [];
|
|
50
52
|
for (const [key, value] of numericEntries) asArray[key] = value;
|
|
@@ -57,22 +59,45 @@ function safeParseOrThrow(input2) {
|
|
|
57
59
|
}
|
|
58
60
|
async function buildFinalConfig(argv) {
|
|
59
61
|
const configPath = argv.config;
|
|
60
|
-
const
|
|
61
|
-
const rootMnemonicFromFile = typeof
|
|
62
|
+
const parsedConfigFileRaw = await tryParseConfig({ configPath });
|
|
63
|
+
const rootMnemonicFromFile = typeof parsedConfigFileRaw.mnemonic === "string" ? parsedConfigFileRaw.mnemonic : void 0;
|
|
62
64
|
const normalizedArgv = coerceActorsArray(argv);
|
|
63
|
-
const
|
|
65
|
+
const argsForSdk = stripOrchestrationOnlyConnections(normalizedArgv);
|
|
66
|
+
const parsedConfigArgs = ConfigZod.safeParse(argsForSdk).data ?? {};
|
|
64
67
|
const rootMnemonicFromArgs = typeof normalizedArgv.mnemonic === "string" ? normalizedArgv.mnemonic : void 0;
|
|
65
|
-
const
|
|
66
|
-
|
|
68
|
+
const parsedFileRecord = parsedConfigFileRaw;
|
|
69
|
+
let fileForMerge = parsedFileRecord;
|
|
70
|
+
const argvActors = normalizedArgv.actors;
|
|
71
|
+
if (Array.isArray(argvActors) && argvActors.length > 0) {
|
|
72
|
+
const { actors: _dropped, ...rest } = parsedFileRecord;
|
|
73
|
+
fileForMerge = rest;
|
|
74
|
+
}
|
|
75
|
+
const rawMerged = deepMerge(fileForMerge, parsedConfigArgs);
|
|
76
|
+
const mergedForSdk = stripOrchestrationOnlyConnections(rawMerged);
|
|
77
|
+
const mergedConfig = safeParseOrThrow(mergedForSdk);
|
|
67
78
|
const rootMnemonic = rootMnemonicFromArgs ?? rootMnemonicFromFile;
|
|
68
|
-
|
|
79
|
+
const finalized = finalizeConfig({
|
|
80
|
+
...mergedConfig,
|
|
81
|
+
...isDefined(rootMnemonic) && { mnemonic: rootMnemonic }
|
|
82
|
+
});
|
|
83
|
+
const strippedForResolve = stripOrchestrationOnlyConnections(finalized);
|
|
84
|
+
const preResolve = safeParseOrThrow(strippedForResolve);
|
|
85
|
+
const resolved = resolveConfig(preResolve);
|
|
86
|
+
const strippedResolved = stripOrchestrationOnlyConnections(resolved);
|
|
87
|
+
const validated = safeParseOrThrow(strippedResolved);
|
|
88
|
+
const toFinalize = {
|
|
89
|
+
...validated,
|
|
90
|
+
...isDefined(rootMnemonic) && { mnemonic: rootMnemonic }
|
|
91
|
+
};
|
|
92
|
+
const finalWithConnections = finalizeConfig(toFinalize);
|
|
93
|
+
return finalWithConnections;
|
|
69
94
|
}
|
|
70
95
|
async function configMiddleware(argv, setConfiguration) {
|
|
71
96
|
try {
|
|
72
97
|
const finalConfig = await buildFinalConfig(argv);
|
|
73
98
|
assertNoActorMnemonics(finalConfig);
|
|
74
99
|
setConfiguration(finalConfig);
|
|
75
|
-
if (argv["dump-config"]) {
|
|
100
|
+
if (argv["dump-config"] === true) {
|
|
76
101
|
const withSecrets = Boolean(argv["with-secrets"]);
|
|
77
102
|
const output2 = withSecrets ? finalConfig : redactConfig(finalConfig);
|
|
78
103
|
console.log(JSON.stringify(output2, null, 2));
|
|
@@ -86,7 +111,7 @@ async function configMiddleware(argv, setConfiguration) {
|
|
|
86
111
|
} else if (isZodError(err)) {
|
|
87
112
|
console.error(`Zod error: ${err.message}`);
|
|
88
113
|
} else {
|
|
89
|
-
console.error(`Error parsing configuration: ${err}`);
|
|
114
|
+
console.error(`Error parsing configuration: ${String(err)}`);
|
|
90
115
|
}
|
|
91
116
|
if (!(err instanceof ConfigFileNotFoundError) && !(err instanceof ActorMnemonicNotAllowedError)) {
|
|
92
117
|
console.error(`Stack: ${err instanceof Error ? err.stack : "N/A"}`);
|
|
@@ -119,13 +144,14 @@ var initLogger = (config2) => {
|
|
|
119
144
|
return logger;
|
|
120
145
|
};
|
|
121
146
|
|
|
122
|
-
// src/
|
|
147
|
+
// src/runCli.ts
|
|
123
148
|
import { stdin as input, stdout as output } from "node:process";
|
|
124
149
|
import { createInterface } from "node:readline/promises";
|
|
125
150
|
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
126
151
|
import { apiCommand } from "@xyo-network/chain-api";
|
|
127
152
|
import { bridgeCommand } from "@xyo-network/chain-bridge";
|
|
128
153
|
import { finalizerCommand } from "@xyo-network/chain-finalizer";
|
|
154
|
+
import { indexerCommand } from "@xyo-network/chain-indexer";
|
|
129
155
|
import { mempoolCommand } from "@xyo-network/chain-mempool";
|
|
130
156
|
import {
|
|
131
157
|
contextFromConfigWithoutLocator,
|
|
@@ -133,11 +159,11 @@ import {
|
|
|
133
159
|
formatWalletReport,
|
|
134
160
|
initializeResolvedWalletReport,
|
|
135
161
|
locatorsFromConfig,
|
|
136
|
-
Orchestrator
|
|
162
|
+
Orchestrator,
|
|
163
|
+
stripOrchestrationOnlyConnections as stripOrchestrationOnlyConnections2
|
|
137
164
|
} from "@xyo-network/chain-orchestration";
|
|
138
165
|
import { initHealthEndpoints } from "@xyo-network/chain-orchestration-express";
|
|
139
166
|
import { producerCommand } from "@xyo-network/chain-producer";
|
|
140
|
-
import { publisherCommand } from "@xyo-network/chain-publisher";
|
|
141
167
|
import { rewardRedemptionCommand } from "@xyo-network/chain-reward-redemption";
|
|
142
168
|
import {
|
|
143
169
|
ActorConfigZod,
|
|
@@ -152,20 +178,12 @@ import { z } from "zod/mini";
|
|
|
152
178
|
import { getApiActor } from "@xyo-network/chain-api";
|
|
153
179
|
import { getBridgeActor } from "@xyo-network/chain-bridge";
|
|
154
180
|
import { getFinalizerActor } from "@xyo-network/chain-finalizer";
|
|
181
|
+
import { getIndexerActor } from "@xyo-network/chain-indexer";
|
|
155
182
|
import { getMempoolActor } from "@xyo-network/chain-mempool";
|
|
156
|
-
import {
|
|
157
|
-
ApiConfigZod,
|
|
158
|
-
BridgeConfigZod,
|
|
159
|
-
FinalizerConfigZod,
|
|
160
|
-
MempoolConfigZod,
|
|
161
|
-
ProducerConfigZod,
|
|
162
|
-
PublisherConfigZod,
|
|
163
|
-
RewardRedemptionConfigZod
|
|
164
|
-
} from "@xyo-network/chain-orchestration";
|
|
183
|
+
import { buildActorFromConfiguration } from "@xyo-network/chain-orchestration";
|
|
165
184
|
import { getProducerActor } from "@xyo-network/chain-producer";
|
|
166
|
-
import { getPublisherActor } from "@xyo-network/chain-publisher";
|
|
167
185
|
import { getRewardRedemptionActor } from "@xyo-network/chain-reward-redemption";
|
|
168
|
-
var KNOWN_ACTORS = ["api", "bridge", "finalizer", "
|
|
186
|
+
var KNOWN_ACTORS = ["api", "bridge", "finalizer", "indexer", "mempool", "producer", "rewardRedemption"];
|
|
169
187
|
var BOOT_TIMEOUT_MS = 6e4;
|
|
170
188
|
function getActorsFromConfig(configuration2) {
|
|
171
189
|
const enabledActors = configuration2.actors.filter((actor) => actor.enabled !== false).map((actor) => actor.name);
|
|
@@ -174,35 +192,28 @@ function getActorsFromConfig(configuration2) {
|
|
|
174
192
|
function getDefaultActors() {
|
|
175
193
|
return ["api", "producer", "finalizer"];
|
|
176
194
|
}
|
|
177
|
-
async function buildActor(name, locator) {
|
|
195
|
+
async function buildActor(name, locator, configuration2) {
|
|
178
196
|
switch (name) {
|
|
179
197
|
case "api": {
|
|
180
|
-
|
|
181
|
-
return await getApiActor(config2, locator);
|
|
198
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getApiActor);
|
|
182
199
|
}
|
|
183
200
|
case "bridge": {
|
|
184
|
-
|
|
185
|
-
return await getBridgeActor(config2, locator);
|
|
201
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getBridgeActor);
|
|
186
202
|
}
|
|
187
203
|
case "mempool": {
|
|
188
|
-
|
|
189
|
-
return await getMempoolActor(config2, locator);
|
|
204
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getMempoolActor);
|
|
190
205
|
}
|
|
191
206
|
case "producer": {
|
|
192
|
-
|
|
193
|
-
return await getProducerActor(config2, locator);
|
|
207
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getProducerActor);
|
|
194
208
|
}
|
|
195
209
|
case "rewardRedemption": {
|
|
196
|
-
|
|
197
|
-
return await getRewardRedemptionActor(config2, locator);
|
|
210
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getRewardRedemptionActor);
|
|
198
211
|
}
|
|
199
212
|
case "finalizer": {
|
|
200
|
-
|
|
201
|
-
return await getFinalizerActor(config2, locator);
|
|
213
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getFinalizerActor);
|
|
202
214
|
}
|
|
203
|
-
case "
|
|
204
|
-
|
|
205
|
-
return await getPublisherActor(config2, locator);
|
|
215
|
+
case "indexer": {
|
|
216
|
+
return await buildActorFromConfiguration(name, configuration2, locator, getIndexerActor);
|
|
206
217
|
}
|
|
207
218
|
default: {
|
|
208
219
|
throw new Error(`Unknown actor: ${name}`);
|
|
@@ -211,7 +222,7 @@ async function buildActor(name, locator) {
|
|
|
211
222
|
}
|
|
212
223
|
async function bootActors(requestedActors, locators, orchestrator, configuration2) {
|
|
213
224
|
const startedAt = Date.now();
|
|
214
|
-
const actors = await Promise.all(requestedActors.map((name) => buildActor(name, locators[name])));
|
|
225
|
+
const actors = await Promise.all(requestedActors.map((name) => buildActor(name, locators[name], configuration2)));
|
|
215
226
|
for (const actor of actors) {
|
|
216
227
|
await orchestrator.registerActor(actor);
|
|
217
228
|
}
|
|
@@ -266,7 +277,6 @@ function withDeprecationWarning(module) {
|
|
|
266
277
|
|
|
267
278
|
// src/dumpProviders.ts
|
|
268
279
|
var CANONICAL_ACTOR_ORDER = [
|
|
269
|
-
"_root",
|
|
270
280
|
"producer",
|
|
271
281
|
"finalizer",
|
|
272
282
|
"api",
|
|
@@ -277,8 +287,7 @@ var CANONICAL_ACTOR_ORDER = [
|
|
|
277
287
|
function enumerateLocator(locator) {
|
|
278
288
|
const collapsed = /* @__PURE__ */ new Map();
|
|
279
289
|
const registry = locator.registry;
|
|
280
|
-
for (const moniker of Object.
|
|
281
|
-
const factories = registry[moniker];
|
|
290
|
+
for (const [moniker, factories] of Object.entries(registry)) {
|
|
282
291
|
if (!factories) continue;
|
|
283
292
|
for (const factory of factories) {
|
|
284
293
|
const f = factory;
|
|
@@ -300,7 +309,7 @@ function enumerateLocator(locator) {
|
|
|
300
309
|
}
|
|
301
310
|
}
|
|
302
311
|
}
|
|
303
|
-
return
|
|
312
|
+
return collapsed.values().toArray().toSorted((a, b) => a.moniker.localeCompare(b.moniker) || a.providerName.localeCompare(b.providerName));
|
|
304
313
|
}
|
|
305
314
|
function buildOwnerIndex(perActor) {
|
|
306
315
|
const monikerOwners = /* @__PURE__ */ new Map();
|
|
@@ -317,7 +326,7 @@ function buildOwnerIndex(perActor) {
|
|
|
317
326
|
return monikerOwners;
|
|
318
327
|
}
|
|
319
328
|
function renderDuplicatesSummary(monikerOwners) {
|
|
320
|
-
const duplicates = [...monikerOwners
|
|
329
|
+
const duplicates = [...monikerOwners].filter(([, owners]) => owners.size > 1).map(([moniker, owners]) => ({ moniker, owners: [...owners].toSorted((a, b) => a.localeCompare(b)).map(formatGroupForDisplay) })).toSorted((a, b) => a.moniker.localeCompare(b.moniker));
|
|
321
330
|
if (duplicates.length === 0) return [];
|
|
322
331
|
const lines = ["Duplicate monikers (registered by more than one locator):"];
|
|
323
332
|
for (const { moniker, owners } of duplicates) {
|
|
@@ -328,8 +337,7 @@ function renderDuplicatesSummary(monikerOwners) {
|
|
|
328
337
|
}
|
|
329
338
|
function groupActorsBySharedRegistry(locators) {
|
|
330
339
|
const groups = [];
|
|
331
|
-
for (const actorName of Object.
|
|
332
|
-
const locator = locators[actorName];
|
|
340
|
+
for (const [actorName, locator] of Object.entries(locators)) {
|
|
333
341
|
const existing = groups.find((g) => g.registry === locator.registry);
|
|
334
342
|
if (existing) {
|
|
335
343
|
existing.actorNames.push(actorName);
|
|
@@ -344,14 +352,14 @@ function groupActorsBySharedRegistry(locators) {
|
|
|
344
352
|
return groups;
|
|
345
353
|
}
|
|
346
354
|
function groupId(actorNames) {
|
|
347
|
-
return
|
|
355
|
+
return actorNames.toSorted((a, b) => a.localeCompare(b)).join(",");
|
|
348
356
|
}
|
|
349
357
|
function formatGroupForDisplay(groupKey) {
|
|
350
358
|
const members = groupKey.split(",");
|
|
351
359
|
return members.length === 1 ? members[0] : `(${members.join(", ")})`;
|
|
352
360
|
}
|
|
353
361
|
function renderGroupSection(actorNames, entries, monikerOwners) {
|
|
354
|
-
const sortedActors =
|
|
362
|
+
const sortedActors = actorNames.toSorted((a, b) => a.localeCompare(b));
|
|
355
363
|
const ownGroupKey = groupId(sortedActors);
|
|
356
364
|
const heading = sortedActors.length === 1 ? `Providers for actor: ${sortedActors[0]} (${entries.length} registered)` : `Providers shared by actors: ${sortedActors.join(", ")} (${entries.length} registered)`;
|
|
357
365
|
const lines = [heading];
|
|
@@ -364,7 +372,7 @@ function renderGroupSection(actorNames, entries, monikerOwners) {
|
|
|
364
372
|
const isLast = i === entries.length - 1;
|
|
365
373
|
const branch = isLast ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500";
|
|
366
374
|
const owners = monikerOwners.get(entry.moniker) ?? /* @__PURE__ */ new Set();
|
|
367
|
-
const otherOwners = [...owners].filter((o) => o !== ownGroupKey).toSorted().map(formatGroupForDisplay);
|
|
375
|
+
const otherOwners = [...owners].filter((o) => o !== ownGroupKey).toSorted((a, b) => a.localeCompare(b)).map(formatGroupForDisplay);
|
|
368
376
|
const dupNote = otherOwners.length > 0 ? ` \u26A0 also in: ${otherOwners.join(", ")}` : "";
|
|
369
377
|
const depsNote = entry.dependencies.length > 0 ? `, deps: [${entry.dependencies.join(", ")}]` : "";
|
|
370
378
|
const countNote = entry.count > 1 ? ` (\xD7${entry.count})` : "";
|
|
@@ -390,7 +398,7 @@ function formatProviderTree(locators) {
|
|
|
390
398
|
});
|
|
391
399
|
const lines = ["XL1 Provider Dump", "=================", ""];
|
|
392
400
|
for (const g of orderedGroups) {
|
|
393
|
-
lines.push(...renderGroupSection(g.actorNames.toSorted(), perGroup.get(g.key) ?? [], monikerOwners));
|
|
401
|
+
lines.push(...renderGroupSection(g.actorNames.toSorted((a, b) => a.localeCompare(b)), perGroup.get(g.key) ?? [], monikerOwners));
|
|
394
402
|
}
|
|
395
403
|
lines.push(...renderDuplicatesSummary(monikerOwners));
|
|
396
404
|
return lines.join("\n");
|
|
@@ -426,14 +434,14 @@ var optionsFromGlobalZodRegistry = () => {
|
|
|
426
434
|
const opts = {};
|
|
427
435
|
for (const schema of Object.values(globalRegistry._map)) {
|
|
428
436
|
if (isUsageMeta(schema)) {
|
|
429
|
-
if (schema.hidden) continue;
|
|
437
|
+
if (schema.hidden === true) continue;
|
|
430
438
|
opts[schema.title] = usageMetaToOptions(schema);
|
|
431
439
|
}
|
|
432
440
|
}
|
|
433
441
|
return opts;
|
|
434
442
|
};
|
|
435
443
|
|
|
436
|
-
// src/
|
|
444
|
+
// src/runCli.ts
|
|
437
445
|
var DEFAULT_HEALTH_CHECK_PORT = 9099;
|
|
438
446
|
function defaultScrapePortForActors(actors) {
|
|
439
447
|
const primary = actors[0];
|
|
@@ -443,7 +451,7 @@ function defaultScrapePortForActors(actors) {
|
|
|
443
451
|
var configuration;
|
|
444
452
|
var skipInsecureConfirm = false;
|
|
445
453
|
var dumpProviders = false;
|
|
446
|
-
var version = isDefined3("
|
|
454
|
+
var version = isDefined3("3.0.0") ? "3.0.0" : "unknown";
|
|
447
455
|
function getConfiguration() {
|
|
448
456
|
return configuration;
|
|
449
457
|
}
|
|
@@ -470,7 +478,9 @@ async function getLocatorsFromConfig(actors, configuration2) {
|
|
|
470
478
|
actorConfigs.push(actorConfig);
|
|
471
479
|
}
|
|
472
480
|
}
|
|
473
|
-
const
|
|
481
|
+
const fullConfig = { ...configuration2, actors: actorConfigs };
|
|
482
|
+
const configForSdk = stripOrchestrationOnlyConnections2(fullConfig);
|
|
483
|
+
const config2 = ConfigZod2.parse(configForSdk);
|
|
474
484
|
const logger = initLogger(configuration2);
|
|
475
485
|
const orchestrator = await Orchestrator.create({ logger });
|
|
476
486
|
const collision = detectDerivationPathCollisions(actors, configuration2);
|
|
@@ -483,7 +493,7 @@ async function getLocatorsFromConfig(actors, configuration2) {
|
|
|
483
493
|
logger.warn("Insecure genesis reward wallet is active. Interactive confirmation skipped via --skip-insecure-confirm.");
|
|
484
494
|
}
|
|
485
495
|
const onInsecureGenesisConfirm = skipInsecureConfirm ? void 0 : async () => await promptForInsecureGenesisConfirmation(logger);
|
|
486
|
-
const locators = await locatorsFromConfig(context,
|
|
496
|
+
const locators = await locatorsFromConfig(context, fullConfig, onInsecureGenesisConfirm);
|
|
487
497
|
if (dumpProviders) {
|
|
488
498
|
console.log(formatProviderTree(locators));
|
|
489
499
|
process.exit(0);
|
|
@@ -532,7 +542,7 @@ $0 <command> [options]`).parserConfiguration({
|
|
|
532
542
|
});
|
|
533
543
|
skipInsecureConfirm = Boolean(argv2["skip-insecure-confirm"]);
|
|
534
544
|
dumpProviders = Boolean(argv2["dump-providers"]);
|
|
535
|
-
}).options(optionsFromGlobalZodRegistry()).wrap(y.terminalWidth()).command(withDeprecationWarning(apiCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(bridgeCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(finalizerCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(
|
|
545
|
+
}).options(optionsFromGlobalZodRegistry()).wrap(y.terminalWidth()).command(withDeprecationWarning(apiCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(bridgeCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(finalizerCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(indexerCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(mempoolCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(producerCommand(getConfiguration, getLocatorsFromConfig))).command(withDeprecationWarning(rewardRedemptionCommand(getConfiguration, getLocatorsFromConfig))).command(startCommand(getConfiguration, getLocatorsFromConfig)).options({
|
|
536
546
|
"config": {
|
|
537
547
|
type: "string",
|
|
538
548
|
description: "Path to a config file to use instead of the default search.",
|