diff --git a/yarn-project/cli-wallet/src/bin/index.ts b/yarn-project/cli-wallet/src/bin/index.ts index 6b00de351690..9579904727e4 100644 --- a/yarn-project/cli-wallet/src/bin/index.ts +++ b/yarn-project/cli-wallet/src/bin/index.ts @@ -2,6 +2,7 @@ import { Fr, computeSecretHash, fileURLToPath } from '@aztec/aztec.js'; import { LOCALHOST } from '@aztec/cli/cli-utils'; import { type LogFn, createConsoleLogger, createLogger } from '@aztec/foundation/log'; import { openStoreAt } from '@aztec/kv-store/lmdb-v2'; +import type { PXEServiceConfig } from '@aztec/pxe/config'; import { Argument, Command, Option } from 'commander'; import { mkdirSync, readFileSync } from 'fs'; @@ -94,18 +95,22 @@ async function main() { if (!remotePxe) { debugLogger.info('Using local PXE service'); + const proverEnabled = prover !== 'none'; + const bbBinaryPath = prover === 'native' ? resolve(dirname(fileURLToPath(import.meta.url)), '../../../../barretenberg/cpp/build/bin/bb') : undefined; const bbWorkingDirectory = dataDir + '/bb'; - const proverEnabled = prover !== 'none'; - mkdirSync(bbWorkingDirectory, { recursive: true }); - await pxeWrapper.init(nodeUrl, join(dataDir, 'pxe'), { - ...(proverEnabled && { proverEnabled, bbBinaryPath, bbWorkingDirectory }), // only override if we're profiling - }); + const overridePXEConfig: Partial = { + proverEnabled, + bbBinaryPath: prover === 'native' ? bbBinaryPath : undefined, + bbWorkingDirectory: prover === 'native' ? bbWorkingDirectory : undefined, + }; + + await pxeWrapper.init(nodeUrl, join(dataDir, 'pxe'), overridePXEConfig); } await db.init(await openStoreAt(dataDir)); });