@aztec/aztec 0.0.0-test.1 → 0.0.1-commit.b655e406

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 (111) hide show
  1. package/dest/bin/index.js +20 -12
  2. package/dest/cli/aztec_start_action.d.ts.map +1 -1
  3. package/dest/cli/aztec_start_action.js +32 -33
  4. package/dest/cli/aztec_start_options.d.ts +4 -2
  5. package/dest/cli/aztec_start_options.d.ts.map +1 -1
  6. package/dest/cli/aztec_start_options.js +137 -207
  7. package/dest/cli/cli.d.ts.map +1 -1
  8. package/dest/cli/cli.js +4 -0
  9. package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
  10. package/dest/cli/cmds/start_archiver.js +18 -10
  11. package/dest/cli/cmds/start_blob_sink.d.ts.map +1 -1
  12. package/dest/cli/cmds/start_blob_sink.js +17 -1
  13. package/dest/cli/cmds/start_bot.d.ts +3 -6
  14. package/dest/cli/cmds/start_bot.d.ts.map +1 -1
  15. package/dest/cli/cmds/start_bot.js +24 -13
  16. package/dest/cli/cmds/start_node.d.ts +1 -1
  17. package/dest/cli/cmds/start_node.d.ts.map +1 -1
  18. package/dest/cli/cmds/start_node.js +66 -79
  19. package/dest/cli/cmds/start_p2p_bootstrap.d.ts.map +1 -1
  20. package/dest/cli/cmds/start_p2p_bootstrap.js +9 -4
  21. package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
  22. package/dest/cli/cmds/start_prover_agent.js +31 -2
  23. package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
  24. package/dest/cli/cmds/start_prover_broker.js +9 -3
  25. package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
  26. package/dest/cli/cmds/start_prover_node.js +43 -45
  27. package/dest/cli/preload_crs.d.ts +3 -0
  28. package/dest/cli/preload_crs.d.ts.map +1 -0
  29. package/dest/cli/preload_crs.js +6 -0
  30. package/dest/cli/release_version.d.ts +2 -0
  31. package/dest/cli/release_version.d.ts.map +1 -0
  32. package/dest/cli/release_version.js +14 -0
  33. package/dest/cli/util.d.ts +36 -5
  34. package/dest/cli/util.d.ts.map +1 -1
  35. package/dest/cli/util.js +198 -28
  36. package/dest/cli/versioning.js +3 -3
  37. package/dest/examples/token.js +31 -18
  38. package/dest/examples/util.d.ts +4 -5
  39. package/dest/examples/util.d.ts.map +1 -1
  40. package/dest/examples/util.js +5 -6
  41. package/dest/index.d.ts +1 -1
  42. package/dest/index.d.ts.map +1 -1
  43. package/dest/index.js +1 -1
  44. package/dest/sandbox/banana_fpc.d.ts +4 -5
  45. package/dest/sandbox/banana_fpc.d.ts.map +1 -1
  46. package/dest/sandbox/banana_fpc.js +19 -21
  47. package/dest/sandbox/index.d.ts +2 -3
  48. package/dest/sandbox/index.d.ts.map +1 -1
  49. package/dest/sandbox/index.js +2 -3
  50. package/dest/sandbox/sandbox.d.ts +25 -27
  51. package/dest/sandbox/sandbox.d.ts.map +1 -1
  52. package/dest/sandbox/sandbox.js +51 -49
  53. package/dest/sandbox/sponsored_fpc.d.ts +3 -5
  54. package/dest/sandbox/sponsored_fpc.d.ts.map +1 -1
  55. package/dest/sandbox/sponsored_fpc.js +10 -18
  56. package/dest/testing/anvil_test_watcher.d.ts +34 -0
  57. package/dest/testing/anvil_test_watcher.d.ts.map +1 -0
  58. package/dest/testing/anvil_test_watcher.js +142 -0
  59. package/dest/testing/cheat_codes.d.ts +43 -0
  60. package/dest/testing/cheat_codes.d.ts.map +1 -0
  61. package/dest/testing/cheat_codes.js +62 -0
  62. package/dest/testing/index.d.ts +4 -0
  63. package/dest/testing/index.d.ts.map +1 -0
  64. package/dest/testing/index.js +3 -0
  65. package/package.json +47 -41
  66. package/src/bin/index.ts +24 -12
  67. package/src/cli/aztec_start_action.ts +27 -30
  68. package/src/cli/aztec_start_options.ts +155 -207
  69. package/src/cli/cli.ts +8 -0
  70. package/src/cli/cmds/start_archiver.ts +19 -13
  71. package/src/cli/cmds/start_blob_sink.ts +27 -1
  72. package/src/cli/cmds/start_bot.ts +35 -12
  73. package/src/cli/cmds/start_node.ts +89 -84
  74. package/src/cli/cmds/start_p2p_bootstrap.ts +12 -4
  75. package/src/cli/cmds/start_prover_agent.ts +22 -2
  76. package/src/cli/cmds/start_prover_broker.ts +23 -3
  77. package/src/cli/cmds/start_prover_node.ts +53 -50
  78. package/src/cli/preload_crs.ts +7 -0
  79. package/src/cli/release_version.ts +21 -0
  80. package/src/cli/util.ts +208 -34
  81. package/src/cli/versioning.ts +3 -3
  82. package/src/examples/token.ts +23 -19
  83. package/src/examples/util.ts +6 -8
  84. package/src/index.ts +3 -4
  85. package/src/sandbox/banana_fpc.ts +20 -25
  86. package/src/sandbox/index.ts +5 -3
  87. package/src/sandbox/sandbox.ts +70 -57
  88. package/src/sandbox/sponsored_fpc.ts +12 -25
  89. package/src/testing/anvil_test_watcher.ts +164 -0
  90. package/src/testing/cheat_codes.ts +78 -0
  91. package/src/testing/index.ts +3 -0
  92. package/dest/cli/chain_l2_config.d.ts +0 -19
  93. package/dest/cli/chain_l2_config.d.ts.map +0 -1
  94. package/dest/cli/chain_l2_config.js +0 -56
  95. package/dest/cli/cmds/start_faucet.d.ts +0 -4
  96. package/dest/cli/cmds/start_faucet.d.ts.map +0 -1
  97. package/dest/cli/cmds/start_faucet.js +0 -20
  98. package/dest/cli/cmds/start_pxe.d.ts +0 -16
  99. package/dest/cli/cmds/start_pxe.d.ts.map +0 -1
  100. package/dest/cli/cmds/start_pxe.js +0 -95
  101. package/dest/cli/get_l1_config.d.ts +0 -7
  102. package/dest/cli/get_l1_config.d.ts.map +0 -1
  103. package/dest/cli/get_l1_config.js +0 -13
  104. package/dest/sandbox/sponsored_fee_payment_method.d.ts +0 -23
  105. package/dest/sandbox/sponsored_fee_payment_method.d.ts.map +0 -1
  106. package/dest/sandbox/sponsored_fee_payment_method.js +0 -36
  107. package/src/cli/chain_l2_config.ts +0 -74
  108. package/src/cli/cmds/start_faucet.ts +0 -34
  109. package/src/cli/cmds/start_pxe.ts +0 -129
  110. package/src/cli/get_l1_config.ts +0 -18
  111. package/src/sandbox/sponsored_fee_payment_method.ts +0 -46
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { AnvilTestWatcher } from './anvil_test_watcher.js';
2
+ export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
3
+ export { CheatCodes } from './cheat_codes.js';
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@aztec/aztec",
3
- "version": "0.0.0-test.1",
3
+ "version": "0.0.1-commit.b655e406",
4
4
  "type": "module",
5
5
  "exports": {
6
- ".": "./dest/index.js"
6
+ ".": "./dest/index.js",
7
+ "./testing": "./dest/testing/index.js"
7
8
  },
8
9
  "bin": "./dest/bin/index.js",
9
10
  "typedocOptions": {
@@ -19,8 +20,6 @@
19
20
  "start:debug": "node --inspect=0.0.0.0:9221 --no-warnings ./dest/bin",
20
21
  "start:sandbox": "ETHEREUM_HOSTS=http://0.0.0.0:8545/ && yarn start start --sandbox",
21
22
  "clean": "rm -rf ./dest .tsbuildinfo",
22
- "formatting": "run -T prettier --check ./src && run -T eslint ./src",
23
- "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
24
23
  "build:dev": "tsc -b --watch",
25
24
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
26
25
  "run:example:token": "LOG_LEVEL='verbose' node ./dest/examples/token.js"
@@ -29,41 +28,44 @@
29
28
  "../package.common.json"
30
29
  ],
31
30
  "dependencies": {
32
- "@aztec/accounts": "0.0.0-test.1",
33
- "@aztec/archiver": "0.0.0-test.1",
34
- "@aztec/aztec-faucet": "0.0.0-test.1",
35
- "@aztec/aztec-node": "0.0.0-test.1",
36
- "@aztec/aztec.js": "0.0.0-test.1",
37
- "@aztec/bb-prover": "0.0.0-test.1",
38
- "@aztec/blob-sink": "0.0.0-test.1",
39
- "@aztec/bot": "0.0.0-test.1",
40
- "@aztec/builder": "0.0.0-test.1",
41
- "@aztec/cli": "0.0.0-test.1",
42
- "@aztec/cli-wallet": "0.0.0-test.1",
43
- "@aztec/constants": "0.0.0-test.1",
44
- "@aztec/entrypoints": "0.0.0-test.1",
45
- "@aztec/ethereum": "0.0.0-test.1",
46
- "@aztec/foundation": "0.0.0-test.1",
47
- "@aztec/kv-store": "0.0.0-test.1",
48
- "@aztec/noir-contracts.js": "0.0.0-test.1",
49
- "@aztec/noir-protocol-circuits-types": "0.0.0-test.1",
50
- "@aztec/p2p": "0.0.0-test.1",
51
- "@aztec/p2p-bootstrap": "0.0.0-test.1",
52
- "@aztec/protocol-contracts": "0.0.0-test.1",
53
- "@aztec/prover-client": "0.0.0-test.1",
54
- "@aztec/prover-node": "0.0.0-test.1",
55
- "@aztec/pxe": "0.0.0-test.1",
56
- "@aztec/stdlib": "0.0.0-test.1",
57
- "@aztec/telemetry-client": "0.0.0-test.1",
58
- "@aztec/txe": "0.0.0-test.1",
59
- "@aztec/world-state": "0.0.0-test.1",
31
+ "@aztec/accounts": "0.0.1-commit.b655e406",
32
+ "@aztec/archiver": "0.0.1-commit.b655e406",
33
+ "@aztec/aztec-faucet": "0.0.1-commit.b655e406",
34
+ "@aztec/aztec-node": "0.0.1-commit.b655e406",
35
+ "@aztec/aztec.js": "0.0.1-commit.b655e406",
36
+ "@aztec/bb-prover": "0.0.1-commit.b655e406",
37
+ "@aztec/bb.js": "0.0.1-commit.b655e406",
38
+ "@aztec/blob-sink": "0.0.1-commit.b655e406",
39
+ "@aztec/bot": "0.0.1-commit.b655e406",
40
+ "@aztec/builder": "0.0.1-commit.b655e406",
41
+ "@aztec/cli": "0.0.1-commit.b655e406",
42
+ "@aztec/constants": "0.0.1-commit.b655e406",
43
+ "@aztec/entrypoints": "0.0.1-commit.b655e406",
44
+ "@aztec/ethereum": "0.0.1-commit.b655e406",
45
+ "@aztec/foundation": "0.0.1-commit.b655e406",
46
+ "@aztec/kv-store": "0.0.1-commit.b655e406",
47
+ "@aztec/l1-artifacts": "0.0.1-commit.b655e406",
48
+ "@aztec/node-lib": "0.0.1-commit.b655e406",
49
+ "@aztec/noir-contracts.js": "0.0.1-commit.b655e406",
50
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.b655e406",
51
+ "@aztec/p2p": "0.0.1-commit.b655e406",
52
+ "@aztec/p2p-bootstrap": "0.0.1-commit.b655e406",
53
+ "@aztec/protocol-contracts": "0.0.1-commit.b655e406",
54
+ "@aztec/prover-client": "0.0.1-commit.b655e406",
55
+ "@aztec/prover-node": "0.0.1-commit.b655e406",
56
+ "@aztec/pxe": "0.0.1-commit.b655e406",
57
+ "@aztec/stdlib": "0.0.1-commit.b655e406",
58
+ "@aztec/telemetry-client": "0.0.1-commit.b655e406",
59
+ "@aztec/test-wallet": "0.0.1-commit.b655e406",
60
+ "@aztec/txe": "0.0.1-commit.b655e406",
61
+ "@aztec/world-state": "0.0.1-commit.b655e406",
60
62
  "@types/chalk": "^2.2.0",
61
63
  "abitype": "^0.8.11",
62
64
  "chalk": "^5.3.0",
63
65
  "commander": "^12.1.0",
64
- "koa": "^2.14.2",
65
- "koa-router": "^12.0.0",
66
- "viem": "2.22.8"
66
+ "koa": "^2.16.1",
67
+ "koa-router": "^13.1.1",
68
+ "viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
67
69
  },
68
70
  "files": [
69
71
  "dest",
@@ -72,12 +74,12 @@
72
74
  ],
73
75
  "types": "./dest/index.d.ts",
74
76
  "devDependencies": {
75
- "@jest/globals": "^29.5.0",
76
- "@types/jest": "^29.5.0",
77
- "@types/koa": "^2.13.6",
78
- "jest": "^29.5.0",
77
+ "@jest/globals": "^30.0.0",
78
+ "@types/jest": "^30.0.0",
79
+ "@types/koa": "^2.15.0",
80
+ "jest": "^30.0.0",
79
81
  "ts-node": "^10.9.1",
80
- "typescript": "^5.0.4"
82
+ "typescript": "^5.3.3"
81
83
  },
82
84
  "jest": {
83
85
  "moduleNameMapper": {
@@ -110,9 +112,13 @@
110
112
  "testTimeout": 120000,
111
113
  "setupFiles": [
112
114
  "../../foundation/src/jest/setup.mjs"
115
+ ],
116
+ "testEnvironment": "../../foundation/src/jest/env.mjs",
117
+ "setupFilesAfterEnv": [
118
+ "../../foundation/src/jest/setupAfterEnv.mjs"
113
119
  ]
114
120
  },
115
121
  "engines": {
116
- "node": ">=18"
122
+ "node": ">=20.10"
117
123
  }
118
124
  }
package/src/bin/index.ts CHANGED
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  //
3
3
  import { injectCommands as injectBuilderCommands } from '@aztec/builder';
4
- import { injectCommands as injectWalletCommands } from '@aztec/cli-wallet';
4
+ import { injectCommands as injectAztecNodeCommands } from '@aztec/cli/aztec_node';
5
+ import { enrichEnvironmentWithChainConfig, enrichEnvironmentWithNetworkConfig } from '@aztec/cli/config';
5
6
  import { injectCommands as injectContractCommands } from '@aztec/cli/contracts';
6
- import { injectCommands as injectDevnetCommands } from '@aztec/cli/devnet';
7
7
  import { injectCommands as injectInfrastructureCommands } from '@aztec/cli/infrastructure';
8
8
  import { injectCommands as injectL1Commands } from '@aztec/cli/l1';
9
9
  import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
10
- import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
10
+ import { injectCommands as injectValidatorKeysCommands } from '@aztec/cli/validator_keys';
11
+ import { getActiveNetworkName } from '@aztec/foundation/config';
11
12
  import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
- import { fileURLToPath } from '@aztec/foundation/url';
13
13
 
14
14
  import { Command } from 'commander';
15
- import { readFileSync } from 'fs';
16
- import { dirname, resolve } from 'path';
17
15
 
16
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
18
17
  import { injectAztecCommands } from '../cli/index.js';
18
+ import { getCliVersion } from '../cli/release_version.js';
19
19
 
20
20
  const userLog = createConsoleLogger();
21
21
  const debugLogger = createLogger('cli');
@@ -28,19 +28,31 @@ async function main() {
28
28
  process.once('SIGINT', shutdown);
29
29
  process.once('SIGTERM', shutdown);
30
30
 
31
- const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
32
- const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
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
+ const networkName = getActiveNetworkName(networkValue);
42
+ await enrichEnvironmentWithNetworkConfig(networkName);
43
+ enrichEnvironmentWithChainConfig(networkName);
44
+
45
+ const cliVersion = getCliVersion();
33
46
  let program = new Command('aztec');
34
47
  program.description('Aztec command line interface').version(cliVersion);
35
48
  program = injectAztecCommands(program, userLog, debugLogger);
36
49
  program = injectBuilderCommands(program);
37
50
  program = injectContractCommands(program, userLog, debugLogger);
38
- program = injectInfrastructureCommands(program, userLog, debugLogger);
51
+ program = injectInfrastructureCommands(program, userLog);
39
52
  program = injectL1Commands(program, userLog, debugLogger);
40
- program = injectPXECommands(program, userLog, debugLogger);
53
+ program = injectAztecNodeCommands(program, userLog, debugLogger);
41
54
  program = injectMiscCommands(program, userLog);
42
- program = injectDevnetCommands(program, userLog, debugLogger);
43
- program = injectWalletCommands(program, userLog, debugLogger);
55
+ program = injectValidatorKeysCommands(program, userLog);
44
56
 
45
57
  await program.parseAsync(process.argv);
46
58
  }
@@ -4,43 +4,38 @@ import {
4
4
  startHttpRpcServer,
5
5
  } from '@aztec/foundation/json-rpc/server';
6
6
  import type { LogFn, Logger } from '@aztec/foundation/log';
7
- import { fileURLToPath } from '@aztec/foundation/url';
8
7
  import type { ChainConfig } from '@aztec/stdlib/config';
9
- import { AztecNodeApiSchema, PXESchema } from '@aztec/stdlib/interfaces/client';
8
+ import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
10
9
  import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
11
10
  import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
12
11
 
13
- import { readFileSync } from 'fs';
14
- import { dirname, resolve } from 'path';
15
-
16
12
  import { createSandbox } from '../sandbox/index.js';
17
13
  import { github, splash } from '../splash.js';
18
- import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
14
+ import { getCliVersion } from './release_version.js';
19
15
  import { extractNamespacedOptions, installSignalHandlers } from './util.js';
20
16
  import { getVersions } from './versioning.js';
21
17
 
22
- const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
23
- const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
24
-
25
18
  export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logger) {
26
19
  // list of 'stop' functions to call when process ends
27
20
  const signalHandlers: Array<() => Promise<void>> = [];
28
21
  const services: NamespacedApiHandlers = {};
22
+ const adminServices: NamespacedApiHandlers = {};
29
23
  let config: ChainConfig | undefined = undefined;
30
24
 
31
25
  if (options.sandbox) {
26
+ const cliVersion = getCliVersion();
32
27
  const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
33
- const nodeOptions = extractNamespacedOptions(options, 'node');
28
+ sandboxOptions.testAccounts = true;
34
29
  userLog(`${splash}\n${github}\n\n`);
35
30
  userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
36
31
 
37
- const { node, pxe, stop } = await createSandbox(
32
+ const { node, stop } = await createSandbox(
38
33
  {
39
- l1Mnemonic: options.l1Mnemonic,
34
+ l1Mnemonic: sandboxOptions.l1Mnemonic,
40
35
  l1RpcUrls: options.l1RpcUrls,
41
- l1Salt: nodeOptions.deployAztecContractsSalt,
42
- noPXE: sandboxOptions.noPXE,
36
+ deployAztecContractsSalt: sandboxOptions.deployAztecContractsSalt,
43
37
  testAccounts: sandboxOptions.testAccounts,
38
+ realProofs: false,
44
39
  },
45
40
  userLog,
46
41
  );
@@ -48,19 +43,10 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
48
43
  // Start Node and PXE JSON-RPC server
49
44
  signalHandlers.push(stop);
50
45
  services.node = [node, AztecNodeApiSchema];
51
- if (!sandboxOptions.noPXE) {
52
- services.pxe = [pxe, PXESchema];
53
- } else {
54
- userLog(`Not exposing PXE API through JSON-RPC server`);
55
- }
56
46
  } else {
57
- // If a network is specified, enrich the environment with the chain config
58
- if (options.network) {
59
- await enrichEnvironmentWithChainConfig(options.network);
60
- }
61
47
  if (options.node) {
62
48
  const { startNode } = await import('./cmds/start_node.js');
63
- ({ config } = await startNode(options, signalHandlers, services, userLog));
49
+ ({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
64
50
  } else if (options.bot) {
65
51
  const { startBot } = await import('./cmds/start_bot.js');
66
52
  await startBot(options, signalHandlers, services, userLog);
@@ -70,9 +56,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
70
56
  } else if (options.blobSink) {
71
57
  const { startBlobSink } = await import('./cmds/start_blob_sink.js');
72
58
  await startBlobSink(options, signalHandlers, userLog);
73
- } else if (options.pxe) {
74
- const { startPXE } = await import('./cmds/start_pxe.js');
75
- ({ config } = await startPXE(options, signalHandlers, services, userLog));
76
59
  } else if (options.archiver) {
77
60
  const { startArchiver } = await import('./cmds/start_archiver.js');
78
61
  ({ config } = await startArchiver(options, signalHandlers, services));
@@ -91,9 +74,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
91
74
  } else if (options.sequencer) {
92
75
  userLog(`Cannot run a standalone sequencer without a node`);
93
76
  process.exit(1);
94
- } else if (options.faucet) {
95
- const { startFaucet } = await import('./cmds/start_faucet.js');
96
- await startFaucet(options, signalHandlers, services, userLog);
97
77
  } else {
98
78
  userLog(`No module specified to start`);
99
79
  process.exit(1);
@@ -102,13 +82,30 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
102
82
 
103
83
  installSignalHandlers(debugLogger.info, signalHandlers);
104
84
  const versions = getVersions(config);
85
+
86
+ // Start the main JSON-RPC server
105
87
  if (Object.entries(services).length > 0) {
106
88
  const rpcServer = createNamespacedSafeJsonRpcServer(services, {
107
89
  http200OnError: false,
108
90
  log: debugLogger,
109
91
  middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
92
+ maxBatchSize: options.rpcMaxBatchSize,
93
+ maxBodySizeBytes: options.rpcMaxBodySize,
110
94
  });
111
95
  const { port } = await startHttpRpcServer(rpcServer, { port: options.port });
112
96
  debugLogger.info(`Aztec Server listening on port ${port}`, versions);
113
97
  }
98
+
99
+ // If there are any admin services, start a separate JSON-RPC server for them
100
+ if (Object.entries(adminServices).length > 0) {
101
+ const rpcServer = createNamespacedSafeJsonRpcServer(adminServices, {
102
+ http200OnError: false,
103
+ log: debugLogger,
104
+ middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
105
+ maxBatchSize: options.rpcMaxBatchSize,
106
+ maxBodySizeBytes: options.rpcMaxBodySize,
107
+ });
108
+ const { port } = await startHttpRpcServer(rpcServer, { port: options.adminPort });
109
+ debugLogger.info(`Aztec Server admin API listening on port ${port}`, versions);
110
+ }
114
111
  }