@lionden/network 0.1.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.
Files changed (55) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +23 -0
  3. package/dist/accounts.d.ts +12 -0
  4. package/dist/accounts.d.ts.map +1 -0
  5. package/dist/accounts.js +38 -0
  6. package/dist/accounts.js.map +1 -0
  7. package/dist/connection.d.ts +121 -0
  8. package/dist/connection.d.ts.map +1 -0
  9. package/dist/connection.js +1064 -0
  10. package/dist/connection.js.map +1 -0
  11. package/dist/devnode-backend.d.ts +53 -0
  12. package/dist/devnode-backend.d.ts.map +1 -0
  13. package/dist/devnode-backend.js +121 -0
  14. package/dist/devnode-backend.js.map +1 -0
  15. package/dist/devnode-manager.d.ts +130 -0
  16. package/dist/devnode-manager.d.ts.map +1 -0
  17. package/dist/devnode-manager.js +546 -0
  18. package/dist/devnode-manager.js.map +1 -0
  19. package/dist/execution-key-cache.d.ts +71 -0
  20. package/dist/execution-key-cache.d.ts.map +1 -0
  21. package/dist/execution-key-cache.js +286 -0
  22. package/dist/execution-key-cache.js.map +1 -0
  23. package/dist/file-io.d.ts +2 -0
  24. package/dist/file-io.d.ts.map +1 -0
  25. package/dist/file-io.js +9 -0
  26. package/dist/file-io.js.map +1 -0
  27. package/dist/index.d.ts +12 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +11 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/named-account-manager.d.ts +40 -0
  32. package/dist/named-account-manager.d.ts.map +1 -0
  33. package/dist/named-account-manager.js +116 -0
  34. package/dist/named-account-manager.js.map +1 -0
  35. package/dist/network-manager.d.ts +36 -0
  36. package/dist/network-manager.d.ts.map +1 -0
  37. package/dist/network-manager.js +226 -0
  38. package/dist/network-manager.js.map +1 -0
  39. package/dist/sdk-adapter.d.ts +271 -0
  40. package/dist/sdk-adapter.d.ts.map +1 -0
  41. package/dist/sdk-adapter.js +997 -0
  42. package/dist/sdk-adapter.js.map +1 -0
  43. package/dist/sdk-diagnostics.d.ts +113 -0
  44. package/dist/sdk-diagnostics.d.ts.map +1 -0
  45. package/dist/sdk-diagnostics.js +241 -0
  46. package/dist/sdk-diagnostics.js.map +1 -0
  47. package/dist/transition-selector.d.ts +15 -0
  48. package/dist/transition-selector.d.ts.map +1 -0
  49. package/dist/transition-selector.js +45 -0
  50. package/dist/transition-selector.js.map +1 -0
  51. package/dist/types.d.ts +484 -0
  52. package/dist/types.d.ts.map +1 -0
  53. package/dist/types.js +129 -0
  54. package/dist/types.js.map +1 -0
  55. package/package.json +35 -0
@@ -0,0 +1,546 @@
1
+ /**
2
+ * DevnodeManager — manages the lifecycle of a `leo devnode start` process.
3
+ *
4
+ * Handles spawning, health-checking, and graceful shutdown.
5
+ */
6
+ import { spawn } from "node:child_process";
7
+ const DEFAULT_STANDALONE_BINARY = "aleo-devnode";
8
+ const DEFAULT_SOCKET_ADDR = "127.0.0.1:3030";
9
+ const DEFAULT_PRIVATE_KEY = "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH";
10
+ const HEALTH_CHECK_INTERVAL_MS = 200;
11
+ const HEALTH_CHECK_TIMEOUT_MS = 30_000;
12
+ const SHUTDOWN_TIMEOUT_MS = 5_000;
13
+ const EXIT_DRAIN_GRACE_MS = 1_000;
14
+ const LOG_BUFFER_BYTES = 64 * 1024;
15
+ const LOG_TAIL_RENDER_BYTES = 4 * 1024;
16
+ /**
17
+ * Whether `leo devnode start` for the given `leoVersion` still accepts the
18
+ * `--consensus-heights` / `--network` flags. Leo 4.3 removed both from the
19
+ * `devnode start` subcommand, so they are only emitted for Leo < 4.3. An
20
+ * unparseable/unset version is treated as modern (>= 4.3) and omits both —
21
+ * emitting a removed flag is a hard `devnode start` failure, whereas omitting
22
+ * one on an older line only drops the (now-obsolete) explicit heights/network.
23
+ * Mirrors `emitsLegacyBuildFlags` in leo-compiler.
24
+ */
25
+ function devnodeEmitsLegacyFlags(leoVersion) {
26
+ if (!leoVersion)
27
+ return false;
28
+ const match = /^(\d+)\.(\d+)\./.exec(leoVersion);
29
+ if (!match)
30
+ return false;
31
+ const major = Number(match[1]);
32
+ const minor = Number(match[2]);
33
+ return major < 4 || (major === 4 && minor < 3);
34
+ }
35
+ /**
36
+ * Bounded byte ring buffer backed by a list of chunks. Trims the oldest bytes
37
+ * (slicing the head chunk if needed) until total bytes ≤ `maxBytes`.
38
+ */
39
+ class RingBuffer {
40
+ maxBytes;
41
+ chunks = [];
42
+ byteLength = 0;
43
+ constructor(maxBytes) {
44
+ this.maxBytes = maxBytes;
45
+ }
46
+ append(chunk) {
47
+ if (chunk.length === 0)
48
+ return;
49
+ this.chunks.push(chunk);
50
+ this.byteLength += chunk.length;
51
+ while (this.byteLength > this.maxBytes && this.chunks.length > 0) {
52
+ const head = this.chunks[0];
53
+ const overflow = this.byteLength - this.maxBytes;
54
+ if (head.length <= overflow) {
55
+ this.chunks.shift();
56
+ this.byteLength -= head.length;
57
+ }
58
+ else {
59
+ this.chunks[0] = head.subarray(overflow);
60
+ this.byteLength -= overflow;
61
+ }
62
+ }
63
+ }
64
+ toString() {
65
+ if (this.chunks.length === 0)
66
+ return "";
67
+ return Buffer.concat(this.chunks, this.byteLength).toString("utf8");
68
+ }
69
+ }
70
+ /** Map a `DevnodeLogMode` to the corresponding `spawn` stdio array. */
71
+ export function stdioConfigForMode(logMode) {
72
+ if (logMode === "inherit")
73
+ return ["ignore", "inherit", "inherit"];
74
+ return ["ignore", "pipe", "pipe"];
75
+ }
76
+ /**
77
+ * Attach drain listeners to the child's piped streams per `logMode`. Owns the
78
+ * internal ring buffers; returns a handle whose `getTail()` produces the
79
+ * current buffered tail (≤ 64 KiB per stream). For `logMode: "inherit"`
80
+ * returns an empty-tail handle without touching the streams.
81
+ */
82
+ export function setupChildLogging(proc, logMode, callbacks) {
83
+ if (logMode === "inherit") {
84
+ return { getTail: () => ({ stdout: "", stderr: "" }) };
85
+ }
86
+ const stdoutBuf = new RingBuffer(LOG_BUFFER_BYTES);
87
+ const stderrBuf = new RingBuffer(LOG_BUFFER_BYTES);
88
+ proc.stdout?.on("data", (chunk) => {
89
+ stdoutBuf.append(chunk);
90
+ if (logMode === "forward")
91
+ callbacks?.onStdout?.(chunk);
92
+ });
93
+ proc.stderr?.on("data", (chunk) => {
94
+ stderrBuf.append(chunk);
95
+ if (logMode === "forward")
96
+ callbacks?.onStderr?.(chunk);
97
+ });
98
+ return {
99
+ getTail: () => ({
100
+ stdout: stdoutBuf.toString(),
101
+ stderr: stderrBuf.toString(),
102
+ }),
103
+ };
104
+ }
105
+ function formatExit(code, signal) {
106
+ if (signal !== null && code !== null)
107
+ return `code ${code} signal ${signal}`;
108
+ if (signal !== null)
109
+ return `signal ${signal}`;
110
+ return `code ${code ?? "null"}`;
111
+ }
112
+ function resolveLogMode(opts) {
113
+ if (opts.logMode !== undefined) {
114
+ return {
115
+ mode: opts.logMode,
116
+ callbacks: opts.onStdout || opts.onStderr
117
+ ? { onStdout: opts.onStdout, onStderr: opts.onStderr }
118
+ : undefined,
119
+ };
120
+ }
121
+ const env = process.env["LIONDEN_DEVNODE_LOGS"];
122
+ if (env === "1" || env === "inherit")
123
+ return { mode: "inherit" };
124
+ if (env === "forward") {
125
+ const def = (chunk) => process.stderr.write(`[devnode] ${chunk.toString("utf8")}`);
126
+ return { mode: "forward", callbacks: { onStdout: def, onStderr: def } };
127
+ }
128
+ return { mode: "quiet-buffered" };
129
+ }
130
+ export class DevnodeManager {
131
+ process = null;
132
+ _endpoint = "";
133
+ _logMode = "quiet-buffered";
134
+ _logging;
135
+ _exitPromise;
136
+ _exitResolve;
137
+ _terminal = false;
138
+ _exitInfo;
139
+ _exitDrainTimer;
140
+ _shutdownInitiated = false;
141
+ _startResolved = false;
142
+ _diagnosticEmitted = false;
143
+ _spawnErrorMessage;
144
+ _provider = "leo";
145
+ _network = "testnet";
146
+ _storagePath;
147
+ _lastStartOptions;
148
+ /** REST API endpoint URL (e.g., "http://127.0.0.1:3030") */
149
+ get endpoint() {
150
+ return this._endpoint;
151
+ }
152
+ /** The resolved backend driving this devnode. */
153
+ get provider() {
154
+ return this._provider;
155
+ }
156
+ /**
157
+ * Whether this devnode can snapshot/restore. Requires the standalone backend
158
+ * AND a configured `storagePath` (in-memory devnodes cannot snapshot).
159
+ */
160
+ get capabilities() {
161
+ return { snapshot: this._provider === "standalone" && this._storagePath !== undefined };
162
+ }
163
+ /** Whether the devnode process is currently running. */
164
+ isRunning() {
165
+ return this.process !== null;
166
+ }
167
+ /** Snapshot of buffered child output. Empty strings for `inherit` mode. */
168
+ getLogTail() {
169
+ return this._logging?.getTail() ?? { stdout: "", stderr: "" };
170
+ }
171
+ /**
172
+ * Resolves with the child's terminal exit info. Resolves on `close` (or a
173
+ * bounded fallback after `exit` if the child never closes), or — if the child
174
+ * fires `error` without ever closing — with `{ code: null, signal: null }`.
175
+ * Throws synchronously if called before `start()`. Idempotent: every call
176
+ * after termination receives the same info.
177
+ */
178
+ waitForExit() {
179
+ if (!this._exitPromise) {
180
+ throw new Error("DevnodeManager has not been started");
181
+ }
182
+ return this._exitPromise;
183
+ }
184
+ /**
185
+ * Start a devnode process with the given options.
186
+ * Waits for the REST API to become healthy before returning.
187
+ */
188
+ async start(options = {}) {
189
+ if (this.isRunning()) {
190
+ throw new Error("Devnode is already running. Call stop() first.");
191
+ }
192
+ this.resetPerProcessState();
193
+ const { mode, callbacks } = resolveLogMode(options);
194
+ this._logMode = mode;
195
+ const socketAddr = options.socketAddr ?? DEFAULT_SOCKET_ADDR;
196
+ const endpoint = `http://${socketAddr}`;
197
+ const provider = options.provider ?? "leo";
198
+ // Standalone is TestnetV0-only with consensus heights compiled in. Reject
199
+ // unsupported inputs here too, so a caller using DevnodeManager directly
200
+ // (bypassing resolveDevnodeBackend) gets a clear error instead of silently
201
+ // querying a testnet devnode or dropping consensus heights.
202
+ if (provider === "standalone") {
203
+ if (options.network !== undefined && options.network !== "testnet") {
204
+ throw new Error(`The standalone aleo-devnode backend only supports the "testnet" network, but ` +
205
+ `network "${options.network}" was requested. Use network: "testnet" or provider: "leo".`);
206
+ }
207
+ if (options.consensusHeights !== undefined) {
208
+ throw new Error(`consensusHeights is not supported on the standalone aleo-devnode backend ` +
209
+ `(consensus heights are compiled in). Remove consensusHeights or use provider: "leo".`);
210
+ }
211
+ if (options.clearStorage === true && options.storagePath === undefined) {
212
+ throw new Error(`clearStorage requires storagePath on the standalone aleo-devnode backend.`);
213
+ }
214
+ }
215
+ const network = provider === "standalone" ? "testnet" : (options.network ?? "testnet");
216
+ const { command, argv } = this.buildSpawn(provider, options);
217
+ const proc = spawn(command, argv, { stdio: stdioConfigForMode(mode) });
218
+ this.process = proc;
219
+ this._logging = setupChildLogging(proc, mode, callbacks);
220
+ proc.once("exit", (code, signal) => {
221
+ this._exitInfo = { code: code ?? null, signal: signal ?? null };
222
+ // `close` normally follows `exit` once stdio drains. Bound the wait so a
223
+ // grandchild holding a pipe open can't hang stop()/waitForExit() forever.
224
+ this._exitDrainTimer = setTimeout(() => {
225
+ if (!this._terminal) {
226
+ this.markTerminal(this._exitInfo.code, this._exitInfo.signal);
227
+ }
228
+ }, EXIT_DRAIN_GRACE_MS);
229
+ this._exitDrainTimer.unref?.();
230
+ });
231
+ proc.once("close", (code, signal) => {
232
+ const exitInfo = this._exitInfo ?? { code: code ?? null, signal: signal ?? null };
233
+ this.markTerminal(exitInfo.code, exitInfo.signal);
234
+ });
235
+ proc.once("error", (err) => {
236
+ const hint = provider === "standalone"
237
+ ? `Ensure the standalone aleo-devnode binary ("${command}") is installed and accessible.`
238
+ : `Ensure the Leo CLI ("${command}") is installed and accessible.`;
239
+ this._spawnErrorMessage = `Failed to start devnode: ${err.message}. ${hint}`;
240
+ if (!this._terminal)
241
+ this.markTerminal(null, null);
242
+ });
243
+ // `earlyExitSignal` resolves (never rejects) when the child reaches its
244
+ // terminal state. Used by the start-time race to detect a pre-health-check
245
+ // death. Designed to never reject so a later exit from a normal `stop()`
246
+ // can't surface as an unhandled rejection.
247
+ const earlyExitSignal = this._exitPromise.then(() => undefined);
248
+ const healthCheck = this.waitForHealthy(endpoint, network);
249
+ try {
250
+ await Promise.race([healthCheck, earlyExitSignal]);
251
+ }
252
+ catch (err) {
253
+ // healthCheck rejected (e.g., timeout).
254
+ await this.stop();
255
+ throw err;
256
+ }
257
+ const exitInfo = this._exitInfo;
258
+ if (exitInfo) {
259
+ if (this._shutdownInitiated) {
260
+ // Caller invoked stop() while start() was still racing. Honor the
261
+ // abort silently — they've already signaled they don't care about
262
+ // start's outcome.
263
+ return;
264
+ }
265
+ if (this._spawnErrorMessage) {
266
+ throw new Error(this._spawnErrorMessage);
267
+ }
268
+ throw new Error(this.renderExitError(exitInfo.code, exitInfo.signal));
269
+ }
270
+ this._startResolved = true;
271
+ this._provider = provider;
272
+ this._storagePath = options.storagePath;
273
+ this._lastStartOptions = options;
274
+ this._network = network;
275
+ this._endpoint = endpoint;
276
+ }
277
+ /**
278
+ * Stop the devnode process gracefully.
279
+ * Sends SIGTERM, then SIGKILL after a timeout. Awaits the terminal exit
280
+ * (resolved on `close`, or a bounded fallback after `exit` if the child never
281
+ * closes) before returning so `markTerminal` is the sole writer of
282
+ * `this.process`.
283
+ */
284
+ async stop() {
285
+ if (!this.process)
286
+ return;
287
+ this._shutdownInitiated = true;
288
+ const proc = this.process;
289
+ const exitP = this._exitPromise;
290
+ const killTimer = setTimeout(() => {
291
+ proc.kill("SIGKILL");
292
+ }, SHUTDOWN_TIMEOUT_MS);
293
+ proc.kill("SIGTERM");
294
+ await exitP;
295
+ clearTimeout(killTimer);
296
+ }
297
+ /** Reset all per-process state so a stop/start cycle is clean. */
298
+ resetPerProcessState() {
299
+ this.clearStartDerivedState();
300
+ this._terminal = false;
301
+ this._exitInfo = undefined;
302
+ clearTimeout(this._exitDrainTimer);
303
+ this._exitDrainTimer = undefined;
304
+ this._shutdownInitiated = false;
305
+ this._startResolved = false;
306
+ this._diagnosticEmitted = false;
307
+ this._spawnErrorMessage = undefined;
308
+ this._logging = undefined;
309
+ this._exitPromise = new Promise((resolve) => {
310
+ this._exitResolve = resolve;
311
+ });
312
+ }
313
+ /** Idempotent: collapse exit/error events into a single terminal state. */
314
+ markTerminal(code, signal) {
315
+ if (this._terminal)
316
+ return;
317
+ this._terminal = true;
318
+ if (this._exitDrainTimer) {
319
+ clearTimeout(this._exitDrainTimer);
320
+ this._exitDrainTimer = undefined;
321
+ }
322
+ this._exitInfo = { code, signal };
323
+ this.process = null;
324
+ this._exitResolve?.({ code, signal });
325
+ if (this._startResolved && !this._shutdownInitiated && !this._diagnosticEmitted) {
326
+ this._diagnosticEmitted = true;
327
+ this.emitUnexpectedExitDiagnostic(code, signal);
328
+ }
329
+ }
330
+ clearStartDerivedState() {
331
+ this._provider = "leo";
332
+ this._storagePath = undefined;
333
+ this._lastStartOptions = undefined;
334
+ this._network = "testnet";
335
+ this._endpoint = "";
336
+ }
337
+ emitUnexpectedExitDiagnostic(code, signal) {
338
+ const exitFormatted = formatExit(code, signal);
339
+ if (this._logMode === "inherit") {
340
+ process.stderr.write(`Devnode exited unexpectedly (${exitFormatted}) — see terminal logs above\n`);
341
+ return;
342
+ }
343
+ const tail = this.getLogTail().stderr.slice(-LOG_TAIL_RENDER_BYTES);
344
+ const suffix = tail.length > 0 ? (tail.endsWith("\n") ? tail : `${tail}\n`) : "";
345
+ process.stderr.write(`Devnode exited unexpectedly (${exitFormatted}):\n${suffix}`);
346
+ }
347
+ renderExitError(code, signal) {
348
+ const exitFormatted = formatExit(code, signal);
349
+ if (this._logMode === "inherit") {
350
+ return `Devnode exited (${exitFormatted}). (logs were inherited to terminal)`;
351
+ }
352
+ const tail = this.getLogTail().stderr.slice(-LOG_TAIL_RENDER_BYTES);
353
+ return tail.length > 0
354
+ ? `Devnode exited (${exitFormatted}).\n${tail}`
355
+ : `Devnode exited (${exitFormatted}).`;
356
+ }
357
+ /** Resolve the binary and argv for the given backend. */
358
+ buildSpawn(provider, options) {
359
+ if (provider === "standalone") {
360
+ return {
361
+ command: options.devnodeBinary ?? DEFAULT_STANDALONE_BINARY,
362
+ argv: ["start", ...this.buildStandaloneArgs(options)],
363
+ };
364
+ }
365
+ return {
366
+ command: options.leoBinary ?? "leo",
367
+ argv: ["--disable-update-check", "devnode", "start", ...this.buildLeoArgs(options)],
368
+ };
369
+ }
370
+ /** Build CLI arguments for `leo devnode start`. */
371
+ buildLeoArgs(options) {
372
+ const args = [];
373
+ const socketAddr = options.socketAddr ?? DEFAULT_SOCKET_ADDR;
374
+ if (socketAddr !== DEFAULT_SOCKET_ADDR) {
375
+ args.push("--socket-addr", socketAddr);
376
+ }
377
+ if (options.autoBlock === false) {
378
+ args.push("--manual-block-creation");
379
+ }
380
+ if (options.verbosity !== undefined && options.verbosity > 0) {
381
+ args.push("--verbosity", String(options.verbosity));
382
+ }
383
+ if (options.genesisPath) {
384
+ args.push("--genesis-path", options.genesisPath);
385
+ }
386
+ // `--network` and `--consensus-heights` were removed from `leo devnode start`
387
+ // in Leo 4.3 (the devnode is TestnetV0-only and auto-activates the latest
388
+ // consensus version, incl. V16/V17). Emitting either on 4.3+ is a hard clap
389
+ // "unexpected argument" error, so gate them to the older 4.1/4.0/3.5 lines.
390
+ const legacyFlags = devnodeEmitsLegacyFlags(options.leoVersion);
391
+ if (legacyFlags && options.network && options.network !== "testnet") {
392
+ args.push("--network", options.network);
393
+ }
394
+ args.push("--private-key", options.privateKey ?? DEFAULT_PRIVATE_KEY);
395
+ if (legacyFlags && options.consensusHeights) {
396
+ args.push("--consensus-heights", options.consensusHeights);
397
+ }
398
+ return args;
399
+ }
400
+ /**
401
+ * Build CLI arguments for `aleo-devnode start`. Unlike the Leo backend,
402
+ * `--verbosity` is always emitted (the standalone CLI defaults to trace=2,
403
+ * while Lionden's default is 0). `--network` / `--consensus-heights` are
404
+ * never passed — they are unsupported on standalone and rejected upstream.
405
+ */
406
+ buildStandaloneArgs(options) {
407
+ const args = [];
408
+ const socketAddr = options.socketAddr ?? DEFAULT_SOCKET_ADDR;
409
+ if (socketAddr !== DEFAULT_SOCKET_ADDR) {
410
+ args.push("--socket-addr", socketAddr);
411
+ }
412
+ if (options.autoBlock === false) {
413
+ args.push("--manual-block-creation");
414
+ }
415
+ args.push("--verbosity", String(options.verbosity ?? 0));
416
+ if (options.genesisPath) {
417
+ args.push("--genesis-path", options.genesisPath);
418
+ }
419
+ args.push("--private-key", options.privateKey ?? DEFAULT_PRIVATE_KEY);
420
+ if (options.storagePath) {
421
+ args.push("--storage", options.storagePath);
422
+ }
423
+ if (options.clearStorage) {
424
+ args.push("--clear-storage");
425
+ }
426
+ return args;
427
+ }
428
+ assertSnapshotCapable(op) {
429
+ if (this._provider !== "standalone") {
430
+ throw new Error(`${op}() requires the standalone aleo-devnode backend (provider: "standalone").`);
431
+ }
432
+ if (this._storagePath === undefined) {
433
+ throw new Error(`${op}() requires persistent storage. Set storagePath (devnode --storage) to enable snapshots.`);
434
+ }
435
+ }
436
+ /**
437
+ * Create a snapshot of the current ledger. Requires the standalone backend
438
+ * with `storagePath` set. Returns the snapshot name and the height it captured.
439
+ */
440
+ async snapshot(name) {
441
+ this.assertSnapshotCapable("snapshot");
442
+ const url = `${this._endpoint}/${this._network}/snapshot`;
443
+ const res = await fetch(url, {
444
+ method: "POST",
445
+ headers: { "content-type": "application/json" },
446
+ // Always send a JSON body — the route uses a `Json` extractor, so an
447
+ // empty/absent body is a deserialization error.
448
+ body: JSON.stringify(name !== undefined ? { name } : {}),
449
+ });
450
+ if (!res.ok) {
451
+ const text = await res.text().catch(() => "");
452
+ throw new Error(`Snapshot failed (HTTP ${res.status}): ${text}`);
453
+ }
454
+ return (await res.json());
455
+ }
456
+ /** List the names of available snapshots. Standalone + storage only. */
457
+ async listSnapshots() {
458
+ this.assertSnapshotCapable("listSnapshots");
459
+ const url = `${this._endpoint}/${this._network}/snapshots`;
460
+ const res = await fetch(url);
461
+ if (!res.ok) {
462
+ const text = await res.text().catch(() => "");
463
+ throw new Error(`listSnapshots failed (HTTP ${res.status}): ${text}`);
464
+ }
465
+ return (await res.json());
466
+ }
467
+ /**
468
+ * Restore the ledger to a previously taken snapshot. This is an offline
469
+ * operation: the running devnode is stopped, `aleo-devnode restore` rewrites
470
+ * the storage dir, then the devnode is restarted with the original start
471
+ * options — except `clearStorage`, which is forced off so the restart can't
472
+ * wipe the ledger the restore just rebuilt. Restores chain state only —
473
+ * callers managing a deployment cache must invalidate it separately.
474
+ */
475
+ async restore(name) {
476
+ const options = this._lastStartOptions;
477
+ if (!options) {
478
+ throw new Error("Cannot restore: devnode was never started.");
479
+ }
480
+ this.assertSnapshotCapable("restore");
481
+ const binary = options.devnodeBinary ?? DEFAULT_STANDALONE_BINARY;
482
+ const storagePath = this._storagePath;
483
+ // Match the key start() used (it defaults to DEFAULT_PRIVATE_KEY) so the
484
+ // restored devnode restarts with the same validator identity.
485
+ const privateKey = options.privateKey ?? DEFAULT_PRIVATE_KEY;
486
+ await this.stop();
487
+ await this.runRestoreCommand(binary, name, storagePath, privateKey);
488
+ // Never clear storage on the post-restore restart — runRestoreCommand just
489
+ // rebuilt the ledger from the snapshot; --clear-storage would wipe it.
490
+ await this.start({ ...options, clearStorage: false });
491
+ }
492
+ runRestoreCommand(binary, name, storagePath, privateKey) {
493
+ return new Promise((resolve, reject) => {
494
+ const env = { ...process.env };
495
+ // Forward the key via env, never argv (keeps it off the process list).
496
+ if (privateKey)
497
+ env["PRIVATE_KEY"] = privateKey;
498
+ const proc = spawn(binary, ["restore", "--snapshot", name, "--storage", storagePath], {
499
+ stdio: ["ignore", "ignore", "pipe"],
500
+ env,
501
+ });
502
+ let stderr = "";
503
+ proc.stderr?.on("data", (chunk) => {
504
+ stderr += chunk.toString("utf8");
505
+ });
506
+ proc.once("error", (err) => {
507
+ reject(new Error(`Failed to run aleo-devnode restore: ${err.message}`));
508
+ });
509
+ proc.once("exit", (code, signal) => {
510
+ if (code === 0) {
511
+ resolve();
512
+ return;
513
+ }
514
+ const tail = stderr.slice(-LOG_TAIL_RENDER_BYTES);
515
+ reject(new Error(`aleo-devnode restore failed (${formatExit(code ?? null, signal ?? null)})` +
516
+ (tail ? `:\n${tail}` : ".")));
517
+ });
518
+ });
519
+ }
520
+ /** Poll the REST API until it responds or timeout. */
521
+ async waitForHealthy(endpoint, network) {
522
+ const url = `${endpoint}/${network}/block/height/latest`;
523
+ const deadline = Date.now() + HEALTH_CHECK_TIMEOUT_MS;
524
+ while (Date.now() < deadline) {
525
+ try {
526
+ const response = await fetch(url, {
527
+ signal: AbortSignal.timeout(2_000),
528
+ });
529
+ if (response.ok)
530
+ return;
531
+ }
532
+ catch {
533
+ // Not ready yet
534
+ }
535
+ await sleep(HEALTH_CHECK_INTERVAL_MS);
536
+ }
537
+ const tail = this.getLogTail().stderr.slice(-LOG_TAIL_RENDER_BYTES);
538
+ const suffix = tail.length > 0 ? `\n${tail}` : "";
539
+ throw new Error(`Devnode health check timed out after ${HEALTH_CHECK_TIMEOUT_MS}ms. ` +
540
+ `Expected REST API at ${url}${suffix}`);
541
+ }
542
+ }
543
+ function sleep(ms) {
544
+ return new Promise((resolve) => setTimeout(resolve, ms));
545
+ }
546
+ //# sourceMappingURL=devnode-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devnode-manager.js","sourceRoot":"","sources":["../src/devnode-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAwC,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGjF,MAAM,yBAAyB,GAAG,cAAc,CAAC;AAEjD,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAC7C,MAAM,mBAAmB,GAAG,6DAA6D,CAAC;AAC1F,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;AAC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MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,CAAC;QACpE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACb,wCAAwC,uBAAuB,MAAM;YACnE,wBAAwB,GAAG,GAAG,MAAM,EAAE,CACzC,CAAC;IACJ,CAAC;CACF;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { AleoNetwork, RuntimeImportRef } from "@lionden/config";
2
+ import { type KeyArtifactsMetadata, type RuntimeKeyCacheDiagnostics, type RuntimeKeyIdentity } from "@lionden/core";
3
+ export interface ProgramExecutionArtifacts {
4
+ readonly source: string;
5
+ readonly sourceOrigin: "artifact" | "network";
6
+ readonly sourceHash: string;
7
+ readonly imports?: Record<string, string>;
8
+ readonly importsHash: string;
9
+ readonly artifactDir?: string;
10
+ readonly sidecar?: KeyArtifactsMetadata;
11
+ }
12
+ export interface RuntimeKeyCacheHit {
13
+ readonly source: "sidecar" | "runtime";
14
+ readonly provingKeyBytes: Uint8Array;
15
+ readonly verifyingKeyBytes: Uint8Array;
16
+ }
17
+ export interface RuntimeKeyCacheWrite {
18
+ readonly identity: RuntimeKeyIdentity;
19
+ readonly provingKeyBytes: Uint8Array;
20
+ readonly verifyingKeyBytes: Uint8Array;
21
+ readonly diagnostics?: RuntimeKeyCacheDiagnostics;
22
+ }
23
+ export declare function resolveProgramExecutionArtifacts(options: {
24
+ artifactsDir?: string;
25
+ programId: string;
26
+ networkClient: {
27
+ getProgram(id: string): Promise<string>;
28
+ };
29
+ includeSidecar?: boolean;
30
+ /**
31
+ * Pre-normalized runtime-import refs. Seeded into the import resolution
32
+ * graph before the static-import walk, so dynamic-dispatch targets and
33
+ * their transitive deps are bundled into the resulting `imports` map.
34
+ */
35
+ runtimeImports?: readonly RuntimeImportRef[];
36
+ }): Promise<ProgramExecutionArtifacts>;
37
+ /**
38
+ * Whether `transition` declares any record-typed input — `{ Record: ... }`
39
+ * (local or external) or the first-class `"DynamicRecord"` — per the program's
40
+ * `abi.json` (a sibling of `main.aleo` in `artifactDir`).
41
+ *
42
+ * Record-consuming transitions need an on-chain inclusion proof. The eager
43
+ * key-synthesis path (`synthesizeKeyPair`) has no query parameter, so it can
44
+ * bypass LionDen's egress-guarded transport. Production execution now skips
45
+ * eager synthesis on every cache miss; this classifier is retained for ABI
46
+ * diagnostics and tests around record-shape recognition.
47
+ *
48
+ * Returns `undefined` when the ABI can't be located, parsed, or trusted to
49
+ * prove the transition is record-free: network-sourced program (no
50
+ * `artifactDir`), missing/garbled `abi.json`, unknown transition, OR any input
51
+ * whose `ty` shape is unrecognized (e.g. a stale/corrupt entry missing `ty`, or
52
+ * a future ABI variant). `false` is returned only when EVERY input is a
53
+ * recognized record-free shape.
54
+ */
55
+ export declare function transitionHasRecordInput(artifacts: ProgramExecutionArtifacts, transition: string): boolean | undefined;
56
+ export declare function findCachedExecutionKeys(options: {
57
+ cachePath: string;
58
+ identity: RuntimeKeyIdentity;
59
+ artifacts?: ProgramExecutionArtifacts;
60
+ }): RuntimeKeyCacheHit | undefined;
61
+ export declare function writeCachedExecutionKeys(write: RuntimeKeyCacheWrite, cachePath: string): void;
62
+ export declare function buildRuntimeKeyIdentity(options: {
63
+ network: AleoNetwork;
64
+ programId: string;
65
+ transition: string;
66
+ edition?: number;
67
+ sourceHash: string;
68
+ importsHash: string;
69
+ wasmHash: string;
70
+ }): RuntimeKeyIdentity;
71
+ //# sourceMappingURL=execution-key-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-key-cache.d.ts","sourceRo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