From 3d48de95cc24e4030a0e1f094f62bebf4d1bc9ad Mon Sep 17 00:00:00 2001 From: Rahul Kothari Date: Mon, 23 Dec 2024 12:21:33 +0000 Subject: [PATCH] add version number when starting sandbox --- yarn-project/aztec/src/cli/aztec_start_action.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/yarn-project/aztec/src/cli/aztec_start_action.ts b/yarn-project/aztec/src/cli/aztec_start_action.ts index 983afecf019..0e45a891463 100644 --- a/yarn-project/aztec/src/cli/aztec_start_action.ts +++ b/yarn-project/aztec/src/cli/aztec_start_action.ts @@ -6,11 +6,18 @@ import { startHttpRpcServer, } from '@aztec/foundation/json-rpc/server'; import { type LogFn, type Logger } from '@aztec/foundation/log'; +import { fileURLToPath } from '@aztec/foundation/url'; + +import { readFileSync } from 'fs'; +import { dirname, resolve } from 'path'; import { createSandbox } from '../sandbox.js'; import { github, splash } from '../splash.js'; import { createAccountLogs, extractNamespacedOptions, installSignalHandlers } from './util.js'; +const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json'); +const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version; + export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logger) { // list of 'stop' functions to call when process ends const signalHandlers: Array<() => Promise> = []; @@ -19,7 +26,8 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg if (options.sandbox) { const sandboxOptions = extractNamespacedOptions(options, 'sandbox'); userLog(`${splash}\n${github}\n\n`); - userLog(`Setting up Aztec Sandbox, please stand by...`); + userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`); + const { aztecNodeConfig, node, pxe, stop } = await createSandbox({ enableGas: sandboxOptions.enableGas, l1Mnemonic: options.l1Mnemonic,