@aztec/aztec 0.82.2-alpha-testnet.3 → 0.82.2-alpha-testnet.5

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/dest/bin/index.js CHANGED
@@ -10,6 +10,8 @@ import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
10
10
  import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
11
11
  import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
12
  import { Command } from 'commander';
13
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
14
+ import { enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
13
15
  import { injectAztecCommands } from '../cli/index.js';
14
16
  import { getCliVersion } from '../cli/release_version.js';
15
17
  const userLog = createConsoleLogger();
@@ -20,6 +22,17 @@ const debugLogger = createLogger('cli');
20
22
  };
21
23
  process.once('SIGINT', shutdown);
22
24
  process.once('SIGTERM', shutdown);
25
+ // Intercept the setting of a network and enrich the environment with defaults for that network
26
+ let networkValue;
27
+ const args = process.argv.slice(2);
28
+ const networkIndex = args.findIndex((arg)=>arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
29
+ if (networkIndex !== -1) {
30
+ networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
31
+ }
32
+ networkValue = networkValue || process.env.NETWORK;
33
+ if (networkValue !== undefined) {
34
+ await enrichEnvironmentWithChainConfig(networkValue);
35
+ }
23
36
  const cliVersion = getCliVersion();
24
37
  let program = new Command('aztec');
25
38
  program.description('Aztec command line interface').version(cliVersion);
@@ -1 +1 @@
1
- {"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAyGjF"}
1
+ {"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAY3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAsGjF"}
@@ -4,7 +4,6 @@ import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
4
4
  import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
5
5
  import { createSandbox } from '../sandbox/index.js';
6
6
  import { github, splash } from '../splash.js';
7
- import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
8
7
  import { getCliVersion } from './release_version.js';
9
8
  import { extractNamespacedOptions, installSignalHandlers } from './util.js';
10
9
  import { getVersions } from './versioning.js';
@@ -18,6 +17,7 @@ export async function aztecStart(options, userLog, debugLogger) {
18
17
  const cliVersion = getCliVersion();
19
18
  const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
20
19
  const nodeOptions = extractNamespacedOptions(options, 'node');
20
+ sandboxOptions.testAccounts = true;
21
21
  userLog(`${splash}\n${github}\n\n`);
22
22
  userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
23
23
  const { node, pxe, stop } = await createSandbox({
@@ -43,10 +43,6 @@ export async function aztecStart(options, userLog, debugLogger) {
43
43
  userLog(`Not exposing PXE API through JSON-RPC server`);
44
44
  }
45
45
  } else {
46
- // If a network is specified, enrich the environment with the chain config
47
- if (options.network) {
48
- await enrichEnvironmentWithChainConfig(options.network);
49
- }
50
46
  if (options.node) {
51
47
  const { startNode } = await import('./cmds/start_node.js');
52
48
  ({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
@@ -9,6 +9,7 @@ export interface AztecStartOption {
9
9
  }
10
10
  export declare const getOptions: (namespace: string, configMappings: Record<string, ConfigMapping>) => AztecStartOption[];
11
11
  export declare const universalOptions: string[];
12
+ export declare const NETWORK_FLAG = "network";
12
13
  export declare const aztecStartOptions: {
13
14
  [key: string]: AztecStartOption[];
14
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EAIZ,MAAM,0BAA0B,CAAC;AAelC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,cAAe,MAAM,kBAAkB,OAAO,MAAM,EAAE,aAAa,CAAC,uBAiB1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAU5B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CA4VlE,CAAC"}
1
+ {"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EAIZ,MAAM,0BAA0B,CAAC;AAelC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,cAAe,MAAM,kBAAkB,OAAO,MAAM,EAAE,aAAa,CAAC,uBAiB1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAU5B,CAAC;AAEF,eAAO,MAAM,YAAY,YAAY,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAgVlE,CAAC"}
@@ -40,11 +40,12 @@ export const universalOptions = [
40
40
  'dataDirectory',
41
41
  'dataStoreMapSizeKb'
42
42
  ];
43
+ export const NETWORK_FLAG = 'network';
43
44
  // Define categories and options
44
45
  export const aztecStartOptions = {
45
46
  NETWORK: [
46
47
  {
47
- flag: '--network <value>',
48
+ flag: `--${NETWORK_FLAG} <value>`,
48
49
  description: 'Network to run Aztec on',
49
50
  defaultValue: undefined,
50
51
  envVar: 'NETWORK'
@@ -57,12 +58,6 @@ export const aztecStartOptions = {
57
58
  defaultValue: undefined,
58
59
  envVar: undefined
59
60
  },
60
- {
61
- flag: '--sandbox.testAccounts',
62
- description: 'Deploy test accounts on sandbox start',
63
- envVar: 'TEST_ACCOUNTS',
64
- ...booleanConfigHelper(true)
65
- },
66
61
  {
67
62
  flag: '--sandbox.noPXE',
68
63
  description: 'Do not expose PXE service on sandbox start',
@@ -239,12 +234,6 @@ export const aztecStartOptions = {
239
234
  defaultValue: 100,
240
235
  envVar: 'WS_BLOCK_CHECK_INTERVAL_MS',
241
236
  parseVal: (val)=>parseInt(val, 10)
242
- },
243
- {
244
- flag: '--node.testAccounts',
245
- description: 'Populate genesis state with initial fee juice for test accounts',
246
- envVar: 'TEST_ACCOUNTS',
247
- ...booleanConfigHelper()
248
237
  }
249
238
  ],
250
239
  'P2P SUBSYSTEM': [
@@ -1 +1 @@
1
- {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAgB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAgBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAUD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAsB/E"}
1
+ {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAgB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAgBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAmBD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAuB/E"}
@@ -1,3 +1,4 @@
1
+ import { EthAddress } from '@aztec/aztec.js';
1
2
  import path from 'path';
2
3
  export const testnetIgnitionL2ChainConfig = {
3
4
  l1ChainId: 11155111,
@@ -22,12 +23,12 @@ export const alphaTestnetL2ChainConfig = {
22
23
  aztecSlotDuration: 36,
23
24
  aztecEpochDuration: 32,
24
25
  aztecProofSubmissionWindow: 64,
25
- testAccounts: true,
26
+ testAccounts: false,
26
27
  sponsoredFPC: true,
27
28
  p2pEnabled: true,
28
29
  p2pBootstrapNodes: [],
29
30
  registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
30
- slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8',
31
+ slashFactoryAddress: '',
31
32
  feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
32
33
  seqMinTxsPerBlock: 0,
33
34
  seqMaxTxsPerBlock: 4,
@@ -65,6 +66,14 @@ function enrichVar(envVar, value) {
65
66
  }
66
67
  process.env[envVar] = value;
67
68
  }
69
+ function enrichEthAddressVar(envVar, value) {
70
+ // EthAddress doesn't like being given empty strings
71
+ if (value === '') {
72
+ enrichVar(envVar, EthAddress.ZERO.toString());
73
+ return;
74
+ }
75
+ enrichVar(envVar, value);
76
+ }
68
77
  export async function enrichEnvironmentWithChainConfig(networkName) {
69
78
  const config = await getL2ChainConfig(networkName);
70
79
  if (!config) {
@@ -79,12 +88,12 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
79
88
  enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
80
89
  enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
81
90
  enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
82
- enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
83
- enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
84
- enrichVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
85
91
  enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
86
92
  enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
87
93
  enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
88
94
  enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
89
95
  enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
96
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
97
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
98
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
90
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/aztec",
3
- "version": "0.82.2-alpha-testnet.3",
3
+ "version": "0.82.2-alpha-testnet.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js"
@@ -29,35 +29,35 @@
29
29
  "../package.common.json"
30
30
  ],
31
31
  "dependencies": {
32
- "@aztec/accounts": "0.82.2-alpha-testnet.3",
33
- "@aztec/archiver": "0.82.2-alpha-testnet.3",
34
- "@aztec/aztec-faucet": "0.82.2-alpha-testnet.3",
35
- "@aztec/aztec-node": "0.82.2-alpha-testnet.3",
36
- "@aztec/aztec.js": "0.82.2-alpha-testnet.3",
37
- "@aztec/bb-prover": "0.82.2-alpha-testnet.3",
38
- "@aztec/bb.js": "0.82.2-alpha-testnet.3",
39
- "@aztec/blob-sink": "0.82.2-alpha-testnet.3",
40
- "@aztec/bot": "0.82.2-alpha-testnet.3",
41
- "@aztec/builder": "0.82.2-alpha-testnet.3",
42
- "@aztec/cli": "0.82.2-alpha-testnet.3",
43
- "@aztec/cli-wallet": "0.82.2-alpha-testnet.3",
44
- "@aztec/constants": "0.82.2-alpha-testnet.3",
45
- "@aztec/entrypoints": "0.82.2-alpha-testnet.3",
46
- "@aztec/ethereum": "0.82.2-alpha-testnet.3",
47
- "@aztec/foundation": "0.82.2-alpha-testnet.3",
48
- "@aztec/kv-store": "0.82.2-alpha-testnet.3",
49
- "@aztec/noir-contracts.js": "0.82.2-alpha-testnet.3",
50
- "@aztec/noir-protocol-circuits-types": "0.82.2-alpha-testnet.3",
51
- "@aztec/p2p": "0.82.2-alpha-testnet.3",
52
- "@aztec/p2p-bootstrap": "0.82.2-alpha-testnet.3",
53
- "@aztec/protocol-contracts": "0.82.2-alpha-testnet.3",
54
- "@aztec/prover-client": "0.82.2-alpha-testnet.3",
55
- "@aztec/prover-node": "0.82.2-alpha-testnet.3",
56
- "@aztec/pxe": "0.82.2-alpha-testnet.3",
57
- "@aztec/stdlib": "0.82.2-alpha-testnet.3",
58
- "@aztec/telemetry-client": "0.82.2-alpha-testnet.3",
59
- "@aztec/txe": "0.82.2-alpha-testnet.3",
60
- "@aztec/world-state": "0.82.2-alpha-testnet.3",
32
+ "@aztec/accounts": "0.82.2-alpha-testnet.5",
33
+ "@aztec/archiver": "0.82.2-alpha-testnet.5",
34
+ "@aztec/aztec-faucet": "0.82.2-alpha-testnet.5",
35
+ "@aztec/aztec-node": "0.82.2-alpha-testnet.5",
36
+ "@aztec/aztec.js": "0.82.2-alpha-testnet.5",
37
+ "@aztec/bb-prover": "0.82.2-alpha-testnet.5",
38
+ "@aztec/bb.js": "0.82.2-alpha-testnet.5",
39
+ "@aztec/blob-sink": "0.82.2-alpha-testnet.5",
40
+ "@aztec/bot": "0.82.2-alpha-testnet.5",
41
+ "@aztec/builder": "0.82.2-alpha-testnet.5",
42
+ "@aztec/cli": "0.82.2-alpha-testnet.5",
43
+ "@aztec/cli-wallet": "0.82.2-alpha-testnet.5",
44
+ "@aztec/constants": "0.82.2-alpha-testnet.5",
45
+ "@aztec/entrypoints": "0.82.2-alpha-testnet.5",
46
+ "@aztec/ethereum": "0.82.2-alpha-testnet.5",
47
+ "@aztec/foundation": "0.82.2-alpha-testnet.5",
48
+ "@aztec/kv-store": "0.82.2-alpha-testnet.5",
49
+ "@aztec/noir-contracts.js": "0.82.2-alpha-testnet.5",
50
+ "@aztec/noir-protocol-circuits-types": "0.82.2-alpha-testnet.5",
51
+ "@aztec/p2p": "0.82.2-alpha-testnet.5",
52
+ "@aztec/p2p-bootstrap": "0.82.2-alpha-testnet.5",
53
+ "@aztec/protocol-contracts": "0.82.2-alpha-testnet.5",
54
+ "@aztec/prover-client": "0.82.2-alpha-testnet.5",
55
+ "@aztec/prover-node": "0.82.2-alpha-testnet.5",
56
+ "@aztec/pxe": "0.82.2-alpha-testnet.5",
57
+ "@aztec/stdlib": "0.82.2-alpha-testnet.5",
58
+ "@aztec/telemetry-client": "0.82.2-alpha-testnet.5",
59
+ "@aztec/txe": "0.82.2-alpha-testnet.5",
60
+ "@aztec/world-state": "0.82.2-alpha-testnet.5",
61
61
  "@types/chalk": "^2.2.0",
62
62
  "abitype": "^0.8.11",
63
63
  "chalk": "^5.3.0",
package/src/bin/index.ts CHANGED
@@ -12,6 +12,8 @@ import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
12
 
13
13
  import { Command } from 'commander';
14
14
 
15
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
16
+ import { type NetworkNames, enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
15
17
  import { injectAztecCommands } from '../cli/index.js';
16
18
  import { getCliVersion } from '../cli/release_version.js';
17
19
 
@@ -26,6 +28,22 @@ async function main() {
26
28
  process.once('SIGINT', shutdown);
27
29
  process.once('SIGTERM', shutdown);
28
30
 
31
+ // Intercept the setting of a network and enrich the environment with defaults for that network
32
+ let networkValue: string | undefined;
33
+
34
+ const args = process.argv.slice(2);
35
+ const networkIndex = args.findIndex(arg => arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
36
+
37
+ if (networkIndex !== -1) {
38
+ networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
39
+ }
40
+
41
+ networkValue = networkValue || process.env.NETWORK;
42
+
43
+ if (networkValue !== undefined) {
44
+ await enrichEnvironmentWithChainConfig(networkValue as NetworkNames);
45
+ }
46
+
29
47
  const cliVersion = getCliVersion();
30
48
  let program = new Command('aztec');
31
49
  program.description('Aztec command line interface').version(cliVersion);
@@ -11,7 +11,6 @@ import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
11
11
 
12
12
  import { createSandbox } from '../sandbox/index.js';
13
13
  import { github, splash } from '../splash.js';
14
- import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
15
14
  import { getCliVersion } from './release_version.js';
16
15
  import { extractNamespacedOptions, installSignalHandlers } from './util.js';
17
16
  import { getVersions } from './versioning.js';
@@ -27,6 +26,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
27
26
  const cliVersion = getCliVersion();
28
27
  const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
29
28
  const nodeOptions = extractNamespacedOptions(options, 'node');
29
+ sandboxOptions.testAccounts = true;
30
30
  userLog(`${splash}\n${github}\n\n`);
31
31
  userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
32
32
 
@@ -51,10 +51,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
51
51
  userLog(`Not exposing PXE API through JSON-RPC server`);
52
52
  }
53
53
  } else {
54
- // If a network is specified, enrich the environment with the chain config
55
- if (options.network) {
56
- await enrichEnvironmentWithChainConfig(options.network);
57
- }
58
54
  if (options.node) {
59
55
  const { startNode } = await import('./cmds/start_node.js');
60
56
  ({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
@@ -65,11 +65,13 @@ export const universalOptions = [
65
65
  'dataStoreMapSizeKb',
66
66
  ];
67
67
 
68
+ export const NETWORK_FLAG = 'network';
69
+
68
70
  // Define categories and options
69
71
  export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
70
72
  NETWORK: [
71
73
  {
72
- flag: '--network <value>',
74
+ flag: `--${NETWORK_FLAG} <value>`,
73
75
  description: 'Network to run Aztec on',
74
76
  defaultValue: undefined,
75
77
  envVar: 'NETWORK',
@@ -82,12 +84,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
82
84
  defaultValue: undefined,
83
85
  envVar: undefined,
84
86
  },
85
- {
86
- flag: '--sandbox.testAccounts',
87
- description: 'Deploy test accounts on sandbox start',
88
- envVar: 'TEST_ACCOUNTS',
89
- ...booleanConfigHelper(true),
90
- },
91
87
  {
92
88
  flag: '--sandbox.noPXE',
93
89
  description: 'Do not expose PXE service on sandbox start',
@@ -267,12 +263,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
267
263
  envVar: 'WS_BLOCK_CHECK_INTERVAL_MS',
268
264
  parseVal: val => parseInt(val, 10),
269
265
  },
270
- {
271
- flag: '--node.testAccounts',
272
- description: 'Populate genesis state with initial fee juice for test accounts',
273
- envVar: 'TEST_ACCOUNTS',
274
- ...booleanConfigHelper(),
275
- },
276
266
  ],
277
267
  'P2P SUBSYSTEM': [
278
268
  {
@@ -1,3 +1,4 @@
1
+ import { EthAddress } from '@aztec/aztec.js';
1
2
  import type { EnvVar } from '@aztec/foundation/config';
2
3
 
3
4
  import path from 'path';
@@ -46,12 +47,12 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
46
47
  aztecSlotDuration: 36,
47
48
  aztecEpochDuration: 32,
48
49
  aztecProofSubmissionWindow: 64,
49
- testAccounts: true,
50
+ testAccounts: false,
50
51
  sponsoredFPC: true,
51
52
  p2pEnabled: true,
52
53
  p2pBootstrapNodes: [],
53
54
  registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
54
- slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8',
55
+ slashFactoryAddress: '',
55
56
  feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
56
57
  seqMinTxsPerBlock: 0,
57
58
  seqMaxTxsPerBlock: 4,
@@ -92,6 +93,15 @@ function enrichVar(envVar: EnvVar, value: string) {
92
93
  process.env[envVar] = value;
93
94
  }
94
95
 
96
+ function enrichEthAddressVar(envVar: EnvVar, value: string) {
97
+ // EthAddress doesn't like being given empty strings
98
+ if (value === '') {
99
+ enrichVar(envVar, EthAddress.ZERO.toString());
100
+ return;
101
+ }
102
+ enrichVar(envVar, value);
103
+ }
104
+
95
105
  export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
96
106
  const config = await getL2ChainConfig(networkName);
97
107
  if (!config) {
@@ -106,12 +116,13 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
106
116
  enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
107
117
  enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
108
118
  enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
109
- enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
110
- enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
111
- enrichVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
112
119
  enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
113
120
  enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
114
121
  enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
115
122
  enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
116
123
  enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
124
+
125
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
126
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
127
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
117
128
  }