@aztec/cli 3.0.0-nightly.20250918 → 3.0.0-nightly.20250919

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 (61) hide show
  1. package/dest/cmds/aztec_node/block_number.d.ts +3 -0
  2. package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
  3. package/dest/cmds/aztec_node/block_number.js +10 -0
  4. package/dest/cmds/aztec_node/get_block.d.ts +3 -0
  5. package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
  6. package/dest/cmds/aztec_node/get_block.js +10 -0
  7. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +4 -0
  8. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
  9. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
  10. package/dest/cmds/{pxe → aztec_node}/get_logs.d.ts +2 -2
  11. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
  12. package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
  13. package/dest/cmds/aztec_node/index.d.ts +4 -0
  14. package/dest/cmds/aztec_node/index.d.ts.map +1 -0
  15. package/dest/cmds/aztec_node/index.js +20 -0
  16. package/dest/cmds/devnet/bootstrap_network.d.ts +1 -1
  17. package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -1
  18. package/dest/cmds/devnet/bootstrap_network.js +7 -6
  19. package/dest/cmds/devnet/index.d.ts.map +1 -1
  20. package/dest/cmds/devnet/index.js +3 -3
  21. package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
  22. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  23. package/dest/cmds/l1/assume_proven_through.js +5 -5
  24. package/dest/cmds/l1/index.d.ts.map +1 -1
  25. package/dest/cmds/l1/index.js +3 -3
  26. package/dest/cmds/pxe/index.d.ts.map +1 -1
  27. package/dest/cmds/pxe/index.js +1 -17
  28. package/dest/config/chain_l2_config.js +3 -3
  29. package/dest/utils/commands.d.ts +2 -0
  30. package/dest/utils/commands.d.ts.map +1 -1
  31. package/dest/utils/commands.js +2 -0
  32. package/dest/utils/inspect.d.ts +3 -3
  33. package/dest/utils/inspect.d.ts.map +1 -1
  34. package/dest/utils/inspect.js +6 -6
  35. package/package.json +25 -24
  36. package/src/cmds/aztec_node/block_number.ts +9 -0
  37. package/src/cmds/aztec_node/get_block.ts +17 -0
  38. package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +25 -0
  39. package/src/cmds/{pxe → aztec_node}/get_logs.ts +5 -6
  40. package/src/cmds/aztec_node/index.ts +69 -0
  41. package/src/cmds/devnet/bootstrap_network.ts +13 -3
  42. package/src/cmds/devnet/index.ts +3 -1
  43. package/src/cmds/l1/assume_proven_through.ts +5 -5
  44. package/src/cmds/l1/index.ts +3 -2
  45. package/src/cmds/pxe/index.ts +0 -55
  46. package/src/config/chain_l2_config.ts +3 -3
  47. package/src/utils/commands.ts +8 -0
  48. package/src/utils/inspect.ts +12 -5
  49. package/dest/cmds/pxe/block_number.d.ts +0 -3
  50. package/dest/cmds/pxe/block_number.d.ts.map +0 -1
  51. package/dest/cmds/pxe/block_number.js +0 -10
  52. package/dest/cmds/pxe/get_block.d.ts +0 -3
  53. package/dest/cmds/pxe/get_block.d.ts.map +0 -1
  54. package/dest/cmds/pxe/get_block.js +0 -9
  55. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
  56. package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
  57. package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
  58. package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
  59. package/src/cmds/pxe/block_number.ts +0 -9
  60. package/src/cmds/pxe/get_block.ts +0 -10
  61. package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
@@ -0,0 +1,3 @@
1
+ import type { LogFn } from '@aztec/foundation/log';
2
+ export declare function blockNumber(nodeUrl: string, log: LogFn): Promise<void>;
3
+ //# sourceMappingURL=block_number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_number.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/block_number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAK5D"}
@@ -0,0 +1,10 @@
1
+ import { createAztecNodeClient } from '@aztec/aztec.js';
2
+ export async function blockNumber(nodeUrl, log) {
3
+ const aztecNode = createAztecNodeClient(nodeUrl);
4
+ const [latestNum, provenNum] = await Promise.all([
5
+ aztecNode.getBlockNumber(),
6
+ aztecNode.getProvenBlockNumber()
7
+ ]);
8
+ log(`Latest block: ${latestNum}`);
9
+ log(`Proven block: ${provenNum}`);
10
+ }
@@ -0,0 +1,3 @@
1
+ import type { LogFn, Logger } from '@aztec/foundation/log';
2
+ export declare function getBlock(pxeUrl: string, nodeUrl: string, maybeBlockNumber: number | undefined, debugLogger: Logger, log: LogFn): Promise<void>;
3
+ //# sourceMappingURL=get_block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAMX"}
@@ -0,0 +1,10 @@
1
+ import { createAztecNodeClient, createCompatibleClient } from '@aztec/aztec.js';
2
+ import { inspectBlock } from '../../utils/inspect.js';
3
+ export async function getBlock(pxeUrl, nodeUrl, maybeBlockNumber, debugLogger, log) {
4
+ const client = await createCompatibleClient(pxeUrl, debugLogger);
5
+ const aztecNode = createAztecNodeClient(nodeUrl);
6
+ const blockNumber = maybeBlockNumber ?? await aztecNode.getBlockNumber();
7
+ await inspectBlock(client, aztecNode, blockNumber, log, {
8
+ showTxs: true
9
+ });
10
+ }
@@ -0,0 +1,4 @@
1
+ import { type AztecAddress, type Fr } from '@aztec/aztec.js';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+ export declare function getL1ToL2MessageWitness(nodeUrl: string, contractAddress: AztecAddress, messageHash: Fr, secret: Fr, log: LogFn): Promise<void>;
4
+ //# sourceMappingURL=get_l1_to_l2_message_witness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_l1_to_l2_message_witness.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_l1_to_l2_message_witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,EAAyB,MAAM,iBAAiB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,EACV,GAAG,EAAE,KAAK,iBAeX"}
@@ -0,0 +1,12 @@
1
+ import { createAztecNodeClient } from '@aztec/aztec.js';
2
+ import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/stdlib/messaging';
3
+ export async function getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log) {
4
+ const node = createAztecNodeClient(nodeUrl);
5
+ const messageWitness = await getNonNullifiedL1ToL2MessageWitness(node, contractAddress, messageHash, secret);
6
+ log(messageWitness === undefined ? `
7
+ L1 to L2 Message not found.
8
+ ` : `
9
+ L1 to L2 message index: ${messageWitness[0]}
10
+ L1 to L2 message sibling path: ${messageWitness[1]}
11
+ `);
12
+ }
@@ -1,4 +1,4 @@
1
1
  import type { AztecAddress, LogId, TxHash } from '@aztec/aztec.js';
2
- import type { LogFn, Logger } from '@aztec/foundation/log';
3
- export declare function getLogs(txHash: TxHash, fromBlock: number, toBlock: number, afterLog: LogId, contractAddress: AztecAddress, rpcUrl: string, follow: boolean, debugLogger: Logger, log: LogFn): Promise<void>;
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+ export declare function getLogs(txHash: TxHash, fromBlock: number, toBlock: number, afterLog: LogId, contractAddress: AztecAddress, nodeUrl: string, follow: boolean, log: LogFn): Promise<void>;
4
4
  //# sourceMappingURL=get_logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_logs.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,KAAK,EACf,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,KAAK,iBAmDX"}
@@ -1,7 +1,7 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
1
+ import { createAztecNodeClient } from '@aztec/aztec.js';
2
2
  import { sleep } from '@aztec/foundation/sleep';
3
- export async function getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow, debugLogger, log) {
4
- const pxe = await createCompatibleClient(rpcUrl, debugLogger);
3
+ export async function getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log) {
4
+ const node = createAztecNodeClient(nodeUrl);
5
5
  if (follow) {
6
6
  if (txHash) {
7
7
  throw Error('Cannot use --follow with --tx-hash');
@@ -18,7 +18,7 @@ export async function getLogs(txHash, fromBlock, toBlock, afterLog, contractAddr
18
18
  contractAddress
19
19
  };
20
20
  const fetchLogs = async ()=>{
21
- const response = await pxe.getPublicLogs(filter);
21
+ const response = await node.getPublicLogs(filter);
22
22
  const logs = response.logs;
23
23
  if (!logs.length) {
24
24
  const filterOptions = Object.entries(filter).filter(([, value])=>value !== undefined).map(([key, value])=>`${key}: ${value}`).join(', ');
@@ -0,0 +1,4 @@
1
+ import type { LogFn, Logger } from '@aztec/foundation/log';
2
+ import type { Command } from 'commander';
3
+ export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAqD/E"}
@@ -0,0 +1,20 @@
1
+ import { nodeOption, parseAztecAddress, parseField, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash, pxeOption } from '../../utils/commands.js';
2
+ export function injectCommands(program, log, debugLogger) {
3
+ program.command('get-block').description('Gets info for a given block or latest.').argument('[blockNumber]', 'Block height', parseOptionalInteger).addOption(pxeOption).addOption(nodeOption).action(async (blockNumber, options)=>{
4
+ const { getBlock } = await import('./get_block.js');
5
+ await getBlock(options.rpcUrl, options.nodeUrl, blockNumber, debugLogger, log);
6
+ });
7
+ program.command('get-l1-to-l2-message-witness').description('Gets a L1 to L2 message witness.').requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress).requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField).requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField).addOption(nodeOption).action(async ({ contractAddress, messageHash, secret, nodeUrl })=>{
8
+ const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
9
+ await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
10
+ });
11
+ program.command('get-logs').description('Gets all the public logs from an intersection of all the filter params.').option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash).option('-fb, --from-block <blockNum>', 'Initial block number for getting logs (defaults to 1).', parseOptionalInteger).option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger).option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId).option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress).addOption(nodeOption).option('--follow', 'If set, will keep polling for new logs until interrupted.').action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow })=>{
12
+ const { getLogs } = await import('./get_logs.js');
13
+ await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
14
+ });
15
+ program.command('block-number').description('Gets the current Aztec L2 block number.').addOption(nodeOption).action(async (options)=>{
16
+ const { blockNumber } = await import('./block_number.js');
17
+ await blockNumber(options.nodeUrl, log);
18
+ });
19
+ return program;
20
+ }
@@ -1,3 +1,3 @@
1
1
  import type { LogFn, Logger } from '@aztec/foundation/log';
2
- export declare function bootstrapNetwork(pxeUrl: string, l1Urls: string[], l1ChainId: string, l1PrivateKey: `0x${string}` | undefined, l1Mnemonic: string, addressIndex: number, json: boolean, log: LogFn, debugLog: Logger): Promise<void>;
2
+ export declare function bootstrapNetwork(pxeUrl: string, nodeUrl: string, l1Urls: string[], l1ChainId: string, l1PrivateKey: `0x${string}` | undefined, l1Mnemonic: string, addressIndex: number, json: boolean, log: LogFn, debugLog: Logger): Promise<void>;
3
3
  //# sourceMappingURL=bootstrap_network.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAsB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBAsFjB"}
1
+ {"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAsB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBAuFjB"}
@@ -1,5 +1,5 @@
1
1
  import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
- import { BatchCall, Fr, L1FeeJuicePortalManager, createCompatibleClient, retryUntil, waitForProven } from '@aztec/aztec.js';
2
+ import { BatchCall, Fr, L1FeeJuicePortalManager, createAztecNodeClient, createCompatibleClient, retryUntil, waitForProven } from '@aztec/aztec.js';
3
3
  import { createEthereumChain, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
4
4
  import { TestWallet } from '@aztec/test-wallet';
5
5
  import { getContract } from 'viem';
@@ -12,8 +12,9 @@ const provenWaitOpts = {
12
12
  provenTimeout: 4800,
13
13
  interval: 1
14
14
  };
15
- export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey, l1Mnemonic, addressIndex, json, log, debugLog) {
15
+ export async function bootstrapNetwork(pxeUrl, nodeUrl, l1Urls, l1ChainId, l1PrivateKey, l1Mnemonic, addressIndex, json, log, debugLog) {
16
16
  const pxe = await createCompatibleClient(pxeUrl, debugLog);
17
+ const node = createAztecNodeClient(nodeUrl);
17
18
  const wallet = new TestWallet(pxe);
18
19
  // We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
19
20
  // so all we need to do is register them to our pxe.
@@ -30,7 +31,7 @@ export async function bootstrapNetwork(pxeUrl, l1Urls, l1ChainId, l1PrivateKey,
30
31
  const fpcAdmin = defaultAccountAddress;
31
32
  const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
32
33
  const counter = await deployCounter(wallet, defaultAccountAddress);
33
- await fundFPC(pxe, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
34
+ await fundFPC(pxe, node, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
34
35
  if (json) {
35
36
  log(JSON.stringify({
36
37
  devCoinL1: erc20Address.toString(),
@@ -184,7 +185,7 @@ async function deployCounter(wallet, defaultAccountAddress) {
184
185
  return info;
185
186
  }
186
187
  // NOTE: Disabling for now in order to get devnet running
187
- async function fundFPC(pxe, counterAddress, wallet, defaultAccountAddress, l1Client, fpcAddress, debugLog) {
188
+ async function fundFPC(pxe, node, counterAddress, wallet, defaultAccountAddress, l1Client, fpcAddress, debugLog) {
188
189
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
189
190
  // @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
190
191
  const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
@@ -195,7 +196,7 @@ async function fundFPC(pxe, counterAddress, wallet, defaultAccountAddress, l1Cli
195
196
  const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
196
197
  const feeJuicePortal = await L1FeeJuicePortalManager.new(pxe, l1Client, debugLog);
197
198
  const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(fpcAddress, undefined, true);
198
- await retryUntil(async ()=>await pxe.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)), 'message sync', 600, 1);
199
+ await retryUntil(async ()=>await node.getL1ToL2MessageBlock(Fr.fromHexString(messageHash)) !== undefined, 'message sync', 600, 1);
199
200
  const counter = await CounterContract.at(counterAddress, wallet);
200
201
  debugLog.info('Incrementing Counter');
201
202
  // TODO (alexg) remove this once sequencer builds blocks continuously
@@ -212,6 +213,6 @@ async function fundFPC(pxe, counterAddress, wallet, defaultAccountAddress, l1Cli
212
213
  }).wait({
213
214
  ...waitOpts
214
215
  });
215
- await waitForProven(pxe, receipt, provenWaitOpts);
216
+ await waitForProven(node, receipt, provenWaitOpts);
216
217
  debugLog.info('Finished claiming FPC');
217
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAqD/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAuD/E"}
@@ -1,10 +1,10 @@
1
- import { ETHEREUM_HOSTS, l1ChainIdOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
1
+ import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
2
2
  export function injectCommands(program, log, debugLogger) {
3
- program.command('bootstrap-network').description('Bootstrap a new network').addOption(pxeOption).addOption(l1ChainIdOption).requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
3
+ program.command('bootstrap-network').description('Bootstrap a new network').addOption(pxeOption).addOption(nodeOption).addOption(l1ChainIdOption).requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
4
4
  ETHEREUM_HOSTS
5
5
  ]).option('--l1-private-key <string>', 'The private key to use for deployment', process.env.PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-ai, --address-index <number>', 'The address index to use when calculating an address', (arg)=>BigInt(arg), 0n).option('--json', 'Output the result as JSON').action(async (options)=>{
6
6
  const { bootstrapNetwork } = await import('./bootstrap_network.js');
7
- await bootstrapNetwork(options[pxeOption.attributeName()], options.l1RpcUrls, options[l1ChainIdOption.attributeName()], options.l1PrivateKey, options.mnemonic, options.addressIndex, options.json, log, debugLogger);
7
+ await bootstrapNetwork(options[pxeOption.attributeName()], options[nodeOption.attributeName()], options.l1RpcUrls, options[l1ChainIdOption.attributeName()], options.l1PrivateKey, options.mnemonic, options.addressIndex, options.json, log, debugLogger);
8
8
  });
9
9
  program.command('drip-faucet').description('Drip the faucet').requiredOption('-u, --faucet-url <string>', 'Url of the faucet', 'http://localhost:8082').requiredOption('-t, --token <string>', 'The asset to drip', 'eth').requiredOption('-a, --address <string>', 'The Ethereum address to drip to', parseEthereumAddress).option('--json', 'Output the result as JSON').action(async (options)=>{
10
10
  const { dripFaucet } = await import('./faucet.js');
@@ -1,3 +1,3 @@
1
1
  import type { LogFn } from '@aztec/foundation/log';
2
- export declare function assumeProvenThrough(blockNumberOrLatest: number | undefined, l1RpcUrls: string[], rpcUrl: string, log: LogFn): Promise<void>;
2
+ export declare function assumeProvenThrough(blockNumberOrLatest: number | undefined, l1RpcUrls: string[], nodeUrl: string, log: LogFn): Promise<void>;
3
3
  //# sourceMappingURL=assume_proven_through.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assume_proven_through.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/assume_proven_through.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,mBAAmB,CACvC,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,iBAUX"}
1
+ {"version":3,"file":"assume_proven_through.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/assume_proven_through.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,mBAAmB,CACvC,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,KAAK,iBAUX"}
@@ -1,9 +1,9 @@
1
- import { createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { createAztecNodeClient } from '@aztec/aztec.js';
2
2
  import { RollupCheatCodes } from '@aztec/ethereum/test';
3
- export async function assumeProvenThrough(blockNumberOrLatest, l1RpcUrls, rpcUrl, log) {
4
- const pxe = createPXEClient(rpcUrl, {}, makeFetch([], true));
5
- const rollupAddress = await pxe.getNodeInfo().then((i)=>i.l1ContractAddresses.rollupAddress);
6
- const blockNumber = blockNumberOrLatest ?? await pxe.getBlockNumber();
3
+ export async function assumeProvenThrough(blockNumberOrLatest, l1RpcUrls, nodeUrl, log) {
4
+ const aztecNode = createAztecNodeClient(nodeUrl);
5
+ const rollupAddress = await aztecNode.getNodeInfo().then((i)=>i.l1ContractAddresses.rollupAddress);
6
+ const blockNumber = blockNumberOrLatest ?? await aztecNode.getBlockNumber();
7
7
  const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, {
8
8
  rollupAddress
9
9
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAcjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAkhB/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAejD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAkhB/E"}
@@ -1,7 +1,7 @@
1
1
  import { EthAddress } from '@aztec/foundation/eth-address';
2
2
  import { Option } from 'commander';
3
3
  import { getL1RollupAddressFromEnv } from '../../config/get_l1_config.js';
4
- import { ETHEREUM_HOSTS, MNEMONIC, PRIVATE_KEY, l1ChainIdOption, parseAztecAddress, parseBigint, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
4
+ import { ETHEREUM_HOSTS, MNEMONIC, PRIVATE_KEY, l1ChainIdOption, nodeOption, parseAztecAddress, parseBigint, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
5
5
  export { addL1Validator } from './update_l1_validators.js';
6
6
  const l1RpcUrlsOption = new Option('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)').env('ETHEREUM_HOSTS').default([
7
7
  ETHEREUM_HOSTS
@@ -186,9 +186,9 @@ export function injectCommands(program, log, debugLogger) {
186
186
  });
187
187
  program.command('set-proven-through', {
188
188
  hidden: true
189
- }).description('Instructs the L1 rollup contract to assume all blocks until the given number are automatically proven.').argument('[blockNumber]', 'The target block number, defaults to the latest pending block number.', parseBigint).addOption(l1RpcUrlsOption).addOption(pxeOption).action(async (blockNumber, options)=>{
189
+ }).description('Instructs the L1 rollup contract to assume all blocks until the given number are automatically proven.').argument('[blockNumber]', 'The target block number, defaults to the latest pending block number.', parseBigint).addOption(l1RpcUrlsOption).addOption(nodeOption).action(async (blockNumber, options)=>{
190
190
  const { assumeProvenThrough } = await import('./assume_proven_through.js');
191
- await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.rpcUrl, log);
191
+ await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.nodeUrl, log);
192
192
  });
193
193
  program.command('advance-epoch').description('Use L1 cheat codes to warp time until the next epoch.').addOption(l1RpcUrlsOption).addOption(pxeOption).action(async (options)=>{
194
194
  const { advanceEpoch } = await import('./advance_epoch.js');
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAqJ/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAmG/E"}
@@ -1,14 +1,10 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
- import { logJson, makePxeOption, parseAztecAddress, parseEthereumAddress, parseField, parseFieldFromHexString, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash, parsePublicKey, pxeOption } from '../../utils/commands.js';
2
+ import { logJson, makePxeOption, parseAztecAddress, parseEthereumAddress, parseFieldFromHexString, parsePublicKey, pxeOption } from '../../utils/commands.js';
3
3
  export function injectCommands(program, log, debugLogger) {
4
4
  program.command('add-contract').description('Adds an existing contract to the PXE. This is useful if you have deployed a contract outside of the PXE and want to use it with the PXE.').requiredOption('-c, --contract-artifact <fileLocation>', "A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts.js").requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress).requiredOption('--init-hash <init hash>', 'Initialization hash', parseFieldFromHexString).option('--salt <salt>', 'Optional deployment salt', parseFieldFromHexString).option('-p, --public-key <public key>', 'Optional public key for this contract', parsePublicKey).option('--portal-address <address>', 'Optional address to a portal contract on L1', parseEthereumAddress).option('--deployer-address <address>', 'Optional address of the contract deployer', parseAztecAddress).addOption(pxeOption).action(async (options)=>{
5
5
  const { addContract } = await import('./add_contract.js');
6
6
  await addContract(options.rpcUrl, options.contractArtifact, options.contractAddress, options.initHash, options.salt ?? Fr.ZERO, options.publicKey, options.deployerAddress, debugLogger, log);
7
7
  });
8
- program.command('get-block').description('Gets info for a given block or latest.').argument('[blockNumber]', 'Block height', parseOptionalInteger).addOption(pxeOption).action(async (blockNumber, options)=>{
9
- const { getBlock } = await import('./get_block.js');
10
- await getBlock(options.rpcUrl, blockNumber, debugLogger, log);
11
- });
12
8
  program.command('get-current-base-fee').description('Gets the current base fee.').addOption(pxeOption).action(async (options)=>{
13
9
  const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
14
10
  await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
@@ -17,10 +13,6 @@ export function injectCommands(program, log, debugLogger) {
17
13
  const { getContractData } = await import('./get_contract_data.js');
18
14
  await getContractData(options.rpcUrl, contractAddress, options.includeBytecode, debugLogger, log);
19
15
  });
20
- program.command('get-logs').description('Gets all the public logs from an intersection of all the filter params.').option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash).option('-fb, --from-block <blockNum>', 'Initial block number for getting logs (defaults to 1).', parseOptionalInteger).option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger).option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId).option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress).addOption(pxeOption).option('--follow', 'If set, will keep polling for new logs until interrupted.').action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow })=>{
21
- const { getLogs } = await import('./get_logs.js');
22
- await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow, debugLogger, log);
23
- });
24
16
  program.command('get-accounts').description('Gets all the Aztec accounts stored in the PXE.').addOption(pxeOption).option('--json', 'Emit output as json').action(async (options)=>{
25
17
  const { getAccounts } = await import('./get_accounts.js');
26
18
  await getAccounts(options.rpcUrl, options.json, debugLogger, log, logJson(log));
@@ -29,14 +21,6 @@ export function injectCommands(program, log, debugLogger) {
29
21
  const { getAccount } = await import('./get_account.js');
30
22
  await getAccount(address, options.rpcUrl, debugLogger, log);
31
23
  });
32
- program.command('block-number').description('Gets the current Aztec L2 block number.').addOption(pxeOption).action(async (options)=>{
33
- const { blockNumber } = await import('./block_number.js');
34
- await blockNumber(options.rpcUrl, debugLogger, log);
35
- });
36
- program.command('get-l1-to-l2-message-witness').description('Gets a L1 to L2 message witness.').requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress).requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField).requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField).addOption(pxeOption).action(async ({ contractAddress, messageHash, secret, rpcUrl })=>{
37
- const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
38
- await getL1ToL2MessageWitness(rpcUrl, contractAddress, messageHash, secret, debugLogger, log);
39
- });
40
24
  program.command('get-node-info').description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.').option('--node-url <string>', 'URL of the node.').option('--json', 'Emit output as json').addOption(makePxeOption(false)).action(async (options)=>{
41
25
  const { getNodeInfo } = await import('./get_node_info.js');
42
26
  let url;
@@ -38,9 +38,9 @@ export const stagingIgnitionL2ChainConfig = {
38
38
  sponsoredFPC: false,
39
39
  p2pEnabled: true,
40
40
  p2pBootstrapNodes: [],
41
- registryAddress: '0xf299347e765cfb27f913bde8e4983fd0f195676f',
42
- slashFactoryAddress: '',
43
- feeAssetHandlerAddress: '',
41
+ registryAddress: '0xa2ed20f46dc58e5af6035ec61d463ac85a6d52d3',
42
+ slashFactoryAddress: '0x2c03d596f4b5f0c1d0d2dbf92a5964dfc658763c',
43
+ feeAssetHandlerAddress: '0x48be40187f2932bd14cd4d111fba26646da96c36',
44
44
  seqMinTxsPerBlock: 0,
45
45
  seqMaxTxsPerBlock: 0,
46
46
  realProofs: true,
@@ -18,6 +18,8 @@ export declare const ETHEREUM_HOSTS: string, PRIVATE_KEY: string | undefined, MN
18
18
  export declare function addOptions(program: Command, options: Option[]): Command;
19
19
  export declare const makePxeOption: (mandatory: boolean) => Option;
20
20
  export declare const pxeOption: Option;
21
+ export declare const makeNodeOption: (mandatory: boolean) => Option;
22
+ export declare const nodeOption: Option;
21
23
  export declare const l1ChainIdOption: Option;
22
24
  export declare const createSecretKeyOption: (description: string, mandatory: boolean, argsParser?: (value: string, previous: Fr) => Fr) => Option;
23
25
  export declare const logJson: (log: LogFn) => (obj: object) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/utils/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,OAAO,EAAwC,MAAM,EAAE,MAAM,WAAW,CAAC;AAIvF;;;GAGG;AACH,eAAO,MAAM,YAAY,uBAGI,CAAC;AAE9B,eAAO,MAAM,SAAS,QAAuB,CAAC;AAC9C,eAAO,MAAQ,cAAc,UAA+B,WAAW,sBAAE,QAAQ,sBAAE,OAAO,sBAAE,WAAW,oBAAgB,CAAC;AAExH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAG7D;AAED,eAAO,MAAM,aAAa,GAAI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B,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAMhE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAKnF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAKnE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CASpF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAStE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKtE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CASxE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,EAAE,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,EAAE,CAMpD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,EAAE,CAyB5C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAcjE"}
@@ -20,6 +20,8 @@ export function addOptions(program, options) {
20
20
  }
21
21
  export const makePxeOption = (mandatory)=>new Option('-u, --rpc-url <string>', 'URL of the PXE').env('PXE_URL').default(`http://${LOCALHOST}:8080`).conflicts('remote-pxe').makeOptionMandatory(mandatory);
22
22
  export const pxeOption = makePxeOption(true);
23
+ export const makeNodeOption = (mandatory)=>new Option('-n, --node-url <string>', 'URL of the Aztec node').env('AZTEC_NODE_URL').default(`http://${LOCALHOST}:8079`).makeOptionMandatory(mandatory);
24
+ export const nodeOption = makeNodeOption(true);
23
25
  export const l1ChainIdOption = new Option('-c, --l1-chain-id <number>', 'Chain ID of the ethereum host').env('L1_CHAIN_ID').default(31337).argParser((value)=>{
24
26
  const parsedValue = Number(value);
25
27
  if (isNaN(parsedValue)) {
@@ -1,11 +1,11 @@
1
1
  import type { ContractArtifact, Fr } from '@aztec/aztec.js';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
- import type { PXE } from '@aztec/stdlib/interfaces/client';
3
+ import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
4
4
  import type { TxHash } from '@aztec/stdlib/tx';
5
- export declare function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, opts?: {
5
+ export declare function inspectBlock(pxe: PXE, aztecNode: AztecNode, blockNumber: number, log: LogFn, opts?: {
6
6
  showTxs?: boolean;
7
7
  }): Promise<void>;
8
- export declare function inspectTx(pxe: PXE, txHash: TxHash, log: LogFn, opts?: {
8
+ export declare function inspectTx(pxe: PXE, aztecNode: AztecNode, txHash: TxHash, log: LogFn, opts?: {
9
9
  includeBlockInfo?: boolean;
10
10
  artifactMap?: ArtifactMap;
11
11
  }): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,M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AC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAO,iBA8FrE;AAuCD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;AAC/D,KAAK,2BAA2B,GAAG,gBAAgB,GAAG;IAAE,OAAO,EAAE,EAAE,CAAA;CAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
2
2
  import { siloNullifier } from '@aztec/stdlib/hash';
3
- export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
4
- const block = await pxe.getBlock(blockNumber);
3
+ export async function inspectBlock(pxe, aztecNode, blockNumber, log, opts = {}) {
4
+ const block = await aztecNode.getBlock(blockNumber);
5
5
  if (!block) {
6
6
  log(`No block found for block number ${blockNumber}`);
7
7
  return;
@@ -18,7 +18,7 @@ export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
18
18
  log(``);
19
19
  const artifactMap = await getKnownArtifacts(pxe);
20
20
  for (const txHash of block.body.txEffects.map((tx)=>tx.txHash)){
21
- await inspectTx(pxe, txHash, log, {
21
+ await inspectTx(pxe, aztecNode, txHash, log, {
22
22
  includeBlockInfo: false,
23
23
  artifactMap
24
24
  });
@@ -27,10 +27,10 @@ export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
27
27
  log(` Transactions: ${block.body.txEffects.length}`);
28
28
  }
29
29
  }
30
- export async function inspectTx(pxe, txHash, log, opts = {}) {
30
+ export async function inspectTx(pxe, aztecNode, txHash, log, opts = {}) {
31
31
  const [receipt, effectsInBlock] = await Promise.all([
32
- pxe.getTxReceipt(txHash),
33
- pxe.getTxEffect(txHash)
32
+ aztecNode.getTxReceipt(txHash),
33
+ aztecNode.getTxEffect(txHash)
34
34
  ]);
35
35
  // Base tx data
36
36
  log(`Tx ${txHash.toString()}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "3.0.0-nightly.20250918",
3
+ "version": "3.0.0-nightly.20250919",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./contracts": "./dest/cmds/contracts/index.js",
@@ -8,6 +8,7 @@
8
8
  "./infrastructure": "./dest/cmds/infrastructure/index.js",
9
9
  "./l1": "./dest/cmds/l1/index.js",
10
10
  "./pxe": "./dest/cmds/pxe/index.js",
11
+ "./aztec_node": "./dest/cmds/aztec_node/index.js",
11
12
  "./cli-utils": "./dest/utils/index.js",
12
13
  "./misc": "./dest/cmds/misc/index.js",
13
14
  "./setup-contracts": "./dest/cmds/misc/setup_contracts.js",
@@ -70,20 +71,20 @@
70
71
  ]
71
72
  },
72
73
  "dependencies": {
73
- "@aztec/accounts": "3.0.0-nightly.20250918",
74
- "@aztec/archiver": "3.0.0-nightly.20250918",
75
- "@aztec/aztec.js": "3.0.0-nightly.20250918",
76
- "@aztec/constants": "3.0.0-nightly.20250918",
77
- "@aztec/entrypoints": "3.0.0-nightly.20250918",
78
- "@aztec/ethereum": "3.0.0-nightly.20250918",
79
- "@aztec/foundation": "3.0.0-nightly.20250918",
80
- "@aztec/l1-artifacts": "3.0.0-nightly.20250918",
81
- "@aztec/node-lib": "3.0.0-nightly.20250918",
82
- "@aztec/p2p": "3.0.0-nightly.20250918",
83
- "@aztec/protocol-contracts": "3.0.0-nightly.20250918",
84
- "@aztec/stdlib": "3.0.0-nightly.20250918",
85
- "@aztec/test-wallet": "3.0.0-nightly.20250918",
86
- "@aztec/world-state": "3.0.0-nightly.20250918",
74
+ "@aztec/accounts": "3.0.0-nightly.20250919",
75
+ "@aztec/archiver": "3.0.0-nightly.20250919",
76
+ "@aztec/aztec.js": "3.0.0-nightly.20250919",
77
+ "@aztec/constants": "3.0.0-nightly.20250919",
78
+ "@aztec/entrypoints": "3.0.0-nightly.20250919",
79
+ "@aztec/ethereum": "3.0.0-nightly.20250919",
80
+ "@aztec/foundation": "3.0.0-nightly.20250919",
81
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250919",
82
+ "@aztec/node-lib": "3.0.0-nightly.20250919",
83
+ "@aztec/p2p": "3.0.0-nightly.20250919",
84
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250919",
85
+ "@aztec/stdlib": "3.0.0-nightly.20250919",
86
+ "@aztec/test-wallet": "3.0.0-nightly.20250919",
87
+ "@aztec/world-state": "3.0.0-nightly.20250919",
87
88
  "@iarna/toml": "^2.2.5",
88
89
  "@libp2p/peer-id-factory": "^3.0.4",
89
90
  "commander": "^12.1.0",
@@ -110,15 +111,15 @@
110
111
  "typescript": "^5.3.3"
111
112
  },
112
113
  "peerDependencies": {
113
- "@aztec/accounts": "3.0.0-nightly.20250918",
114
- "@aztec/bb-prover": "3.0.0-nightly.20250918",
115
- "@aztec/ethereum": "3.0.0-nightly.20250918",
116
- "@aztec/l1-artifacts": "3.0.0-nightly.20250918",
117
- "@aztec/noir-contracts.js": "3.0.0-nightly.20250918",
118
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250918",
119
- "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250918",
120
- "@aztec/protocol-contracts": "3.0.0-nightly.20250918",
121
- "@aztec/stdlib": "3.0.0-nightly.20250918"
114
+ "@aztec/accounts": "3.0.0-nightly.20250919",
115
+ "@aztec/bb-prover": "3.0.0-nightly.20250919",
116
+ "@aztec/ethereum": "3.0.0-nightly.20250919",
117
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250919",
118
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20250919",
119
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250919",
120
+ "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250919",
121
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250919",
122
+ "@aztec/stdlib": "3.0.0-nightly.20250919"
122
123
  },
123
124
  "files": [
124
125
  "dest",
@@ -0,0 +1,9 @@
1
+ import { createAztecNodeClient } from '@aztec/aztec.js';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+
4
+ export async function blockNumber(nodeUrl: string, log: LogFn) {
5
+ const aztecNode = createAztecNodeClient(nodeUrl);
6
+ const [latestNum, provenNum] = await Promise.all([aztecNode.getBlockNumber(), aztecNode.getProvenBlockNumber()]);
7
+ log(`Latest block: ${latestNum}`);
8
+ log(`Proven block: ${provenNum}`);
9
+ }
@@ -0,0 +1,17 @@
1
+ import { createAztecNodeClient, createCompatibleClient } from '@aztec/aztec.js';
2
+ import type { LogFn, Logger } from '@aztec/foundation/log';
3
+
4
+ import { inspectBlock } from '../../utils/inspect.js';
5
+
6
+ export async function getBlock(
7
+ pxeUrl: string,
8
+ nodeUrl: string,
9
+ maybeBlockNumber: number | undefined,
10
+ debugLogger: Logger,
11
+ log: LogFn,
12
+ ) {
13
+ const client = await createCompatibleClient(pxeUrl, debugLogger);
14
+ const aztecNode = createAztecNodeClient(nodeUrl);
15
+ const blockNumber = maybeBlockNumber ?? (await aztecNode.getBlockNumber());
16
+ await inspectBlock(client, aztecNode, blockNumber, log, { showTxs: true });
17
+ }
@@ -0,0 +1,25 @@
1
+ import { type AztecAddress, type Fr, createAztecNodeClient } from '@aztec/aztec.js';
2
+ import type { LogFn } from '@aztec/foundation/log';
3
+ import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/stdlib/messaging';
4
+
5
+ export async function getL1ToL2MessageWitness(
6
+ nodeUrl: string,
7
+ contractAddress: AztecAddress,
8
+ messageHash: Fr,
9
+ secret: Fr,
10
+ log: LogFn,
11
+ ) {
12
+ const node = createAztecNodeClient(nodeUrl);
13
+ const messageWitness = await getNonNullifiedL1ToL2MessageWitness(node, contractAddress, messageHash, secret);
14
+
15
+ log(
16
+ messageWitness === undefined
17
+ ? `
18
+ L1 to L2 Message not found.
19
+ `
20
+ : `
21
+ L1 to L2 message index: ${messageWitness[0]}
22
+ L1 to L2 message sibling path: ${messageWitness[1]}
23
+ `,
24
+ );
25
+ }
@@ -1,6 +1,6 @@
1
1
  import type { AztecAddress, LogFilter, LogId, TxHash } from '@aztec/aztec.js';
2
- import { createCompatibleClient } from '@aztec/aztec.js';
3
- import type { LogFn, Logger } from '@aztec/foundation/log';
2
+ import { createAztecNodeClient } from '@aztec/aztec.js';
3
+ import type { LogFn } from '@aztec/foundation/log';
4
4
  import { sleep } from '@aztec/foundation/sleep';
5
5
 
6
6
  export async function getLogs(
@@ -9,12 +9,11 @@ export async function getLogs(
9
9
  toBlock: number,
10
10
  afterLog: LogId,
11
11
  contractAddress: AztecAddress,
12
- rpcUrl: string,
12
+ nodeUrl: string,
13
13
  follow: boolean,
14
- debugLogger: Logger,
15
14
  log: LogFn,
16
15
  ) {
17
- const pxe = await createCompatibleClient(rpcUrl, debugLogger);
16
+ const node = createAztecNodeClient(nodeUrl);
18
17
 
19
18
  if (follow) {
20
19
  if (txHash) {
@@ -28,7 +27,7 @@ export async function getLogs(
28
27
  const filter: LogFilter = { txHash, fromBlock, toBlock, afterLog, contractAddress };
29
28
 
30
29
  const fetchLogs = async () => {
31
- const response = await pxe.getPublicLogs(filter);
30
+ const response = await node.getPublicLogs(filter);
32
31
  const logs = response.logs;
33
32
 
34
33
  if (!logs.length) {
@@ -0,0 +1,69 @@
1
+ import type { LogFn, Logger } from '@aztec/foundation/log';
2
+
3
+ import type { Command } from 'commander';
4
+
5
+ import {
6
+ nodeOption,
7
+ parseAztecAddress,
8
+ parseField,
9
+ parseOptionalAztecAddress,
10
+ parseOptionalInteger,
11
+ parseOptionalLogId,
12
+ parseOptionalTxHash,
13
+ pxeOption,
14
+ } from '../../utils/commands.js';
15
+
16
+ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
17
+ program
18
+ .command('get-block')
19
+ .description('Gets info for a given block or latest.')
20
+ .argument('[blockNumber]', 'Block height', parseOptionalInteger)
21
+ .addOption(pxeOption)
22
+ .addOption(nodeOption)
23
+ .action(async (blockNumber, options) => {
24
+ const { getBlock } = await import('./get_block.js');
25
+ await getBlock(options.rpcUrl, options.nodeUrl, blockNumber, debugLogger, log);
26
+ });
27
+
28
+ program
29
+ .command('get-l1-to-l2-message-witness')
30
+ .description('Gets a L1 to L2 message witness.')
31
+ .requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
32
+ .requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
33
+ .requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
34
+ .addOption(nodeOption)
35
+ .action(async ({ contractAddress, messageHash, secret, nodeUrl }) => {
36
+ const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
37
+ await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
38
+ });
39
+
40
+ program
41
+ .command('get-logs')
42
+ .description('Gets all the public logs from an intersection of all the filter params.')
43
+ .option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
44
+ .option(
45
+ '-fb, --from-block <blockNum>',
46
+ 'Initial block number for getting logs (defaults to 1).',
47
+ parseOptionalInteger,
48
+ )
49
+ .option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
50
+ .option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
51
+ .option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
52
+ .addOption(nodeOption)
53
+ .option('--follow', 'If set, will keep polling for new logs until interrupted.')
54
+ .action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow }) => {
55
+ const { getLogs } = await import('./get_logs.js');
56
+ await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
57
+ });
58
+
59
+ program
60
+ .command('block-number')
61
+ .description('Gets the current Aztec L2 block number.')
62
+ .addOption(nodeOption)
63
+ .action(async (options: any) => {
64
+ const { blockNumber } = await import('./block_number.js');
65
+ await blockNumber(options.nodeUrl, log);
66
+ });
67
+
68
+ return program;
69
+ }
@@ -1,6 +1,7 @@
1
1
  import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
2
  import {
3
3
  AztecAddress,
4
+ type AztecNode,
4
5
  BatchCall,
5
6
  EthAddress,
6
7
  Fr,
@@ -9,6 +10,7 @@ import {
9
10
  type WaitForProvenOpts,
10
11
  type WaitOpts,
11
12
  type Wallet,
13
+ createAztecNodeClient,
12
14
  createCompatibleClient,
13
15
  retryUntil,
14
16
  waitForProven,
@@ -44,6 +46,7 @@ const provenWaitOpts: WaitForProvenOpts = {
44
46
 
45
47
  export async function bootstrapNetwork(
46
48
  pxeUrl: string,
49
+ nodeUrl: string,
47
50
  l1Urls: string[],
48
51
  l1ChainId: string,
49
52
  l1PrivateKey: `0x${string}` | undefined,
@@ -54,6 +57,7 @@ export async function bootstrapNetwork(
54
57
  debugLog: Logger,
55
58
  ) {
56
59
  const pxe = await createCompatibleClient(pxeUrl, debugLog);
60
+ const node = createAztecNodeClient(nodeUrl);
57
61
  const wallet = new TestWallet(pxe);
58
62
 
59
63
  // We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
@@ -88,7 +92,7 @@ export async function bootstrapNetwork(
88
92
 
89
93
  const counter = await deployCounter(wallet, defaultAccountAddress);
90
94
 
91
- await fundFPC(pxe, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
95
+ await fundFPC(pxe, node, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
92
96
 
93
97
  if (json) {
94
98
  log(
@@ -275,6 +279,7 @@ async function deployCounter(wallet: Wallet, defaultAccountAddress: AztecAddress
275
279
  // NOTE: Disabling for now in order to get devnet running
276
280
  async function fundFPC(
277
281
  pxe: PXE,
282
+ node: AztecNode,
278
283
  counterAddress: AztecAddress,
279
284
  wallet: Wallet,
280
285
  defaultAccountAddress: AztecAddress,
@@ -302,7 +307,12 @@ async function fundFPC(
302
307
  true,
303
308
  );
304
309
 
305
- await retryUntil(async () => await pxe.isL1ToL2MessageSynced(Fr.fromHexString(messageHash)), 'message sync', 600, 1);
310
+ await retryUntil(
311
+ async () => (await node.getL1ToL2MessageBlock(Fr.fromHexString(messageHash))) !== undefined,
312
+ 'message sync',
313
+ 600,
314
+ 1,
315
+ );
306
316
 
307
317
  const counter = await CounterContract.at(counterAddress, wallet);
308
318
 
@@ -320,7 +330,7 @@ async function fundFPC(
320
330
  .send({ from: defaultAccountAddress })
321
331
  .wait({ ...waitOpts });
322
332
 
323
- await waitForProven(pxe, receipt, provenWaitOpts);
333
+ await waitForProven(node, receipt, provenWaitOpts);
324
334
 
325
335
  debugLog.info('Finished claiming FPC');
326
336
  }
@@ -2,13 +2,14 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
2
2
 
3
3
  import type { Command } from 'commander';
4
4
 
5
- import { ETHEREUM_HOSTS, l1ChainIdOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
5
+ import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseEthereumAddress, pxeOption } from '../../utils/commands.js';
6
6
 
7
7
  export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
8
8
  program
9
9
  .command('bootstrap-network')
10
10
  .description('Bootstrap a new network')
11
11
  .addOption(pxeOption)
12
+ .addOption(nodeOption)
12
13
  .addOption(l1ChainIdOption)
13
14
  .requiredOption<string[]>(
14
15
  '--l1-rpc-urls <string>',
@@ -33,6 +34,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
33
34
  const { bootstrapNetwork } = await import('./bootstrap_network.js');
34
35
  await bootstrapNetwork(
35
36
  options[pxeOption.attributeName()],
37
+ options[nodeOption.attributeName()],
36
38
  options.l1RpcUrls,
37
39
  options[l1ChainIdOption.attributeName()],
38
40
  options.l1PrivateKey,
@@ -1,16 +1,16 @@
1
- import { createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { createAztecNodeClient } from '@aztec/aztec.js';
2
2
  import { RollupCheatCodes } from '@aztec/ethereum/test';
3
3
  import type { LogFn } from '@aztec/foundation/log';
4
4
 
5
5
  export async function assumeProvenThrough(
6
6
  blockNumberOrLatest: number | undefined,
7
7
  l1RpcUrls: string[],
8
- rpcUrl: string,
8
+ nodeUrl: string,
9
9
  log: LogFn,
10
10
  ) {
11
- const pxe = createPXEClient(rpcUrl, {}, makeFetch([], true));
12
- const rollupAddress = await pxe.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
13
- const blockNumber = blockNumberOrLatest ?? (await pxe.getBlockNumber());
11
+ const aztecNode = createAztecNodeClient(nodeUrl);
12
+ const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
13
+ const blockNumber = blockNumberOrLatest ?? (await aztecNode.getBlockNumber());
14
14
 
15
15
  const rollupCheatCodes = RollupCheatCodes.create(l1RpcUrls, { rollupAddress });
16
16
 
@@ -9,6 +9,7 @@ import {
9
9
  MNEMONIC,
10
10
  PRIVATE_KEY,
11
11
  l1ChainIdOption,
12
+ nodeOption,
12
13
  parseAztecAddress,
13
14
  parseBigint,
14
15
  parseEthereumAddress,
@@ -509,10 +510,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
509
510
  )
510
511
  .argument('[blockNumber]', 'The target block number, defaults to the latest pending block number.', parseBigint)
511
512
  .addOption(l1RpcUrlsOption)
512
- .addOption(pxeOption)
513
+ .addOption(nodeOption)
513
514
  .action(async (blockNumber, options) => {
514
515
  const { assumeProvenThrough } = await import('./assume_proven_through.js');
515
- await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.rpcUrl, log);
516
+ await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.nodeUrl, log);
516
517
  });
517
518
 
518
519
  program
@@ -8,12 +8,7 @@ import {
8
8
  makePxeOption,
9
9
  parseAztecAddress,
10
10
  parseEthereumAddress,
11
- parseField,
12
11
  parseFieldFromHexString,
13
- parseOptionalAztecAddress,
14
- parseOptionalInteger,
15
- parseOptionalLogId,
16
- parseOptionalTxHash,
17
12
  parsePublicKey,
18
13
  pxeOption,
19
14
  } from '../../utils/commands.js';
@@ -50,16 +45,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
50
45
  );
51
46
  });
52
47
 
53
- program
54
- .command('get-block')
55
- .description('Gets info for a given block or latest.')
56
- .argument('[blockNumber]', 'Block height', parseOptionalInteger)
57
- .addOption(pxeOption)
58
- .action(async (blockNumber, options) => {
59
- const { getBlock } = await import('./get_block.js');
60
- await getBlock(options.rpcUrl, blockNumber, debugLogger, log);
61
- });
62
-
63
48
  program
64
49
  .command('get-current-base-fee')
65
50
  .description('Gets the current base fee.')
@@ -80,25 +65,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
80
65
  await getContractData(options.rpcUrl, contractAddress, options.includeBytecode, debugLogger, log);
81
66
  });
82
67
 
83
- program
84
- .command('get-logs')
85
- .description('Gets all the public logs from an intersection of all the filter params.')
86
- .option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
87
- .option(
88
- '-fb, --from-block <blockNum>',
89
- 'Initial block number for getting logs (defaults to 1).',
90
- parseOptionalInteger,
91
- )
92
- .option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
93
- .option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
94
- .option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
95
- .addOption(pxeOption)
96
- .option('--follow', 'If set, will keep polling for new logs until interrupted.')
97
- .action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow }) => {
98
- const { getLogs } = await import('./get_logs.js');
99
- await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, rpcUrl, follow, debugLogger, log);
100
- });
101
-
102
68
  program
103
69
  .command('get-accounts')
104
70
  .description('Gets all the Aztec accounts stored in the PXE.')
@@ -119,27 +85,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
119
85
  await getAccount(address, options.rpcUrl, debugLogger, log);
120
86
  });
121
87
 
122
- program
123
- .command('block-number')
124
- .description('Gets the current Aztec L2 block number.')
125
- .addOption(pxeOption)
126
- .action(async (options: any) => {
127
- const { blockNumber } = await import('./block_number.js');
128
- await blockNumber(options.rpcUrl, debugLogger, log);
129
- });
130
-
131
- program
132
- .command('get-l1-to-l2-message-witness')
133
- .description('Gets a L1 to L2 message witness.')
134
- .requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
135
- .requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
136
- .requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
137
- .addOption(pxeOption)
138
- .action(async ({ contractAddress, messageHash, secret, rpcUrl }) => {
139
- const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
140
- await getL1ToL2MessageWitness(rpcUrl, contractAddress, messageHash, secret, debugLogger, log);
141
- });
142
-
143
88
  program
144
89
  .command('get-node-info')
145
90
  .description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
@@ -76,9 +76,9 @@ export const stagingIgnitionL2ChainConfig: L2ChainConfig = {
76
76
  sponsoredFPC: false,
77
77
  p2pEnabled: true,
78
78
  p2pBootstrapNodes: [],
79
- registryAddress: '0xf299347e765cfb27f913bde8e4983fd0f195676f',
80
- slashFactoryAddress: '',
81
- feeAssetHandlerAddress: '',
79
+ registryAddress: '0xa2ed20f46dc58e5af6035ec61d463ac85a6d52d3',
80
+ slashFactoryAddress: '0x2c03d596f4b5f0c1d0d2dbf92a5964dfc658763c',
81
+ feeAssetHandlerAddress: '0x48be40187f2932bd14cd4d111fba26646da96c36',
82
82
  seqMinTxsPerBlock: 0,
83
83
  seqMaxTxsPerBlock: 0,
84
84
  realProofs: true,
@@ -38,6 +38,14 @@ export const makePxeOption = (mandatory: boolean) =>
38
38
 
39
39
  export const pxeOption = makePxeOption(true);
40
40
 
41
+ export const makeNodeOption = (mandatory: boolean) =>
42
+ new Option('-n, --node-url <string>', 'URL of the Aztec node')
43
+ .env('AZTEC_NODE_URL')
44
+ .default(`http://${LOCALHOST}:8079`)
45
+ .makeOptionMandatory(mandatory);
46
+
47
+ export const nodeOption = makeNodeOption(true);
48
+
41
49
  export const l1ChainIdOption = new Option('-c, --l1-chain-id <number>', 'Chain ID of the ethereum host')
42
50
  .env('L1_CHAIN_ID')
43
51
  .default(31337)
@@ -2,12 +2,18 @@ import type { AztecAddress, ContractArtifact, Fr } from '@aztec/aztec.js';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
3
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
4
4
  import { siloNullifier } from '@aztec/stdlib/hash';
5
- import type { PXE } from '@aztec/stdlib/interfaces/client';
5
+ import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
6
6
  import type { ExtendedNote } from '@aztec/stdlib/note';
7
7
  import type { TxHash } from '@aztec/stdlib/tx';
8
8
 
9
- export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, opts: { showTxs?: boolean } = {}) {
10
- const block = await pxe.getBlock(blockNumber);
9
+ export async function inspectBlock(
10
+ pxe: PXE,
11
+ aztecNode: AztecNode,
12
+ blockNumber: number,
13
+ log: LogFn,
14
+ opts: { showTxs?: boolean } = {},
15
+ ) {
16
+ const block = await aztecNode.getBlock(blockNumber);
11
17
  if (!block) {
12
18
  log(`No block found for block number ${blockNumber}`);
13
19
  return;
@@ -27,7 +33,7 @@ export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, op
27
33
  log(``);
28
34
  const artifactMap = await getKnownArtifacts(pxe);
29
35
  for (const txHash of block.body.txEffects.map(tx => tx.txHash)) {
30
- await inspectTx(pxe, txHash, log, { includeBlockInfo: false, artifactMap });
36
+ await inspectTx(pxe, aztecNode, txHash, log, { includeBlockInfo: false, artifactMap });
31
37
  }
32
38
  } else {
33
39
  log(` Transactions: ${block.body.txEffects.length}`);
@@ -36,11 +42,12 @@ export async function inspectBlock(pxe: PXE, blockNumber: number, log: LogFn, op
36
42
 
37
43
  export async function inspectTx(
38
44
  pxe: PXE,
45
+ aztecNode: AztecNode,
39
46
  txHash: TxHash,
40
47
  log: LogFn,
41
48
  opts: { includeBlockInfo?: boolean; artifactMap?: ArtifactMap } = {},
42
49
  ) {
43
- const [receipt, effectsInBlock] = await Promise.all([pxe.getTxReceipt(txHash), pxe.getTxEffect(txHash)]);
50
+ const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
44
51
  // Base tx data
45
52
  log(`Tx ${txHash.toString()}`);
46
53
  log(` Status: ${receipt.status} ${effectsInBlock ? `(${effectsInBlock.data.revertCode.getDescription()})` : ''}`);
@@ -1,3 +0,0 @@
1
- import type { LogFn, Logger } from '@aztec/foundation/log';
2
- export declare function blockNumber(rpcUrl: string, debugLogger: Logger, log: LogFn): Promise<void>;
3
- //# sourceMappingURL=block_number.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block_number.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/block_number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAKhF"}
@@ -1,10 +0,0 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- export async function blockNumber(rpcUrl, debugLogger, log) {
3
- const client = await createCompatibleClient(rpcUrl, debugLogger);
4
- const [latestNum, provenNum] = await Promise.all([
5
- client.getBlockNumber(),
6
- client.getProvenBlockNumber()
7
- ]);
8
- log(`Latest block: ${latestNum}`);
9
- log(`Proven block: ${provenNum}`);
10
- }
@@ -1,3 +0,0 @@
1
- import type { LogFn, Logger } from '@aztec/foundation/log';
2
- export declare function getBlock(rpcUrl: string, maybeBlockNumber: number | undefined, debugLogger: Logger, log: LogFn): Promise<void>;
3
- //# sourceMappingURL=get_block.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAInH"}
@@ -1,9 +0,0 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import { inspectBlock } from '../../utils/inspect.js';
3
- export async function getBlock(rpcUrl, maybeBlockNumber, debugLogger, log) {
4
- const client = await createCompatibleClient(rpcUrl, debugLogger);
5
- const blockNumber = maybeBlockNumber ?? await client.getBlockNumber();
6
- await inspectBlock(client, blockNumber, log, {
7
- showTxs: true
8
- });
9
- }
@@ -1,4 +0,0 @@
1
- import { type AztecAddress, type Fr } from '@aztec/aztec.js';
2
- import type { LogFn, Logger } from '@aztec/foundation/log';
3
- export declare function getL1ToL2MessageWitness(rpcUrl: string, contractAddress: AztecAddress, messageHash: Fr, secret: Fr, debugLogger: Logger, log: LogFn): Promise<void>;
4
- //# sourceMappingURL=get_l1_to_l2_message_witness.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_l1_to_l2_message_witness.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_l1_to_l2_message_witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,EAA0B,MAAM,iBAAiB,CAAC;AACrF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,EACV,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAeX"}
@@ -1,11 +0,0 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- export async function getL1ToL2MessageWitness(rpcUrl, contractAddress, messageHash, secret, debugLogger, log) {
3
- const client = await createCompatibleClient(rpcUrl, debugLogger);
4
- const messageWitness = await client.getL1ToL2MembershipWitness(contractAddress, messageHash, secret);
5
- log(messageWitness === undefined ? `
6
- L1 to L2 Message not found.
7
- ` : `
8
- L1 to L2 message index: ${messageWitness[0]}
9
- L1 to L2 message sibling path: ${messageWitness[1]}
10
- `);
11
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"get_logs.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,wBAAsB,OAAO,CAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,KAAK,EACf,eAAe,EAAE,YAAY,EAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,iBAmDX"}
@@ -1,9 +0,0 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import type { LogFn, Logger } from '@aztec/foundation/log';
3
-
4
- export async function blockNumber(rpcUrl: string, debugLogger: Logger, log: LogFn) {
5
- const client = await createCompatibleClient(rpcUrl, debugLogger);
6
- const [latestNum, provenNum] = await Promise.all([client.getBlockNumber(), client.getProvenBlockNumber()]);
7
- log(`Latest block: ${latestNum}`);
8
- log(`Proven block: ${provenNum}`);
9
- }
@@ -1,10 +0,0 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import type { LogFn, Logger } from '@aztec/foundation/log';
3
-
4
- import { inspectBlock } from '../../utils/inspect.js';
5
-
6
- export async function getBlock(rpcUrl: string, maybeBlockNumber: number | undefined, debugLogger: Logger, log: LogFn) {
7
- const client = await createCompatibleClient(rpcUrl, debugLogger);
8
- const blockNumber = maybeBlockNumber ?? (await client.getBlockNumber());
9
- await inspectBlock(client, blockNumber, log, { showTxs: true });
10
- }
@@ -1,25 +0,0 @@
1
- import { type AztecAddress, type Fr, createCompatibleClient } from '@aztec/aztec.js';
2
- import type { LogFn, Logger } from '@aztec/foundation/log';
3
-
4
- export async function getL1ToL2MessageWitness(
5
- rpcUrl: string,
6
- contractAddress: AztecAddress,
7
- messageHash: Fr,
8
- secret: Fr,
9
- debugLogger: Logger,
10
- log: LogFn,
11
- ) {
12
- const client = await createCompatibleClient(rpcUrl, debugLogger);
13
- const messageWitness = await client.getL1ToL2MembershipWitness(contractAddress, messageHash, secret);
14
-
15
- log(
16
- messageWitness === undefined
17
- ? `
18
- L1 to L2 Message not found.
19
- `
20
- : `
21
- L1 to L2 message index: ${messageWitness[0]}
22
- L1 to L2 message sibling path: ${messageWitness[1]}
23
- `,
24
- );
25
- }