@aztec/cli 3.0.0-nightly.20250918 → 3.0.0-nightly.20250920
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +10 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +4 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.d.ts +2 -2
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +3 -8
- package/dest/cmds/aztec_node/index.d.ts +4 -0
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/devnet/bootstrap_network.d.ts +1 -1
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -1
- package/dest/cmds/devnet/bootstrap_network.js +13 -12
- package/dest/cmds/devnet/index.d.ts.map +1 -1
- package/dest/cmds/devnet/index.js +3 -3
- package/dest/cmds/infrastructure/index.d.ts +2 -2
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -8
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -3
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +3 -3
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +5 -4
- package/dest/cmds/l1/advance_epoch.d.ts +1 -1
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +4 -4
- package/dest/cmds/l1/assume_proven_through.d.ts +1 -1
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +5 -5
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +2 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +5 -5
- package/dest/cmds/pxe/index.d.ts.map +1 -1
- package/dest/cmds/pxe/index.js +1 -31
- package/dest/config/chain_l2_config.js +3 -3
- package/dest/utils/aztec.d.ts +2 -8
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +2 -27
- package/dest/utils/commands.d.ts +2 -0
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +2 -0
- package/dest/utils/inspect.d.ts +3 -3
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +6 -6
- package/package.json +25 -24
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +17 -0
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +25 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +5 -6
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +89 -0
- package/src/cmds/devnet/bootstrap_network.ts +19 -11
- package/src/cmds/devnet/index.ts +3 -1
- package/src/cmds/infrastructure/index.ts +14 -7
- package/src/cmds/infrastructure/sequencers.ts +5 -6
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -4
- package/src/cmds/l1/advance_epoch.ts +4 -4
- package/src/cmds/l1/assume_proven_through.ts +5 -5
- package/src/cmds/l1/deploy_l1_contracts.ts +0 -2
- package/src/cmds/l1/index.ts +3 -4
- package/src/cmds/pxe/index.ts +0 -82
- package/src/config/chain_l2_config.ts +3 -3
- package/src/utils/aztec.ts +1 -39
- package/src/utils/commands.ts +8 -0
- package/src/utils/inspect.ts +12 -5
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
package/dest/cmds/pxe/index.js
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { logJson,
|
|
2
|
+
import { logJson, 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
|
-
program.command('get-current-base-fee').description('Gets the current base fee.').addOption(pxeOption).action(async (options)=>{
|
|
13
|
-
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
14
|
-
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
15
|
-
});
|
|
16
8
|
program.command('get-contract-data').description('Gets information about the Aztec contract deployed at the specified address.').argument('<contractAddress>', 'Aztec address of the contract.', parseAztecAddress).addOption(pxeOption).option('-b, --include-bytecode <boolean>', "Include the contract's public function bytecode, if any.", false).action(async (contractAddress, options)=>{
|
|
17
9
|
const { getContractData } = await import('./get_contract_data.js');
|
|
18
10
|
await getContractData(options.rpcUrl, contractAddress, options.includeBytecode, debugLogger, log);
|
|
19
11
|
});
|
|
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
12
|
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
13
|
const { getAccounts } = await import('./get_accounts.js');
|
|
26
14
|
await getAccounts(options.rpcUrl, options.json, debugLogger, log, logJson(log));
|
|
@@ -29,24 +17,6 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
29
17
|
const { getAccount } = await import('./get_account.js');
|
|
30
18
|
await getAccount(address, options.rpcUrl, debugLogger, log);
|
|
31
19
|
});
|
|
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
|
-
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
|
-
const { getNodeInfo } = await import('./get_node_info.js');
|
|
42
|
-
let url;
|
|
43
|
-
if (options.nodeUrl) {
|
|
44
|
-
url = options.nodeUrl;
|
|
45
|
-
} else {
|
|
46
|
-
url = options.rpcUrl;
|
|
47
|
-
}
|
|
48
|
-
await getNodeInfo(url, !options.nodeUrl, debugLogger, options.json, log, logJson(log));
|
|
49
|
-
});
|
|
50
20
|
program.command('get-pxe-info').description('Gets the information of a PXE at a URL.').addOption(pxeOption).action(async (options)=>{
|
|
51
21
|
const { getPXEInfo } = await import('./get_pxe_info.js');
|
|
52
22
|
await getPXEInfo(options.rpcUrl, debugLogger, log);
|
|
@@ -38,9 +38,9 @@ export const stagingIgnitionL2ChainConfig = {
|
|
|
38
38
|
sponsoredFPC: false,
|
|
39
39
|
p2pEnabled: true,
|
|
40
40
|
p2pBootstrapNodes: [],
|
|
41
|
-
registryAddress: '
|
|
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,
|
package/dest/utils/aztec.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import { type ContractArtifact, type FunctionAbi } from '@aztec/aztec.js/abi';
|
|
3
3
|
import { type DeployL1ContractsReturnType, type L1ContractsConfig, type Operator, RollupContract } from '@aztec/ethereum';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -18,7 +18,7 @@ export declare function getFunctionAbi(artifact: ContractArtifact, fnName: strin
|
|
|
18
18
|
* @param privateKey - The private key to be used in contract deployment.
|
|
19
19
|
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
20
20
|
*/
|
|
21
|
-
export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false,
|
|
21
|
+
export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false, debugLogger: Logger): Promise<DeployL1ContractsReturnType>;
|
|
22
22
|
export declare function deployNewRollupContracts(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, config: L1ContractsConfig, realVerifier: boolean, logger: Logger): Promise<{
|
|
23
23
|
rollup: RollupContract;
|
|
24
24
|
slashFactoryAddress: EthAddress;
|
|
@@ -60,10 +60,4 @@ export declare const stripLeadingHex: (hex: string) => string;
|
|
|
60
60
|
*/
|
|
61
61
|
export declare const addLeadingHex: (hex: string) => `0x${string}`;
|
|
62
62
|
export declare function prettyPrintNargoToml(config: NoirPackageConfig): string;
|
|
63
|
-
/**
|
|
64
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
65
|
-
* @param pxe - PXE client.
|
|
66
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
67
|
-
*/
|
|
68
|
-
export declare function checkServerVersion(pxe: PXE, expectedVersionRange: string): Promise<void>;
|
|
69
63
|
//# sourceMappingURL=aztec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQhE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAA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AY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK;;;;GAO3G;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAK7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,KAAK,MAAM,EAKtD,CAAC;AAOF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUtE"}
|
package/dest/utils/aztec.js
CHANGED
|
@@ -5,7 +5,6 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
5
5
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
6
6
|
import TOML from '@iarna/toml';
|
|
7
7
|
import { readFile } from 'fs/promises';
|
|
8
|
-
import { gtr, ltr, satisfies, valid } from 'semver';
|
|
9
8
|
import { encodeArgs } from './encoding.js';
|
|
10
9
|
/**
|
|
11
10
|
* Helper to get an ABI function or throw error if it doesn't exist.
|
|
@@ -25,7 +24,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
25
24
|
* @param chainId - The chain ID of the L1 host.
|
|
26
25
|
* @param privateKey - The private key to be used in contract deployment.
|
|
27
26
|
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
28
|
-
*/ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson,
|
|
27
|
+
*/ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson, debugLogger) {
|
|
29
28
|
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
30
29
|
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
31
30
|
const account = !privateKey ? mnemonicToAccount(mnemonic, {
|
|
@@ -43,7 +42,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
43
42
|
feeJuicePortalInitialBalance,
|
|
44
43
|
realVerifier,
|
|
45
44
|
...config
|
|
46
|
-
}, config, createVerificationJson
|
|
45
|
+
}, config, createVerificationJson);
|
|
47
46
|
return result;
|
|
48
47
|
}
|
|
49
48
|
export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, config, realVerifier, logger) {
|
|
@@ -177,27 +176,3 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
|
|
|
177
176
|
});
|
|
178
177
|
return partialToml + '\n[dependencies]\n' + dependenciesToml.join('\n') + '\n';
|
|
179
178
|
}
|
|
180
|
-
/** Mismatch between server and client versions. */ class VersionMismatchError extends Error {
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
184
|
-
* @param pxe - PXE client.
|
|
185
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
186
|
-
*/ export async function checkServerVersion(pxe, expectedVersionRange) {
|
|
187
|
-
const serverName = 'Aztec Node';
|
|
188
|
-
const { nodeVersion } = await pxe.getNodeInfo();
|
|
189
|
-
if (!nodeVersion) {
|
|
190
|
-
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
|
|
191
|
-
}
|
|
192
|
-
if (!nodeVersion || !valid(nodeVersion)) {
|
|
193
|
-
throw new VersionMismatchError(`Missing or invalid version identifier for ${serverName} (${nodeVersion ?? 'empty'}).`);
|
|
194
|
-
} else if (!satisfies(nodeVersion, expectedVersionRange)) {
|
|
195
|
-
if (gtr(nodeVersion, expectedVersionRange)) {
|
|
196
|
-
throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which is newer than the expected by this CLI (${expectedVersionRange}). Consider upgrading your CLI to a newer version.`);
|
|
197
|
-
} else if (ltr(nodeVersion, expectedVersionRange)) {
|
|
198
|
-
throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which is older than the expected by this CLI (${expectedVersionRange}). Consider upgrading your ${serverName} to a newer version.`);
|
|
199
|
-
} else {
|
|
200
|
-
throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which does not match the expected by this CLI (${expectedVersionRange}).`);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
package/dest/utils/commands.d.ts
CHANGED
|
@@ -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,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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"}
|
package/dest/utils/commands.js
CHANGED
|
@@ -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)) {
|
package/dest/utils/inspect.d.ts
CHANGED
|
@@ -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;
|
|
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,SAAS,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAChC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA2BjC;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;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"}
|
package/dest/utils/inspect.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
33
|
-
|
|
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.
|
|
3
|
+
"version": "3.0.0-nightly.20250920",
|
|
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.
|
|
74
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
75
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
76
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
77
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
78
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
79
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
80
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
81
|
-
"@aztec/node-lib": "3.0.0-nightly.
|
|
82
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
83
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
84
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
85
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
86
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
74
|
+
"@aztec/accounts": "3.0.0-nightly.20250920",
|
|
75
|
+
"@aztec/archiver": "3.0.0-nightly.20250920",
|
|
76
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250920",
|
|
77
|
+
"@aztec/constants": "3.0.0-nightly.20250920",
|
|
78
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250920",
|
|
79
|
+
"@aztec/ethereum": "3.0.0-nightly.20250920",
|
|
80
|
+
"@aztec/foundation": "3.0.0-nightly.20250920",
|
|
81
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250920",
|
|
82
|
+
"@aztec/node-lib": "3.0.0-nightly.20250920",
|
|
83
|
+
"@aztec/p2p": "3.0.0-nightly.20250920",
|
|
84
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250920",
|
|
85
|
+
"@aztec/stdlib": "3.0.0-nightly.20250920",
|
|
86
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250920",
|
|
87
|
+
"@aztec/world-state": "3.0.0-nightly.20250920",
|
|
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.
|
|
114
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
115
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
116
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
117
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
118
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
119
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
120
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
121
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
114
|
+
"@aztec/accounts": "3.0.0-nightly.20250920",
|
|
115
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250920",
|
|
116
|
+
"@aztec/ethereum": "3.0.0-nightly.20250920",
|
|
117
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250920",
|
|
118
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250920",
|
|
119
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250920",
|
|
120
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250920",
|
|
121
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250920",
|
|
122
|
+
"@aztec/stdlib": "3.0.0-nightly.20250920"
|
|
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,9 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
|
+
|
|
5
|
+
export async function getCurrentBaseFee(nodeUrl: string, debugLogger: Logger, log: LogFn) {
|
|
6
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
7
|
+
const fees = await node.getCurrentBaseFees();
|
|
8
|
+
log(`Current fees: ${jsonStringify(fees)}`);
|
|
9
|
+
}
|
|
@@ -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 {
|
|
3
|
-
import type { LogFn
|
|
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
|
-
|
|
12
|
+
nodeUrl: string,
|
|
13
13
|
follow: boolean,
|
|
14
|
-
debugLogger: Logger,
|
|
15
14
|
log: LogFn,
|
|
16
15
|
) {
|
|
17
|
-
const
|
|
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
|
|
30
|
+
const response = await node.getPublicLogs(filter);
|
|
32
31
|
const logs = response.logs;
|
|
33
32
|
|
|
34
33
|
if (!logs.length) {
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { LogFn
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
+
|
|
4
|
+
export async function getNodeInfo(nodeUrl: string, json: boolean, log: LogFn, logJson: (output: any) => void) {
|
|
5
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
3
6
|
|
|
4
|
-
export async function getNodeInfo(
|
|
5
|
-
rpcUrl: string,
|
|
6
|
-
pxeRequest: boolean,
|
|
7
|
-
debugLogger: Logger,
|
|
8
|
-
json: boolean,
|
|
9
|
-
log: LogFn,
|
|
10
|
-
logJson: (output: any) => void,
|
|
11
|
-
) {
|
|
12
|
-
let client: AztecNode | PXE;
|
|
13
|
-
if (pxeRequest) {
|
|
14
|
-
client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
15
|
-
} else {
|
|
16
|
-
client = createAztecNodeClient(rpcUrl);
|
|
17
|
-
}
|
|
18
7
|
const info = await client.getNodeInfo();
|
|
19
8
|
if (json) {
|
|
20
9
|
logJson({
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
+
|
|
3
|
+
import type { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
logJson,
|
|
7
|
+
nodeOption,
|
|
8
|
+
parseAztecAddress,
|
|
9
|
+
parseField,
|
|
10
|
+
parseOptionalAztecAddress,
|
|
11
|
+
parseOptionalInteger,
|
|
12
|
+
parseOptionalLogId,
|
|
13
|
+
parseOptionalTxHash,
|
|
14
|
+
pxeOption,
|
|
15
|
+
} from '../../utils/commands.js';
|
|
16
|
+
|
|
17
|
+
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
18
|
+
program
|
|
19
|
+
.command('get-block')
|
|
20
|
+
.description('Gets info for a given block or latest.')
|
|
21
|
+
.argument('[blockNumber]', 'Block height', parseOptionalInteger)
|
|
22
|
+
.addOption(pxeOption)
|
|
23
|
+
.addOption(nodeOption)
|
|
24
|
+
.action(async (blockNumber, options) => {
|
|
25
|
+
const { getBlock } = await import('./get_block.js');
|
|
26
|
+
await getBlock(options.rpcUrl, options.nodeUrl, blockNumber, debugLogger, log);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
program
|
|
30
|
+
.command('get-current-base-fee')
|
|
31
|
+
.description('Gets the current base fee.')
|
|
32
|
+
.addOption(nodeOption)
|
|
33
|
+
.action(async options => {
|
|
34
|
+
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
35
|
+
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
program
|
|
39
|
+
.command('get-l1-to-l2-message-witness')
|
|
40
|
+
.description('Gets a L1 to L2 message witness.')
|
|
41
|
+
.requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
|
|
42
|
+
.requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
|
|
43
|
+
.requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
|
|
44
|
+
.addOption(nodeOption)
|
|
45
|
+
.action(async ({ contractAddress, messageHash, secret, nodeUrl }) => {
|
|
46
|
+
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
47
|
+
await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
program
|
|
51
|
+
.command('get-logs')
|
|
52
|
+
.description('Gets all the public logs from an intersection of all the filter params.')
|
|
53
|
+
.option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
|
|
54
|
+
.option(
|
|
55
|
+
'-fb, --from-block <blockNum>',
|
|
56
|
+
'Initial block number for getting logs (defaults to 1).',
|
|
57
|
+
parseOptionalInteger,
|
|
58
|
+
)
|
|
59
|
+
.option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
|
|
60
|
+
.option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
|
|
61
|
+
.option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
|
|
62
|
+
.addOption(nodeOption)
|
|
63
|
+
.option('--follow', 'If set, will keep polling for new logs until interrupted.')
|
|
64
|
+
.action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow }) => {
|
|
65
|
+
const { getLogs } = await import('./get_logs.js');
|
|
66
|
+
await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
program
|
|
70
|
+
.command('block-number')
|
|
71
|
+
.description('Gets the current Aztec L2 block number.')
|
|
72
|
+
.addOption(nodeOption)
|
|
73
|
+
.action(async (options: any) => {
|
|
74
|
+
const { blockNumber } = await import('./block_number.js');
|
|
75
|
+
await blockNumber(options.nodeUrl, log);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
program
|
|
79
|
+
.command('get-node-info')
|
|
80
|
+
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
81
|
+
.option('--json', 'Emit output as json')
|
|
82
|
+
.addOption(nodeOption)
|
|
83
|
+
.action(async options => {
|
|
84
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
85
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return program;
|
|
89
|
+
}
|