@aztec/aztec 0.0.1-commit.b655e406 → 0.0.1-commit.c7c42ec

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 (95) hide show
  1. package/README.md +1 -1
  2. package/dest/bin/index.d.ts +1 -1
  3. package/dest/bin/index.js +4 -3
  4. package/dest/cli/aztec_start_action.d.ts +1 -1
  5. package/dest/cli/aztec_start_action.d.ts.map +1 -1
  6. package/dest/cli/aztec_start_action.js +8 -12
  7. package/dest/cli/aztec_start_options.d.ts +1 -1
  8. package/dest/cli/aztec_start_options.d.ts.map +1 -1
  9. package/dest/cli/aztec_start_options.js +19 -30
  10. package/dest/cli/cli.d.ts +1 -1
  11. package/dest/cli/cli.d.ts.map +1 -1
  12. package/dest/cli/cli.js +46 -1
  13. package/dest/cli/cmds/start_archiver.d.ts +1 -1
  14. package/dest/cli/cmds/start_archiver.js +6 -6
  15. package/dest/cli/cmds/start_bot.d.ts +1 -1
  16. package/dest/cli/cmds/start_bot.js +1 -1
  17. package/dest/cli/cmds/start_node.d.ts +1 -1
  18. package/dest/cli/cmds/start_node.js +4 -4
  19. package/dest/cli/cmds/start_p2p_bootstrap.d.ts +1 -1
  20. package/dest/cli/cmds/start_p2p_bootstrap.js +1 -1
  21. package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
  22. package/dest/cli/cmds/start_prover_agent.js +1 -1
  23. package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
  24. package/dest/cli/cmds/start_prover_broker.js +2 -2
  25. package/dest/cli/cmds/start_prover_node.d.ts +1 -1
  26. package/dest/cli/cmds/start_prover_node.js +2 -2
  27. package/dest/cli/cmds/start_txe.d.ts +1 -1
  28. package/dest/cli/index.d.ts +1 -1
  29. package/dest/cli/preload_crs.d.ts +1 -1
  30. package/dest/cli/release_version.d.ts +1 -1
  31. package/dest/cli/util.d.ts +8 -8
  32. package/dest/cli/util.d.ts.map +1 -1
  33. package/dest/cli/util.js +2 -2
  34. package/dest/cli/versioning.d.ts +1 -1
  35. package/dest/examples/token.d.ts +1 -1
  36. package/dest/examples/token.js +1 -1
  37. package/dest/examples/util.d.ts +2 -2
  38. package/dest/examples/util.d.ts.map +1 -1
  39. package/dest/index.d.ts +2 -2
  40. package/dest/index.d.ts.map +1 -1
  41. package/dest/index.js +1 -1
  42. package/dest/local-network/banana_fpc.d.ts +10 -0
  43. package/dest/local-network/banana_fpc.d.ts.map +1 -0
  44. package/dest/{sandbox → local-network}/banana_fpc.js +1 -1
  45. package/dest/local-network/index.d.ts +4 -0
  46. package/dest/local-network/index.d.ts.map +1 -0
  47. package/dest/{sandbox → local-network}/index.js +1 -1
  48. package/dest/local-network/local-network.d.ts +72 -0
  49. package/dest/local-network/local-network.d.ts.map +1 -0
  50. package/dest/{sandbox/sandbox.js → local-network/local-network.js} +25 -26
  51. package/dest/local-network/sponsored_fpc.d.ts +5 -0
  52. package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
  53. package/dest/mnemonic.d.ts +1 -1
  54. package/dest/splash.d.ts +1 -1
  55. package/dest/testing/anvil_test_watcher.d.ts +4 -4
  56. package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
  57. package/dest/testing/anvil_test_watcher.js +16 -14
  58. package/dest/testing/cheat_codes.d.ts +1 -3
  59. package/dest/testing/cheat_codes.d.ts.map +1 -1
  60. package/dest/testing/index.d.ts +1 -1
  61. package/package.json +38 -36
  62. package/src/bin/index.ts +5 -3
  63. package/src/cli/aztec_start_action.ts +8 -12
  64. package/src/cli/aztec_start_options.ts +19 -30
  65. package/src/cli/cli.ts +46 -1
  66. package/src/cli/cmds/start_archiver.ts +6 -6
  67. package/src/cli/cmds/start_bot.ts +1 -1
  68. package/src/cli/cmds/start_node.ts +4 -4
  69. package/src/cli/cmds/start_p2p_bootstrap.ts +1 -1
  70. package/src/cli/cmds/start_prover_agent.ts +1 -1
  71. package/src/cli/cmds/start_prover_broker.ts +2 -2
  72. package/src/cli/cmds/start_prover_node.ts +2 -2
  73. package/src/cli/util.ts +6 -6
  74. package/src/examples/token.ts +1 -1
  75. package/src/examples/util.ts +1 -1
  76. package/src/index.ts +2 -2
  77. package/src/{sandbox → local-network}/banana_fpc.ts +1 -1
  78. package/src/{sandbox → local-network}/index.ts +1 -1
  79. package/src/{sandbox/sandbox.ts → local-network/local-network.ts} +49 -69
  80. package/src/{sandbox → local-network}/sponsored_fpc.ts +3 -2
  81. package/src/testing/anvil_test_watcher.ts +16 -14
  82. package/src/testing/cheat_codes.ts +3 -2
  83. package/dest/cli/cmds/start_blob_sink.d.ts +0 -3
  84. package/dest/cli/cmds/start_blob_sink.d.ts.map +0 -1
  85. package/dest/cli/cmds/start_blob_sink.js +0 -33
  86. package/dest/sandbox/banana_fpc.d.ts +0 -10
  87. package/dest/sandbox/banana_fpc.d.ts.map +0 -1
  88. package/dest/sandbox/index.d.ts +0 -4
  89. package/dest/sandbox/index.d.ts.map +0 -1
  90. package/dest/sandbox/sandbox.d.ts +0 -74
  91. package/dest/sandbox/sandbox.d.ts.map +0 -1
  92. package/dest/sandbox/sponsored_fpc.d.ts +0 -4
  93. package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
  94. package/src/cli/cmds/start_blob_sink.ts +0 -57
  95. /package/dest/{sandbox → local-network}/sponsored_fpc.js +0 -0
@@ -9,7 +9,7 @@ import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
9
9
  import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
10
10
  import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
11
11
 
12
- import { createSandbox } from '../sandbox/index.js';
12
+ import { createLocalNetwork } from '../local-network/index.js';
13
13
  import { github, splash } from '../splash.js';
14
14
  import { getCliVersion } from './release_version.js';
15
15
  import { extractNamespacedOptions, installSignalHandlers } from './util.js';
@@ -22,19 +22,18 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
22
22
  const adminServices: NamespacedApiHandlers = {};
23
23
  let config: ChainConfig | undefined = undefined;
24
24
 
25
- if (options.sandbox) {
25
+ if (options.localNetwork) {
26
26
  const cliVersion = getCliVersion();
27
- const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
28
- sandboxOptions.testAccounts = true;
27
+ const localNetwork = extractNamespacedOptions(options, 'local-network');
28
+ localNetwork.testAccounts = true;
29
29
  userLog(`${splash}\n${github}\n\n`);
30
- userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
30
+ userLog(`Setting up Aztec local network ${cliVersion}, please stand by...`);
31
31
 
32
- const { node, stop } = await createSandbox(
32
+ const { node, stop } = await createLocalNetwork(
33
33
  {
34
- l1Mnemonic: sandboxOptions.l1Mnemonic,
34
+ l1Mnemonic: localNetwork.l1Mnemonic,
35
35
  l1RpcUrls: options.l1RpcUrls,
36
- deployAztecContractsSalt: sandboxOptions.deployAztecContractsSalt,
37
- testAccounts: sandboxOptions.testAccounts,
36
+ testAccounts: localNetwork.testAccounts,
38
37
  realProofs: false,
39
38
  },
40
39
  userLog,
@@ -53,9 +52,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
53
52
  } else if (options.proverNode) {
54
53
  const { startProverNode } = await import('./cmds/start_prover_node.js');
55
54
  ({ config } = await startProverNode(options, signalHandlers, services, userLog));
56
- } else if (options.blobSink) {
57
- const { startBlobSink } = await import('./cmds/start_blob_sink.js');
58
- await startBlobSink(options, signalHandlers, userLog);
59
55
  } else if (options.archiver) {
60
56
  const { startArchiver } = await import('./cmds/start_archiver.js');
61
57
  ({ config } = await startArchiver(options, signalHandlers, services));
@@ -1,8 +1,9 @@
1
1
  import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
2
- import { sequencerClientConfigMappings } from '@aztec/aztec-node/config';
3
- import { blobSinkConfigMappings } from '@aztec/blob-sink/server';
2
+ import { blobClientConfigMapping } from '@aztec/blob-client/client/config';
4
3
  import { botConfigMappings } from '@aztec/bot/config';
5
- import { l1ContractAddressesMapping, l1ContractsConfigMappings, l1ReaderConfigMappings } from '@aztec/ethereum';
4
+ import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
5
+ import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
6
+ import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
6
7
  import { getKeys } from '@aztec/foundation/collection';
7
8
  import {
8
9
  type ConfigMapping,
@@ -14,12 +15,13 @@ import {
14
15
  import { dataConfigMappings } from '@aztec/kv-store/config';
15
16
  import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
16
17
  import { bootnodeConfigMappings, p2pConfigMappings } from '@aztec/p2p/config';
17
- import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
18
+ import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker/config';
18
19
  import { proverNodeConfigMappings } from '@aztec/prover-node/config';
19
20
  import { allPxeConfigMappings } from '@aztec/pxe/config';
21
+ import { sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
20
22
  import { chainConfigMappings } from '@aztec/stdlib/config';
21
- import { telemetryClientConfigMappings } from '@aztec/telemetry-client';
22
- import { worldStateConfigMappings } from '@aztec/world-state';
23
+ import { telemetryClientConfigMappings } from '@aztec/telemetry-client/config';
24
+ import { worldStateConfigMappings } from '@aztec/world-state/config';
23
25
 
24
26
  import { DefaultMnemonic } from '../mnemonic.js';
25
27
 
@@ -82,6 +84,7 @@ export const universalOptions = [
82
84
  'l1ConsensusHostApiKeys',
83
85
  'l1ConsensusHostApiKeyHeaders',
84
86
  'p2pEnabled',
87
+ 'fishermanMode',
85
88
  ...getKeys(chainConfigMappings),
86
89
  ...getKeys(l1ContractsConfigMappings),
87
90
  ...getKeys(l1ContractAddressesMapping),
@@ -107,28 +110,22 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
107
110
 
108
111
  configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
109
112
  configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
113
+
114
+ configToFlag('--fisherman-mode', sharedNodeConfigMappings.fishermanMode),
110
115
  ],
111
- SANDBOX: [
116
+ LOCAL_NETWORK: [
112
117
  {
113
- flag: '--sandbox',
114
- description: 'Starts Aztec Sandbox',
118
+ flag: '--local-network',
119
+ description: 'Starts Aztec Local Network',
115
120
  defaultValue: undefined,
116
121
  env: undefined,
117
122
  },
118
123
  {
119
- flag: '--sandbox.l1Mnemonic <value>',
124
+ flag: '--local-network.l1Mnemonic <value>',
120
125
  description: 'Mnemonic for L1 accounts. Will be used ',
121
126
  defaultValue: DefaultMnemonic,
122
127
  env: 'MNEMONIC',
123
128
  },
124
- {
125
- flag: '--sandbox.deployAztecContractsSalt <value>',
126
- description:
127
- 'Numeric salt for deploying L1 Aztec contracts before starting the sandbox. Needs mnemonic or private key to be set.',
128
- env: 'DEPLOY_AZTEC_CONTRACTS_SALT',
129
- defaultValue: undefined,
130
- parseVal: (val: string) => (val ? parseInt(val) : undefined),
131
- },
132
129
  ],
133
130
  API: [
134
131
  {
@@ -156,9 +153,9 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
156
153
  configToFlag('--l1-chain-id', l1ReaderConfigMappings.l1ChainId),
157
154
  // Do not set default for CLI: keep undefined unless provided via flag or env
158
155
  configToFlag('--l1-rpc-urls', { ...l1ReaderConfigMappings.l1RpcUrls, defaultValue: undefined }),
159
- configToFlag('--l1-consensus-host-urls', blobSinkConfigMappings.l1ConsensusHostUrls),
160
- configToFlag('--l1-consensus-host-api-keys', blobSinkConfigMappings.l1ConsensusHostApiKeys),
161
- configToFlag('--l1-consensus-host-api-key-headers', blobSinkConfigMappings.l1ConsensusHostApiKeyHeaders),
156
+ configToFlag('--l1-consensus-host-urls', blobClientConfigMapping.l1ConsensusHostUrls),
157
+ configToFlag('--l1-consensus-host-api-keys', blobClientConfigMapping.l1ConsensusHostApiKeys),
158
+ configToFlag('--l1-consensus-host-api-key-headers', blobClientConfigMapping.l1ConsensusHostApiKeyHeaders),
162
159
  ],
163
160
  'L1 CONTRACTS': [
164
161
  configToFlag('--registry-address', l1ContractAddressesMapping.registryAddress),
@@ -205,21 +202,13 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
205
202
  'sequencer',
206
203
  omitConfigMappings(sequencerClientConfigMappings, [
207
204
  'fakeProcessingDelayPerTxMs',
205
+ 'fakeThrowAfterProcessingTxCount',
208
206
  'skipCollectingAttestations',
209
207
  'skipInvalidateBlockAsProposer',
210
208
  'blobSinkMapSizeKb',
211
209
  ]),
212
210
  ),
213
211
  ],
214
- 'BLOB SINK': [
215
- {
216
- flag: '--blob-sink',
217
- description: 'Starts Aztec Blob Sink with options',
218
- defaultValue: undefined,
219
- env: undefined,
220
- },
221
- ...getOptions('blobSink', blobSinkConfigMappings),
222
- ],
223
212
  'PROVER NODE': [
224
213
  {
225
214
  flag: '--prover-node',
package/src/cli/cli.ts CHANGED
@@ -37,10 +37,55 @@ export function injectAztecCommands(program: Command, userLog: LogFn, debugLogge
37
37
 
38
38
  Additional commands:
39
39
 
40
+ init [folder] [options]: creates a new Noir project
41
+ Options:
42
+ --name <name> Name of the package
43
+ --contract Use a contract template (default)
44
+ --lib Use a library template
45
+ --bin Use a binary template
46
+ Examples:
47
+ $ aztec init # creates a contract project in current directory
48
+ $ aztec init --lib # creates a library project
49
+
50
+ new <path> [options]: creates a new Noir project in a new directory
51
+ Options:
52
+ --name <name> Name of the package
53
+ --contract Use a contract template (default)
54
+ --lib Use a library template
55
+ --bin Use a binary template
56
+ Examples:
57
+ $ aztec new my-project # creates a contract project in ./my-project
58
+ $ aztec new my-lib --lib # creates a library project in ./my-lib
59
+
60
+ compile [options]: compiles Aztec Noir contracts
61
+ Compiles contracts with nargo compile and then postprocesses them to generate Aztec-specific artifacts including:
62
+ - Transpiled contract artifacts
63
+ - Verification keys
64
+ The compiled contracts will be placed in the target/ directory by default.
65
+ Supports standard nargo compile options.
66
+
67
+ fmt [options]: formats Noir code using nargo fmt
68
+ Example:
69
+ $ aztec fmt # formats all Noir files in the project
70
+
71
+ check [options]: type-checks Noir code without compiling using nargo check
72
+ Example:
73
+ $ aztec check # checks all Noir files in the project
74
+
40
75
  test [options]: starts a dockerized TXE node via
41
76
  $ aztec start --txe
42
77
  then runs
43
- $ aztec-nargo test --silence-warnings --oracle-resolver=<TXE_ADDRESS> [options]
78
+ $ aztec test --silence-warnings --oracle-resolver=<TXE_ADDRESS> [options]
79
+
80
+ lsp: starts the Nargo Language Server Protocol server
81
+ Runs nargo lsp in a Docker container for IDE integration with Noir.
82
+ This command is typically used by IDE extensions and not called directly by users.
83
+ Example:
84
+ $ aztec lsp # starts the LSP server
85
+
86
+ preload-crs: Downloads and caches the Common Reference String (CRS) data required for zero-knowledge proofs.
87
+ Example:
88
+ $ aztec preload-crs # preloads CRS data
44
89
  `,
45
90
  );
46
91
 
@@ -6,7 +6,7 @@ import {
6
6
  getArchiverConfigFromEnv,
7
7
  } from '@aztec/archiver';
8
8
  import { createLogger } from '@aztec/aztec.js/log';
9
- import { type BlobSinkConfig, blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
9
+ import { type BlobClientConfig, blobClientConfigMapping, createBlobClient } from '@aztec/blob-client/client';
10
10
  import { getL1Config } from '@aztec/cli/config';
11
11
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
12
12
  import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
@@ -25,9 +25,9 @@ export async function startArchiver(
25
25
  services: NamespacedApiHandlers,
26
26
  ): Promise<{ config: ArchiverConfig & DataStoreConfig }> {
27
27
  const envConfig = getArchiverConfigFromEnv();
28
- const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig & BlobSinkConfig>(
28
+ const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig & BlobClientConfig>(
29
29
  options,
30
- { ...archiverConfigMappings, ...dataConfigMappings, ...blobSinkConfigMapping },
30
+ { ...archiverConfigMappings, ...dataConfigMappings, ...blobClientConfigMapping },
31
31
  'archiver',
32
32
  );
33
33
 
@@ -51,9 +51,9 @@ export async function startArchiver(
51
51
  const store = await createStore('archiver', KVArchiverDataStore.SCHEMA_VERSION, archiverConfig, storeLog);
52
52
  const archiverStore = new KVArchiverDataStore(store, archiverConfig.maxLogs);
53
53
 
54
- const telemetry = initTelemetryClient(getTelemetryClientConfig());
55
- const blobSinkClient = createBlobSinkClient(archiverConfig, { logger: createLogger('archiver:blob-sink:client') });
56
- const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, { telemetry, blobSinkClient }, true);
54
+ const telemetry = await initTelemetryClient(getTelemetryClientConfig());
55
+ const blobClient = createBlobClient(archiverConfig, { logger: createLogger('archiver:blob-client:client') });
56
+ const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, { telemetry, blobClient }, true);
57
57
  services.archiver = [archiver, ArchiverApiSchema];
58
58
  signalHandlers.push(archiver.stop);
59
59
 
@@ -40,7 +40,7 @@ export async function startBot(
40
40
  const pxeConfig = extractRelevantOptions<PXEConfig & CliPXEOptions>(options, allPxeConfigMappings, 'pxe');
41
41
  const wallet = await TestWallet.create(aztecNode, pxeConfig);
42
42
 
43
- const telemetry = initTelemetryClient(getTelemetryClientConfig());
43
+ const telemetry = await initTelemetryClient(getTelemetryClientConfig());
44
44
  await addBot(options, signalHandlers, services, wallet, aztecNode, telemetry, undefined);
45
45
  }
46
46
 
@@ -3,7 +3,7 @@ import { type AztecNodeConfig, aztecNodeConfigMappings, getConfigEnvVars } from
3
3
  import { Fr } from '@aztec/aztec.js/fields';
4
4
  import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
5
5
  import { getL1Config } from '@aztec/cli/config';
6
- import { getPublicClient } from '@aztec/ethereum';
6
+ import { getPublicClient } from '@aztec/ethereum/client';
7
7
  import { SecretValue } from '@aztec/foundation/config';
8
8
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
9
9
  import type { LogFn } from '@aztec/foundation/log';
@@ -18,7 +18,7 @@ import {
18
18
  import { TestWallet } from '@aztec/test-wallet/server';
19
19
  import { getGenesisValues } from '@aztec/world-state/testing';
20
20
 
21
- import { createAztecNode } from '../../sandbox/index.js';
21
+ import { createAztecNode } from '../../local-network/index.js';
22
22
  import {
23
23
  extractNamespacedOptions,
24
24
  extractRelevantOptions,
@@ -93,7 +93,7 @@ export async function startNode(
93
93
  ...config,
94
94
  };
95
95
 
96
- if (!options.sequencer) {
96
+ if (!options.sequencer && !nodeConfig.fishermanMode) {
97
97
  nodeConfig.disableValidator = true;
98
98
  } else {
99
99
  const sequencerConfig = {
@@ -117,7 +117,7 @@ export async function startNode(
117
117
  }
118
118
 
119
119
  const telemetryConfig = extractRelevantOptions<TelemetryClientConfig>(options, telemetryClientConfigMappings, 'tel');
120
- const telemetry = initTelemetryClient(telemetryConfig);
120
+ const telemetry = await initTelemetryClient(telemetryConfig);
121
121
 
122
122
  // Create and start Aztec Node
123
123
  const node = await createAztecNode(nodeConfig, { telemetry }, { prefilledPublicData });
@@ -25,7 +25,7 @@ export async function startP2PBootstrap(
25
25
  userLog(`Starting P2P bootstrap node with config: ${jsonStringify(safeConfig)}`);
26
26
 
27
27
  const telemetryConfig = extractRelevantOptions<TelemetryClientConfig>(options, telemetryClientConfigMappings, 'tel');
28
- const telemetryClient = initTelemetryClient(telemetryConfig);
28
+ const telemetryClient = await initTelemetryClient(telemetryConfig);
29
29
 
30
30
  const store = await createStore('p2p-bootstrap', 1, config, createLogger('p2p:bootstrap:store'));
31
31
  const node = new BootstrapNode(store, telemetryClient);
@@ -53,7 +53,7 @@ export async function startProverAgent(
53
53
  );
54
54
  const broker = createProvingJobBrokerClient(config.proverBrokerUrl, getVersions(), fetch);
55
55
 
56
- const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
56
+ const telemetry = await initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
57
57
  const prover = await buildServerCircuitProver(config, telemetry);
58
58
  const proofStore = new InlineProofStore();
59
59
  const agents = times(
@@ -1,5 +1,5 @@
1
1
  import { getL1Config } from '@aztec/cli/config';
2
- import { getPublicClient } from '@aztec/ethereum';
2
+ import { getPublicClient } from '@aztec/ethereum/client';
3
3
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
4
4
  import type { LogFn } from '@aztec/foundation/log';
5
5
  import {
@@ -45,7 +45,7 @@ export async function startProverBroker(
45
45
  config.l1Contracts = addresses;
46
46
  config.rollupVersion = rollupConfig.rollupVersion;
47
47
 
48
- const client = initTelemetryClient(getTelemetryClientConfig());
48
+ const client = await initTelemetryClient(getTelemetryClientConfig());
49
49
  const broker = await createAndStartProvingBroker(config, client);
50
50
 
51
51
  if (options.autoUpdate !== 'disabled' && options.autoUpdateUrl) {
@@ -2,7 +2,7 @@ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
2
  import { Fr } from '@aztec/aztec.js/fields';
3
3
  import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
4
4
  import { getL1Config } from '@aztec/cli/config';
5
- import { getPublicClient } from '@aztec/ethereum';
5
+ import { getPublicClient } from '@aztec/ethereum/client';
6
6
  import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
7
7
  import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
8
8
  import type { LogFn } from '@aztec/foundation/log';
@@ -67,7 +67,7 @@ export async function startProverNode(
67
67
  );
68
68
  }
69
69
 
70
- const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
70
+ const telemetry = await initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
71
71
 
72
72
  let broker: ProvingJobBroker;
73
73
  if (proverConfig.proverBrokerUrl) {
package/src/cli/util.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  import type { AztecNodeConfig } from '@aztec/aztec-node';
2
- import { EthAddress } from '@aztec/aztec.js/addresses';
3
- import { Fr } from '@aztec/aztec.js/fields';
4
- import { AccountManager } from '@aztec/aztec.js/wallet';
5
- import type { ViemClient } from '@aztec/ethereum';
2
+ import type { AccountManager } from '@aztec/aztec.js/wallet';
3
+ import type { ViemClient } from '@aztec/ethereum/types';
6
4
  import type { ConfigMappingsType } from '@aztec/foundation/config';
5
+ import { Fr } from '@aztec/foundation/curves/bn254';
6
+ import { EthAddress } from '@aztec/foundation/eth-address';
7
7
  import { type LogFn, createLogger } from '@aztec/foundation/log';
8
8
  import type { SharedNodeConfig } from '@aztec/node-lib/config';
9
9
  import type { ProverConfig } from '@aztec/stdlib/interfaces/server';
10
- import { UpdateChecker } from '@aztec/stdlib/update-checker';
11
- import { getTelemetryClient } from '@aztec/telemetry-client';
10
+ import { getTelemetryClient } from '@aztec/telemetry-client/start';
12
11
  import type { TestWallet } from '@aztec/test-wallet/server';
13
12
 
14
13
  import chalk from 'chalk';
@@ -312,6 +311,7 @@ export async function setupUpdateMonitor(
312
311
  updateNodeConfig?: (config: object) => Promise<void>,
313
312
  ) {
314
313
  const logger = createLogger('update-check');
314
+ const { UpdateChecker } = await import('@aztec/stdlib/update-checker');
315
315
  const checker = await UpdateChecker.new({
316
316
  baseURL: updatesLocation,
317
317
  publicClient,
@@ -21,7 +21,7 @@ async function main() {
21
21
 
22
22
  const wallet = await TestWallet.create(node);
23
23
 
24
- // During sandbox setup we deploy a few accounts. Below we add them to our wallet.
24
+ // During local network setup we deploy a few accounts. Below we add them to our wallet.
25
25
  const [aliceInitialAccountData, bobInitialAccountData] = await getInitialTestAccountsData();
26
26
  await wallet.createSchnorrAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt);
27
27
  await wallet.createSchnorrAccount(bobInitialAccountData.secret, bobInitialAccountData.salt);
@@ -1,5 +1,5 @@
1
1
  import { EthAddress } from '@aztec/aztec.js/addresses';
2
- import type { ExtendedViemWalletClient } from '@aztec/ethereum';
2
+ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
3
3
  import { jsonStringify } from '@aztec/foundation/json-rpc';
4
4
 
5
5
  import type { Abi, Narrow } from 'abitype';
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export {
2
- createSandbox,
2
+ createLocalNetwork,
3
3
  registerDeployedBananaCoinInWalletAndGetAddress,
4
4
  registerDeployedBananaFPCInWalletAndGetAddress,
5
5
  registerDeployedSponsoredFPCInWalletAndGetAddress,
6
- } from './sandbox/index.js';
6
+ } from './local-network/index.js';
@@ -1,6 +1,6 @@
1
1
  import { type InitialAccountData, getInitialTestAccountsData } from '@aztec/accounts/testing';
2
2
  import type { Wallet } from '@aztec/aztec.js/wallet';
3
- import { Fr } from '@aztec/foundation/fields';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import type { LogFn } from '@aztec/foundation/log';
5
5
  import { FPCContract } from '@aztec/noir-contracts.js/FPC';
6
6
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
@@ -1,4 +1,4 @@
1
- export * from './sandbox.js';
1
+ export * from './local-network.js';
2
2
 
3
3
  export {
4
4
  registerDeployedBananaCoinInWalletAndGetAddress,
@@ -1,21 +1,20 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
2
  import { getInitialTestAccountsData } from '@aztec/accounts/testing';
3
- import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
4
- import { EthAddress } from '@aztec/aztec.js/addresses';
5
- import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
3
+ import { AztecNodeService } from '@aztec/aztec-node';
4
+ import { type AztecNodeConfig, getConfigEnvVars } from '@aztec/aztec-node/config';
5
+ import { Fr } from '@aztec/aztec.js/fields';
6
+ import { createLogger } from '@aztec/aztec.js/log';
7
+ import { type BlobClientInterface, createBlobClient } from '@aztec/blob-client/client';
6
8
  import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
7
- import {
8
- NULL_KEY,
9
- createEthereumChain,
10
- deployL1Contracts,
11
- deployMulticall3,
12
- getL1ContractsConfigEnvVars,
13
- waitForPublicClient,
14
- } from '@aztec/ethereum';
9
+ import { createEthereumChain } from '@aztec/ethereum/chain';
10
+ import { waitForPublicClient } from '@aztec/ethereum/client';
11
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
12
+ import { NULL_KEY } from '@aztec/ethereum/constants';
13
+ import { deployAztecL1Contracts } from '@aztec/ethereum/deploy-aztec-l1-contracts';
15
14
  import { EthCheatCodes } from '@aztec/ethereum/test';
16
15
  import { SecretValue } from '@aztec/foundation/config';
17
- import { Fr } from '@aztec/foundation/fields';
18
- import { type LogFn, createLogger } from '@aztec/foundation/log';
16
+ import { EthAddress } from '@aztec/foundation/eth-address';
17
+ import type { LogFn } from '@aztec/foundation/log';
19
18
  import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
20
19
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
21
20
  import { protocolContractsHash } from '@aztec/protocol-contracts';
@@ -28,7 +27,7 @@ import {
28
27
  import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/server';
29
28
  import { getGenesisValues } from '@aztec/world-state/testing';
30
29
 
31
- import { type HDAccount, type PrivateKeyAccount, createPublicClient, fallback, http as httpViemTransport } from 'viem';
30
+ import { type Hex, createPublicClient, fallback, http as httpViemTransport } from 'viem';
32
31
  import { mnemonicToAccount, privateKeyToAddress } from 'viem/accounts';
33
32
  import { foundry } from 'viem/chains';
34
33
 
@@ -38,53 +37,37 @@ import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
38
37
  import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
39
38
  import { getSponsoredFPCAddress } from './sponsored_fpc.js';
40
39
 
41
- const logger = createLogger('sandbox');
40
+ const logger = createLogger('local-network');
42
41
 
43
42
  const localAnvil = foundry;
44
43
 
45
44
  /**
46
- * Function to deploy our L1 contracts to the sandbox L1
45
+ * Function to deploy our L1 contracts to the local network L1
47
46
  * @param aztecNodeConfig - The Aztec Node Config
48
47
  * @param hdAccount - Account for publishing L1 contracts
49
48
  */
50
49
  export async function deployContractsToL1(
51
50
  aztecNodeConfig: AztecNodeConfig,
52
- hdAccount: HDAccount | PrivateKeyAccount,
53
- contractDeployLogger = logger,
51
+ privateKey: Hex,
54
52
  opts: {
55
53
  assumeProvenThroughBlockNumber?: number;
56
- salt?: number;
57
54
  genesisArchiveRoot?: Fr;
58
55
  feeJuicePortalInitialBalance?: bigint;
59
56
  } = {},
60
57
  ) {
61
- const chain =
62
- aztecNodeConfig.l1RpcUrls.length > 0
63
- ? createEthereumChain(aztecNodeConfig.l1RpcUrls, aztecNodeConfig.l1ChainId)
64
- : { chainInfo: localAnvil };
65
-
66
58
  await waitForPublicClient(aztecNodeConfig);
67
59
 
68
- const l1Contracts = await deployL1Contracts(
69
- aztecNodeConfig.l1RpcUrls,
70
- hdAccount,
71
- chain.chainInfo,
72
- contractDeployLogger,
73
- {
74
- ...getL1ContractsConfigEnvVars(), // TODO: We should not need to be loading config from env again, caller should handle this
75
- ...aztecNodeConfig,
76
- vkTreeRoot: getVKTreeRoot(),
77
- protocolContractsHash,
78
- genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
79
- salt: opts.salt,
80
- feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
81
- aztecTargetCommitteeSize: 0, // no committee in sandbox
82
- slasherFlavor: 'none', // no slashing in sandbox
83
- realVerifier: false,
84
- },
85
- );
86
-
87
- await deployMulticall3(l1Contracts.l1Client, logger);
60
+ const l1Contracts = await deployAztecL1Contracts(aztecNodeConfig.l1RpcUrls[0], privateKey, foundry.id, {
61
+ ...getL1ContractsConfigEnvVars(), // TODO: We should not need to be loading config from env again, caller should handle this
62
+ ...aztecNodeConfig,
63
+ vkTreeRoot: getVKTreeRoot(),
64
+ protocolContractsHash,
65
+ genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
66
+ feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
67
+ aztecTargetCommitteeSize: 0, // no committee in local network
68
+ slasherFlavor: 'none', // no slashing in local network
69
+ realVerifier: false,
70
+ });
88
71
 
89
72
  aztecNodeConfig.l1Contracts = l1Contracts.l1ContractAddresses;
90
73
  aztecNodeConfig.rollupVersion = l1Contracts.rollupVersion;
@@ -92,29 +75,27 @@ export async function deployContractsToL1(
92
75
  return aztecNodeConfig.l1Contracts;
93
76
  }
94
77
 
95
- /** Sandbox settings. */
96
- export type SandboxConfig = AztecNodeConfig & {
78
+ /** Local network settings. */
79
+ export type LocalNetworkConfig = AztecNodeConfig & {
97
80
  /** Mnemonic used to derive the L1 deployer private key.*/
98
81
  l1Mnemonic: string;
99
- /** Salt used to deploy L1 contracts.*/
100
- deployAztecContractsSalt: string;
101
- /** Whether to deploy test accounts on sandbox start.*/
82
+ /** Whether to deploy test accounts on local network start.*/
102
83
  testAccounts: boolean;
103
84
  };
104
85
 
105
86
  /**
106
87
  * Create and start a new Aztec Node and PXE. Deploys L1 contracts.
107
88
  * Does not start any HTTP services nor populate any initial accounts.
108
- * @param config - Optional Sandbox settings.
89
+ * @param config - Optional local network settings.
109
90
  */
110
- export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog: LogFn) {
111
- // sandbox is meant for test envs. We should only need one l1RpcUrl
91
+ export async function createLocalNetwork(config: Partial<LocalNetworkConfig> = {}, userLog: LogFn) {
92
+ // local network is meant for test envs. We should only need one l1RpcUrl
112
93
  const l1RpcUrl = config.l1RpcUrls?.[0];
113
94
  if (!l1RpcUrl) {
114
95
  throw new Error('An L1 RPC URL is required');
115
96
  }
116
97
  if ((config.l1RpcUrls?.length || 0) > 1) {
117
- logger.warn(`Multiple L1 RPC URLs provided. Sandbox will only use the first one: ${l1RpcUrl}`);
98
+ logger.warn(`Multiple L1 RPC URLs provided. Local networks will only use the first one: ${l1RpcUrl}`);
118
99
  }
119
100
  const aztecNodeConfig: AztecNodeConfig = { ...getConfigEnvVars(), ...config };
120
101
  const hdAccount = mnemonicToAccount(config.l1Mnemonic || DefaultMnemonic);
@@ -156,12 +137,15 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
156
137
  let watcher: AnvilTestWatcher | undefined = undefined;
157
138
  const dateProvider = new TestDateProvider();
158
139
  if (!aztecNodeConfig.p2pEnabled) {
159
- const l1ContractAddresses = await deployContractsToL1(aztecNodeConfig, hdAccount, undefined, {
160
- assumeProvenThroughBlockNumber: Number.MAX_SAFE_INTEGER,
161
- genesisArchiveRoot,
162
- salt: config.deployAztecContractsSalt ? parseInt(config.deployAztecContractsSalt) : undefined,
163
- feeJuicePortalInitialBalance: fundingNeeded,
164
- });
140
+ const l1ContractAddresses = await deployContractsToL1(
141
+ aztecNodeConfig,
142
+ aztecNodeConfig.validatorPrivateKeys.getValue()[0],
143
+ {
144
+ assumeProvenThroughBlockNumber: Number.MAX_SAFE_INTEGER,
145
+ genesisArchiveRoot,
146
+ feeJuicePortalInitialBalance: fundingNeeded,
147
+ },
148
+ );
165
149
 
166
150
  const chain =
167
151
  aztecNodeConfig.l1RpcUrls.length > 0
@@ -179,18 +163,14 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
179
163
  publicClient,
180
164
  dateProvider,
181
165
  );
182
- watcher.setIsSandbox(true);
166
+ watcher.setisLocalNetwork(true);
183
167
  await watcher.start();
184
168
  }
185
169
 
186
- const telemetry = initTelemetryClient(getTelemetryClientConfig());
187
- // Create a local blob sink client inside the sandbox, no http connectivity
188
- const blobSinkClient = createBlobSinkClient();
189
- const node = await createAztecNode(
190
- aztecNodeConfig,
191
- { telemetry, blobSinkClient, dateProvider },
192
- { prefilledPublicData },
193
- );
170
+ const telemetry = await initTelemetryClient(getTelemetryClientConfig());
171
+ // Create a local blob client client inside the local network, no http connectivity
172
+ const blobClient = createBlobClient();
173
+ const node = await createAztecNode(aztecNodeConfig, { telemetry, blobClient, dateProvider }, { prefilledPublicData });
194
174
 
195
175
  if (initialAccounts.length) {
196
176
  const PXEConfig = { proverEnabled: aztecNodeConfig.realProofs };
@@ -227,7 +207,7 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
227
207
  */
228
208
  export async function createAztecNode(
229
209
  config: Partial<AztecNodeConfig> = {},
230
- deps: { telemetry?: TelemetryClient; blobSinkClient?: BlobSinkClientInterface; dateProvider?: DateProvider } = {},
210
+ deps: { telemetry?: TelemetryClient; blobClient?: BlobClientInterface; dateProvider?: DateProvider } = {},
231
211
  options: { prefilledPublicData?: PublicDataTreeLeaf[] } = {},
232
212
  ) {
233
213
  // TODO(#12272): will clean this up. This is criminal.
@@ -1,3 +1,4 @@
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
1
2
  import {
2
3
  type ContractInstanceWithAddress,
3
4
  getContractInstanceFromInstantiationParams,
@@ -13,11 +14,11 @@ async function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress> {
13
14
  });
14
15
  }
15
16
 
16
- export async function getSponsoredFPCAddress() {
17
+ export async function getSponsoredFPCAddress(): Promise<AztecAddress> {
17
18
  return (await getSponsoredFPCInstance()).address;
18
19
  }
19
20
 
20
- export async function registerDeployedSponsoredFPCInWalletAndGetAddress(wallet: Wallet) {
21
+ export async function registerDeployedSponsoredFPCInWalletAndGetAddress(wallet: Wallet): Promise<AztecAddress> {
21
22
  const fpc = await getSponsoredFPCInstance();
22
23
  // The following is no-op if the contract is already registered
23
24
  await wallet.registerContract(fpc, SponsoredFPCContract.artifact);