diff --git a/aztec-up/bin/aztec-wallet b/aztec-up/bin/aztec-wallet index 675b8bfeda6..998e51157c1 100755 --- a/aztec-up/bin/aztec-wallet +++ b/aztec-up/bin/aztec-wallet @@ -3,8 +3,11 @@ set -euo pipefail export SKIP_PORT_ASSIGNMENT=1 export WALLET_DATA_DIRECTORY=$(dirname $0)/wallet-data -export ENV_VARS_TO_INJECT="WALLET_DATA_DIRECTORY SSH_AUTH_SOCK" +export BB_WORKING_DIRECTORY=$(dirname $0)/bb-workdir +export BB_BINARY_PATH=$(which bb) +export ENV_VARS_TO_INJECT="WALLET_DATA_DIRECTORY SSH_AUTH_SOCK PXE_PROVER_ENABLED BB_BINARY_PATH BB_WORKING_DIRECTORY" +mkdir -p $BB_WORKING_DIRECTORY mkdir -p $WALLET_DATA_DIRECTORY $(dirname $0)/.aztec-run aztecprotocol/cli-wallet $@ \ No newline at end of file diff --git a/yarn-project/cli-wallet/src/bin/index.ts b/yarn-project/cli-wallet/src/bin/index.ts index 1147134a56f..cda770c1ae3 100644 --- a/yarn-project/cli-wallet/src/bin/index.ts +++ b/yarn-project/cli-wallet/src/bin/index.ts @@ -86,11 +86,28 @@ async function main() { .env('AZTEC_NODE_URL') .default(`http://${LOCALHOST}:8080`), ) + .addOption( + new Option('-b, --bb-binary-path ', 'Path to the BB binary') + .env('BB_BINARY_PATH') + .default(`$HOME/.bb/bb`), + ) + .addOption( + new Option('-w, --bb-working-directory ', 'Path to the BB working directory') + .env('BB_WORKING_DIRECTORY') + .default(`$HOME/.bb-workdir`), + ) .hook('preSubcommand', async command => { const { dataDir, remotePxe, nodeUrl } = command.optsWithGlobals(); + if (!remotePxe) { debugLogger.info('Using local PXE service'); - await pxeWrapper.init(nodeUrl, join(dataDir, 'pxe')); + const subcommand = command.args[0]; + const isProfiling = command.args.includes('--profile'); + const enableProving = subcommand === 'simulate' && isProfiling; + + await pxeWrapper.init(nodeUrl, join(dataDir, 'pxe'), { + proverEnabled: enableProving, + }); } db.init(AztecLmdbStore.open(dataDir)); }); diff --git a/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts b/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts index 4fcf026373a..f0621737fb7 100644 --- a/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts +++ b/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts @@ -1,5 +1,5 @@ import { type PXE, createAztecNodeClient } from '@aztec/circuit-types'; -import { createPXEService, getPXEServiceConfig } from '@aztec/pxe'; +import { type PXEServiceConfig, createPXEService, getPXEServiceConfig } from '@aztec/pxe'; /* * Wrapper class for PXE service, avoids initialization issues due to @@ -12,9 +12,9 @@ export class PXEWrapper { return PXEWrapper.pxe; } - async init(nodeUrl: string, dataDir: string) { + async init(nodeUrl: string, dataDir: string, overridePXEServiceConfig?: Partial) { const aztecNode = createAztecNodeClient(nodeUrl); - const pxeConfig = getPXEServiceConfig(); + const pxeConfig = Object.assign(getPXEServiceConfig(), overridePXEServiceConfig); pxeConfig.dataDirectory = dataDir; PXEWrapper.pxe = await createPXEService(aztecNode, pxeConfig); }