@aztec-labs/cli 6.0.0-nightly.20260829
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/README.md +23 -0
- 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_min_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_min_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_min_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -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/aztec_node/get_logs.d.ts +33 -0
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_logs.js +61 -0
- 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/aztec_node/get_node_info.js +58 -0
- 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 +38 -0
- package/dest/cmds/infrastructure/index.d.ts +4 -0
- package/dest/cmds/infrastructure/index.d.ts.map +1 -0
- package/dest/cmds/infrastructure/index.js +22 -0
- package/dest/cmds/infrastructure/sequencers.d.ts +12 -0
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -0
- package/dest/cmds/infrastructure/sequencers.js +113 -0
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +3 -0
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -0
- package/dest/cmds/infrastructure/setup_l2_contract.js +35 -0
- package/dest/cmds/l1/advance_epoch.d.ts +3 -0
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -0
- package/dest/cmds/l1/advance_epoch.js +12 -0
- package/dest/cmds/l1/assume_proven_through.d.ts +4 -0
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -0
- package/dest/cmds/l1/assume_proven_through.js +12 -0
- package/dest/cmds/l1/compute_genesis_values.d.ts +4 -0
- package/dest/cmds/l1/compute_genesis_values.d.ts.map +1 -0
- package/dest/cmds/l1/compute_genesis_values.js +17 -0
- package/dest/cmds/l1/create_l1_account.d.ts +3 -0
- package/dest/cmds/l1/create_l1_account.d.ts.map +1 -0
- package/dest/cmds/l1/create_l1_account.js +15 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.js +80 -0
- package/dest/cmds/l1/deploy_new_rollup.d.ts +5 -0
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -0
- package/dest/cmds/l1/deploy_new_rollup.js +26 -0
- package/dest/cmds/l1/get_l1_addresses.d.ts +4 -0
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -0
- package/dest/cmds/l1/get_l1_addresses.js +21 -0
- package/dest/cmds/l1/get_l1_balance.d.ts +4 -0
- package/dest/cmds/l1/get_l1_balance.d.ts.map +1 -0
- package/dest/cmds/l1/get_l1_balance.js +35 -0
- package/dest/cmds/l1/governance_utils.d.ts +50 -0
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -0
- package/dest/cmds/l1/governance_utils.js +87 -0
- package/dest/cmds/l1/index.d.ts +4 -0
- package/dest/cmds/l1/index.d.ts.map +1 -0
- package/dest/cmds/l1/index.js +201 -0
- package/dest/cmds/l1/prover_stats.d.ts +14 -0
- package/dest/cmds/l1/prover_stats.d.ts.map +1 -0
- package/dest/cmds/l1/prover_stats.js +147 -0
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +6 -0
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -0
- package/dest/cmds/l1/trigger_seed_snapshot.js +20 -0
- package/dest/cmds/l1/update_l1_validators.d.ts +45 -0
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -0
- package/dest/cmds/l1/update_l1_validators.js +280 -0
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +3 -0
- package/dest/cmds/misc/generate_bootnode_enr.d.ts.map +1 -0
- package/dest/cmds/misc/generate_bootnode_enr.js +5 -0
- package/dest/cmds/misc/generate_p2p_private_key.d.ts +3 -0
- package/dest/cmds/misc/generate_p2p_private_key.d.ts.map +1 -0
- package/dest/cmds/misc/generate_p2p_private_key.js +7 -0
- package/dest/cmds/misc/generate_secret_key.d.ts +5 -0
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -0
- package/dest/cmds/misc/generate_secret_key.js +6 -0
- package/dest/cmds/misc/index.d.ts +4 -0
- package/dest/cmds/misc/index.d.ts.map +1 -0
- package/dest/cmds/misc/index.js +32 -0
- package/dest/cmds/misc/update/common.d.ts +17 -0
- package/dest/cmds/misc/update/common.d.ts.map +1 -0
- package/dest/cmds/misc/update/common.js +3 -0
- package/dest/cmds/misc/update/github.d.ts +3 -0
- package/dest/cmds/misc/update/github.d.ts.map +1 -0
- package/dest/cmds/misc/update/github.js +2 -0
- package/dest/cmds/misc/update/noir.d.ts +10 -0
- package/dest/cmds/misc/update/noir.d.ts.map +1 -0
- package/dest/cmds/misc/update/noir.js +45 -0
- package/dest/cmds/misc/update/npm.d.ts +34 -0
- package/dest/cmds/misc/update/npm.d.ts.map +1 -0
- package/dest/cmds/misc/update/npm.js +123 -0
- package/dest/cmds/misc/update/utils.d.ts +14 -0
- package/dest/cmds/misc/update/utils.d.ts.map +1 -0
- package/dest/cmds/misc/update/utils.js +38 -0
- package/dest/cmds/misc/update.d.ts +3 -0
- package/dest/cmds/misc/update.d.ts.map +1 -0
- package/dest/cmds/misc/update.js +51 -0
- package/dest/cmds/validator_keys/add.d.ts +5 -0
- package/dest/cmds/validator_keys/add.d.ts.map +1 -0
- package/dest/cmds/validator_keys/add.js +83 -0
- package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts +2 -0
- package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts.map +1 -0
- package/dest/cmds/validator_keys/eth_json_v3_worker.js +27 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.js +27 -0
- package/dest/cmds/validator_keys/index.d.ts +4 -0
- package/dest/cmds/validator_keys/index.d.ts.map +1 -0
- package/dest/cmds/validator_keys/index.js +33 -0
- package/dest/cmds/validator_keys/new.d.ts +35 -0
- package/dest/cmds/validator_keys/new.d.ts.map +1 -0
- package/dest/cmds/validator_keys/new.js +220 -0
- package/dest/cmds/validator_keys/set_funding_account.d.ts +14 -0
- package/dest/cmds/validator_keys/set_funding_account.d.ts.map +1 -0
- package/dest/cmds/validator_keys/set_funding_account.js +37 -0
- package/dest/cmds/validator_keys/shared.d.ts +81 -0
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
- package/dest/cmds/validator_keys/shared.js +352 -0
- package/dest/cmds/validator_keys/staker.d.ts +38 -0
- package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
- package/dest/cmds/validator_keys/staker.js +210 -0
- package/dest/cmds/validator_keys/utils.d.ts +35 -0
- package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
- package/dest/cmds/validator_keys/utils.js +86 -0
- package/dest/config/cached_fetch.d.ts +27 -0
- package/dest/config/cached_fetch.d.ts.map +1 -0
- package/dest/config/cached_fetch.js +132 -0
- package/dest/config/chain_l2_config.d.ts +19 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +60 -0
- package/dest/config/enrich_env.d.ts +4 -0
- package/dest/config/enrich_env.d.ts.map +1 -0
- package/dest/config/enrich_env.js +12 -0
- package/dest/config/generated/networks.d.ts +236 -0
- package/dest/config/generated/networks.d.ts.map +1 -0
- package/dest/config/generated/networks.js +237 -0
- package/dest/config/get_l1_config.d.ts +9 -0
- package/dest/config/get_l1_config.d.ts.map +1 -0
- package/dest/config/get_l1_config.js +24 -0
- package/dest/config/index.d.ts +5 -0
- package/dest/config/index.d.ts.map +1 -0
- package/dest/config/index.js +4 -0
- package/dest/config/network_config.d.ts +22 -0
- package/dest/config/network_config.d.ts.map +1 -0
- package/dest/config/network_config.js +119 -0
- package/dest/utils/aztec.d.ts +56 -0
- package/dest/utils/aztec.d.ts.map +1 -0
- package/dest/utils/aztec.js +161 -0
- package/dest/utils/commands.d.ts +161 -0
- package/dest/utils/commands.d.ts.map +1 -0
- package/dest/utils/commands.js +341 -0
- package/dest/utils/encoding.d.ts +15 -0
- package/dest/utils/encoding.d.ts.map +1 -0
- package/dest/utils/encoding.js +103 -0
- package/dest/utils/github.d.ts +3 -0
- package/dest/utils/github.d.ts.map +1 -0
- package/dest/utils/github.js +2 -0
- package/dest/utils/index.d.ts +6 -0
- package/dest/utils/index.d.ts.map +1 -0
- package/dest/utils/index.js +5 -0
- package/dest/utils/inspect.d.ts +11 -0
- package/dest/utils/inspect.d.ts.map +1 -0
- package/dest/utils/inspect.js +90 -0
- package/dest/utils/setup_contracts.d.ts +3 -0
- package/dest/utils/setup_contracts.d.ts.map +1 -0
- package/dest/utils/setup_contracts.js +16 -0
- package/package.json +141 -0
- package/public_include_metric_prefixes.json +1 -0
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +11 -0
- package/src/cmds/aztec_node/get_current_min_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
- package/src/cmds/aztec_node/get_logs.ts +100 -0
- package/src/cmds/aztec_node/get_node_info.ts +61 -0
- package/src/cmds/aztec_node/index.ts +91 -0
- package/src/cmds/infrastructure/index.ts +51 -0
- package/src/cmds/infrastructure/sequencers.ts +122 -0
- package/src/cmds/infrastructure/setup_l2_contract.ts +40 -0
- package/src/cmds/l1/advance_epoch.ts +14 -0
- package/src/cmds/l1/assume_proven_through.ts +20 -0
- package/src/cmds/l1/compute_genesis_values.ts +29 -0
- package/src/cmds/l1/create_l1_account.ts +16 -0
- package/src/cmds/l1/deploy_l1_contracts_cmd.ts +105 -0
- package/src/cmds/l1/deploy_new_rollup.ts +65 -0
- package/src/cmds/l1/get_l1_addresses.ts +31 -0
- package/src/cmds/l1/get_l1_balance.ts +44 -0
- package/src/cmds/l1/governance_utils.ts +183 -0
- package/src/cmds/l1/index.ts +499 -0
- package/src/cmds/l1/prover_stats.ts +213 -0
- package/src/cmds/l1/trigger_seed_snapshot.ts +32 -0
- package/src/cmds/l1/update_l1_validators.ts +358 -0
- package/src/cmds/misc/generate_bootnode_enr.ts +13 -0
- package/src/cmds/misc/generate_p2p_private_key.ts +9 -0
- package/src/cmds/misc/generate_secret_key.ts +5 -0
- package/src/cmds/misc/index.ts +67 -0
- package/src/cmds/misc/update/common.ts +16 -0
- package/src/cmds/misc/update/github.ts +2 -0
- package/src/cmds/misc/update/noir.ts +56 -0
- package/src/cmds/misc/update/npm.ts +148 -0
- package/src/cmds/misc/update/utils.ts +49 -0
- package/src/cmds/misc/update.ts +71 -0
- package/src/cmds/validator_keys/add.ts +122 -0
- package/src/cmds/validator_keys/eth_json_v3_worker.ts +30 -0
- package/src/cmds/validator_keys/generate_bls_keypair.ts +33 -0
- package/src/cmds/validator_keys/index.ts +181 -0
- package/src/cmds/validator_keys/new.ts +326 -0
- package/src/cmds/validator_keys/set_funding_account.ts +54 -0
- package/src/cmds/validator_keys/shared.ts +414 -0
- package/src/cmds/validator_keys/staker.ts +300 -0
- package/src/cmds/validator_keys/utils.ts +124 -0
- package/src/config/cached_fetch.ts +154 -0
- package/src/config/chain_l2_config.ts +71 -0
- package/src/config/enrich_env.ts +15 -0
- package/src/config/generated/networks.ts +241 -0
- package/src/config/get_l1_config.ts +31 -0
- package/src/config/index.ts +4 -0
- package/src/config/network_config.ts +150 -0
- package/src/utils/aztec.ts +203 -0
- package/src/utils/commands.ts +434 -0
- package/src/utils/encoding.ts +117 -0
- package/src/utils/github.ts +2 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/inspect.ts +111 -0
- package/src/utils/setup_contracts.ts +19 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
3
|
+
import type { AztecNode } from '@aztec-labs/stdlib/interfaces/client';
|
|
4
|
+
import type { TxHash } from '@aztec-labs/stdlib/tx';
|
|
5
|
+
export declare function inspectBlock(aztecNode: AztecNode, blockNumber: BlockNumber, log: LogFn, opts?: {
|
|
6
|
+
showTxs?: boolean;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function inspectTx(aztecNode: AztecNode, txHash: TxHash, log: LogFn, opts?: {
|
|
9
|
+
includeBlockInfo?: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zcGVjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL2luc3BlY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ3hELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ3RFLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRXBELHdCQUFzQixZQUFZLENBQ2hDLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFdBQVcsRUFBRSxXQUFXLEVBQ3hCLEdBQUcsRUFBRSxLQUFLLEVBQ1YsSUFBSSxHQUFFO0lBQUUsT0FBTyxDQUFDLEVBQUUsT0FBTyxDQUFBO0NBQU8saUJBeUJqQztBQUVELHdCQUFzQixTQUFTLENBQzdCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLE1BQU0sRUFBRSxNQUFNLEVBQ2QsR0FBRyxFQUFFLEtBQUssRUFDVixJQUFJLEdBQUU7SUFBRSxnQkFBZ0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQTtDQUFPLGlCQXNFMUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBAyBjC;AAED,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,iBAsE1C"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export async function inspectBlock(aztecNode, blockNumber, log, opts = {}) {
|
|
2
|
+
const block = await aztecNode.getBlock(blockNumber, {
|
|
3
|
+
includeTransactions: opts.showTxs
|
|
4
|
+
});
|
|
5
|
+
if (!block) {
|
|
6
|
+
log(`No block found for block number ${blockNumber}`);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
log(`Block ${blockNumber} (${block.hash.toString()})`);
|
|
10
|
+
log(` Total fees: ${block.header.totalFees.toBigInt()}`);
|
|
11
|
+
log(` Total mana used: ${block.header.totalManaUsed.toBigInt()}`);
|
|
12
|
+
log(` Fee per gas unit: DA=${block.header.globalVariables.gasFees.feePerDaGas} L2=${block.header.globalVariables.gasFees.feePerL2Gas}`);
|
|
13
|
+
log(` Coinbase: ${block.header.globalVariables.coinbase}`);
|
|
14
|
+
log(` Fee recipient: ${block.header.globalVariables.feeRecipient}`);
|
|
15
|
+
log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
|
|
16
|
+
if (opts.showTxs && block.body) {
|
|
17
|
+
log(``);
|
|
18
|
+
for (const txHash of block.body.txEffects.map((tx)=>tx.txHash)){
|
|
19
|
+
await inspectTx(aztecNode, txHash, log, {
|
|
20
|
+
includeBlockInfo: false
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
} else if (block.body) {
|
|
24
|
+
log(` Transactions: ${block.body.txEffects.length}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export async function inspectTx(aztecNode, txHash, log, opts = {}) {
|
|
28
|
+
const receipt = await aztecNode.getTxReceipt(txHash, {
|
|
29
|
+
includeTxEffect: true
|
|
30
|
+
});
|
|
31
|
+
// Base tx data
|
|
32
|
+
log(`Tx ${txHash.toString()}`);
|
|
33
|
+
log(` Status: ${receipt.status}`);
|
|
34
|
+
if (receipt.executionResult) {
|
|
35
|
+
log(` Execution result: ${receipt.executionResult}`);
|
|
36
|
+
}
|
|
37
|
+
if (receipt.error) {
|
|
38
|
+
log(` Error: ${receipt.error}`);
|
|
39
|
+
}
|
|
40
|
+
if (!receipt.isMined() || !receipt.txEffect) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const effects = receipt.txEffect;
|
|
44
|
+
if (opts.includeBlockInfo) {
|
|
45
|
+
log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);
|
|
46
|
+
}
|
|
47
|
+
if (receipt.transactionFee) {
|
|
48
|
+
log(` Fee: ${receipt.transactionFee.toString()}`);
|
|
49
|
+
}
|
|
50
|
+
// Public logs
|
|
51
|
+
const publicLogs = effects.publicLogs;
|
|
52
|
+
if (publicLogs.length > 0) {
|
|
53
|
+
log(' Logs:');
|
|
54
|
+
for (const publicLog of publicLogs){
|
|
55
|
+
log(` ${publicLog.toHumanReadable()}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Public data writes
|
|
59
|
+
const writes = effects.publicDataWrites;
|
|
60
|
+
if (writes.length > 0) {
|
|
61
|
+
log(' Public data writes:');
|
|
62
|
+
for (const write of writes){
|
|
63
|
+
log(` Leaf ${write.leafSlot.toString()} = ${write.value.toString()}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Created notes
|
|
67
|
+
const notes = effects.noteHashes;
|
|
68
|
+
if (notes.length > 0) {
|
|
69
|
+
log(' Created notes:');
|
|
70
|
+
log(` Total: ${notes.length}`);
|
|
71
|
+
for (const note of notes){
|
|
72
|
+
log(` Note hash: ${note.toShortString()}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Created nullifiers
|
|
76
|
+
const nullifiers = effects.nullifiers;
|
|
77
|
+
if (nullifiers.length > 0) {
|
|
78
|
+
log(' Created nullifiers:');
|
|
79
|
+
for (const nullifier of nullifiers){
|
|
80
|
+
log(` Nullifier: ${nullifier.toShortString()}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// L2 to L1 messages
|
|
84
|
+
if (effects.l2ToL1Msgs.length > 0) {
|
|
85
|
+
log(` L2 to L1 messages:`);
|
|
86
|
+
for (const msg of effects.l2ToL1Msgs){
|
|
87
|
+
log(` ${msg.toString()}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec-labs/aztec.js/addresses';
|
|
2
|
+
export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dXBfY29udHJhY3RzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvc2V0dXBfY29udHJhY3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBWW5FLHdCQUFzQixzQkFBc0IsSUFBSSxPQUFPLENBQUMsWUFBWSxDQUFDLENBTXBFIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAYnE,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,YAAY,CAAC,CAMpE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec-labs/aztec.js/contracts';
|
|
2
|
+
import { Fr } from '@aztec-labs/aztec.js/fields';
|
|
3
|
+
import { SPONSORED_FPC_SALT } from '@aztec-labs/constants';
|
|
4
|
+
async function getSponsoredFPCContract() {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @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
|
|
7
|
+
const { SponsoredFPCContract } = await import('@aztec-labs/noir-contracts.js/SponsoredFPC');
|
|
8
|
+
return SponsoredFPCContract;
|
|
9
|
+
}
|
|
10
|
+
export async function getSponsoredFPCAddress() {
|
|
11
|
+
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
12
|
+
const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
13
|
+
salt: new Fr(SPONSORED_FPC_SALT)
|
|
14
|
+
});
|
|
15
|
+
return sponsoredFPCInstance.address;
|
|
16
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aztec-labs/cli",
|
|
3
|
+
"version": "6.0.0-nightly.20260829",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./devnet": "./dest/cmds/devnet/index.js",
|
|
7
|
+
"./infrastructure": "./dest/cmds/infrastructure/index.js",
|
|
8
|
+
"./l1": "./dest/cmds/l1/index.js",
|
|
9
|
+
"./l1/validators": "./dest/cmds/l1/update_l1_validators.js",
|
|
10
|
+
"./aztec_node": "./dest/cmds/aztec_node/index.js",
|
|
11
|
+
"./cli-utils": "./dest/utils/index.js",
|
|
12
|
+
"./misc": "./dest/cmds/misc/index.js",
|
|
13
|
+
"./validator_keys": "./dest/cmds/validator_keys/index.js",
|
|
14
|
+
"./setup-contracts": "./dest/cmds/misc/setup_contracts.js",
|
|
15
|
+
"./utils": "./dest/utils/index.js",
|
|
16
|
+
"./inspect": "./dest/utils/inspect.js",
|
|
17
|
+
"./config": "./dest/config/index.js",
|
|
18
|
+
"./config/chain": "./dest/config/chain_l2_config.js",
|
|
19
|
+
"./config/network": "./dest/config/network_config.js"
|
|
20
|
+
},
|
|
21
|
+
"typedocOptions": {
|
|
22
|
+
"entryPoints": [
|
|
23
|
+
"./dest/builder/index.js"
|
|
24
|
+
],
|
|
25
|
+
"name": "Aztec CLI",
|
|
26
|
+
"tsconfig": "./tsconfig.json"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
30
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
31
|
+
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
32
|
+
"copy-generated": "mkdir -p dest/config/generated/networks && cp src/config/generated/networks/*.json dest/config/generated/networks/",
|
|
33
|
+
"generate": "./scripts/generate.sh",
|
|
34
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
35
|
+
},
|
|
36
|
+
"inherits": [
|
|
37
|
+
"../package.common.json",
|
|
38
|
+
"./package.local.json"
|
|
39
|
+
],
|
|
40
|
+
"jest": {
|
|
41
|
+
"preset": "ts-jest/presets/default-esm",
|
|
42
|
+
"moduleNameMapper": {
|
|
43
|
+
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
|
|
44
|
+
},
|
|
45
|
+
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
|
|
46
|
+
"rootDir": "./src",
|
|
47
|
+
"extensionsToTreatAsEsm": [
|
|
48
|
+
".ts"
|
|
49
|
+
],
|
|
50
|
+
"transform": {
|
|
51
|
+
"^.+\\.tsx?$": [
|
|
52
|
+
"@swc/jest",
|
|
53
|
+
{
|
|
54
|
+
"jsc": {
|
|
55
|
+
"parser": {
|
|
56
|
+
"syntax": "typescript",
|
|
57
|
+
"decorators": true
|
|
58
|
+
},
|
|
59
|
+
"transform": {
|
|
60
|
+
"decoratorVersion": "2022-03"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"reporters": [
|
|
67
|
+
"default"
|
|
68
|
+
],
|
|
69
|
+
"testTimeout": 120000,
|
|
70
|
+
"setupFiles": [
|
|
71
|
+
"../../foundation/src/jest/setup.mjs"
|
|
72
|
+
],
|
|
73
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
74
|
+
"setupFilesAfterEnv": [
|
|
75
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"dependencies": {
|
|
79
|
+
"@aztec-labs/accounts": "6.0.0-nightly.20260829",
|
|
80
|
+
"@aztec-labs/archiver": "6.0.0-nightly.20260829",
|
|
81
|
+
"@aztec-labs/aztec.js": "6.0.0-nightly.20260829",
|
|
82
|
+
"@aztec-labs/constants": "6.0.0-nightly.20260829",
|
|
83
|
+
"@aztec-labs/ethereum": "6.0.0-nightly.20260829",
|
|
84
|
+
"@aztec-labs/foundation": "6.0.0-nightly.20260829",
|
|
85
|
+
"@aztec-labs/node-keystore": "6.0.0-nightly.20260829",
|
|
86
|
+
"@aztec-labs/p2p": "6.0.0-nightly.20260829",
|
|
87
|
+
"@aztec-labs/protocol-contracts": "6.0.0-nightly.20260829",
|
|
88
|
+
"@aztec-labs/stdlib": "6.0.0-nightly.20260829",
|
|
89
|
+
"@aztec-labs/wallets": "6.0.0-nightly.20260829",
|
|
90
|
+
"@aztec-labs/world-state": "6.0.0-nightly.20260829",
|
|
91
|
+
"@aztec/l1-artifacts": "6.0.0-nightly.20260826",
|
|
92
|
+
"@ethersproject/wallet": "^5.8.0",
|
|
93
|
+
"@iarna/toml": "^2.2.5",
|
|
94
|
+
"@libp2p/peer-id-factory": "^3.0.4",
|
|
95
|
+
"@scure/bip39": "^2.0.1",
|
|
96
|
+
"commander": "^12.1.0",
|
|
97
|
+
"lodash.chunk": "^4.2.0",
|
|
98
|
+
"lodash.groupby": "^4.6.0",
|
|
99
|
+
"semver": "^7.5.4",
|
|
100
|
+
"source-map-support": "^0.5.21",
|
|
101
|
+
"tslib": "^2.4.0",
|
|
102
|
+
"viem": "npm:@aztec/viem@2.38.2"
|
|
103
|
+
},
|
|
104
|
+
"devDependencies": {
|
|
105
|
+
"@jest/globals": "^30.0.0",
|
|
106
|
+
"@types/jest": "^30.0.0",
|
|
107
|
+
"@types/lodash.chunk": "^4.2.9",
|
|
108
|
+
"@types/lodash.groupby": "^4.6.9",
|
|
109
|
+
"@types/lodash.startcase": "^4.4.7",
|
|
110
|
+
"@types/node": "^22.15.17",
|
|
111
|
+
"@types/semver": "^7.5.2",
|
|
112
|
+
"@types/source-map-support": "^0.5.10",
|
|
113
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
114
|
+
"jest": "^30.0.0",
|
|
115
|
+
"jest-mock-extended": "^4.0.0",
|
|
116
|
+
"ts-jest": "^29.4.0",
|
|
117
|
+
"ts-node": "^10.9.1",
|
|
118
|
+
"typescript": "^5.3.3"
|
|
119
|
+
},
|
|
120
|
+
"peerDependencies": {
|
|
121
|
+
"@aztec-labs/accounts": "6.0.0-nightly.20260829",
|
|
122
|
+
"@aztec-labs/bb-prover": "6.0.0-nightly.20260829",
|
|
123
|
+
"@aztec-labs/ethereum": "6.0.0-nightly.20260829",
|
|
124
|
+
"@aztec-labs/noir-contracts.js": "6.0.0-nightly.20260829",
|
|
125
|
+
"@aztec-labs/noir-protocol-circuits-types": "6.0.0-nightly.20260829",
|
|
126
|
+
"@aztec-labs/noir-test-contracts.js": "6.0.0-nightly.20260829",
|
|
127
|
+
"@aztec-labs/protocol-contracts": "6.0.0-nightly.20260829",
|
|
128
|
+
"@aztec-labs/stdlib": "6.0.0-nightly.20260829",
|
|
129
|
+
"@aztec/l1-artifacts": "6.0.0-nightly.20260826"
|
|
130
|
+
},
|
|
131
|
+
"files": [
|
|
132
|
+
"dest",
|
|
133
|
+
"src",
|
|
134
|
+
"!*.test.*",
|
|
135
|
+
"public_include_metric_prefixes.json"
|
|
136
|
+
],
|
|
137
|
+
"types": "./dest/index.d.ts",
|
|
138
|
+
"engines": {
|
|
139
|
+
"node": ">=20.10"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["aztec.validator", "aztec.tx_collector", "aztec.mempool", "aztec.p2p.gossip.agg_", "aztec.ivc_verifier.agg_"]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec-labs/aztec.js/node';
|
|
2
|
+
import type { LogFn } from '@aztec-labs/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.getBlockNumber('proven')]);
|
|
7
|
+
log(`Latest block: ${latestNum}`);
|
|
8
|
+
log(`Proven block: ${provenNum}`);
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec-labs/aztec.js/node';
|
|
2
|
+
import { BlockNumber } from '@aztec-labs/foundation/branded-types';
|
|
3
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
4
|
+
|
|
5
|
+
import { inspectBlock } from '../../utils/inspect.js';
|
|
6
|
+
|
|
7
|
+
export async function getBlock(nodeUrl: string, maybeBlockNumber: number | undefined, log: LogFn) {
|
|
8
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
9
|
+
const blockNumber: BlockNumber = maybeBlockNumber ? BlockNumber(maybeBlockNumber) : await aztecNode.getBlockNumber();
|
|
10
|
+
await inspectBlock(aztecNode, blockNumber, log, { showTxs: true });
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec-labs/aztec.js/node';
|
|
2
|
+
import { jsonStringify } from '@aztec-labs/foundation/json-rpc';
|
|
3
|
+
import type { LogFn, Logger } from '@aztec-labs/foundation/log';
|
|
4
|
+
|
|
5
|
+
export async function getCurrentMinFee(nodeUrl: string, debugLogger: Logger, log: LogFn) {
|
|
6
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
7
|
+
const fees = await node.getCurrentMinFees();
|
|
8
|
+
log(`Current fees: ${jsonStringify(fees)}`);
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec-labs/aztec.js/addresses';
|
|
2
|
+
import type { Fr } from '@aztec-labs/aztec.js/fields';
|
|
3
|
+
import { createAztecNodeClient } from '@aztec-labs/aztec.js/node';
|
|
4
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
5
|
+
import { getNonNullifiedL1ToL2MessageWitness } from '@aztec-labs/stdlib/messaging';
|
|
6
|
+
|
|
7
|
+
export async function getL1ToL2MessageWitness(
|
|
8
|
+
nodeUrl: string,
|
|
9
|
+
contractAddress: AztecAddress,
|
|
10
|
+
messageHash: Fr,
|
|
11
|
+
secret: Fr,
|
|
12
|
+
log: LogFn,
|
|
13
|
+
) {
|
|
14
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
15
|
+
const messageWitness = await getNonNullifiedL1ToL2MessageWitness(node, contractAddress, messageHash, secret);
|
|
16
|
+
|
|
17
|
+
log(
|
|
18
|
+
messageWitness === undefined
|
|
19
|
+
? `
|
|
20
|
+
L1 to L2 Message not found.
|
|
21
|
+
`
|
|
22
|
+
: `
|
|
23
|
+
L1 to L2 message index: ${messageWitness[0]}
|
|
24
|
+
L1 to L2 message sibling path: ${messageWitness[1]}
|
|
25
|
+
`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec-labs/aztec.js/addresses';
|
|
2
|
+
import { createAztecNodeClient } from '@aztec-labs/aztec.js/node';
|
|
3
|
+
import type { TxHash } from '@aztec-labs/aztec.js/tx';
|
|
4
|
+
import type { BlockNumber } from '@aztec-labs/foundation/branded-types';
|
|
5
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
6
|
+
import { sleep } from '@aztec-labs/foundation/sleep';
|
|
7
|
+
import {
|
|
8
|
+
LogCursor,
|
|
9
|
+
type PublicLogsQuery,
|
|
10
|
+
type Tag,
|
|
11
|
+
logResultToHumanReadable,
|
|
12
|
+
queryAllPublicLogsByTags,
|
|
13
|
+
} from '@aztec-labs/stdlib/logs';
|
|
14
|
+
|
|
15
|
+
/** Options for the `get-logs` CLI command. */
|
|
16
|
+
export type GetLogsOptions = {
|
|
17
|
+
/** Contract address that emitted the logs (required). */
|
|
18
|
+
contractAddress: AztecAddress;
|
|
19
|
+
/** Tag to filter logs by (required). */
|
|
20
|
+
tag: Tag;
|
|
21
|
+
/** Restrict the search to this tx hash. Mutually exclusive with `fromBlock`/`toBlock`. */
|
|
22
|
+
txHash?: TxHash;
|
|
23
|
+
/** Lower block bound, inclusive. */
|
|
24
|
+
fromBlock?: BlockNumber;
|
|
25
|
+
/** Upper block bound, exclusive. */
|
|
26
|
+
toBlock?: BlockNumber;
|
|
27
|
+
/** Log cursor to resume pagination strictly after a previously-seen log. */
|
|
28
|
+
afterLog?: LogCursor;
|
|
29
|
+
/** Node RPC URL. */
|
|
30
|
+
nodeUrl: string;
|
|
31
|
+
/** When set, polls indefinitely for new logs. Incompatible with `txHash` and `toBlock`. */
|
|
32
|
+
follow: boolean;
|
|
33
|
+
/** Log function. */
|
|
34
|
+
log: LogFn;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Fetches public logs for a (contract, tag) pair, draining all pages via the stdlib pagination helper.
|
|
39
|
+
* In `--follow` mode, polls indefinitely: each round drains all currently-available logs, then sleeps
|
|
40
|
+
* until the next poll if nothing new was found.
|
|
41
|
+
*/
|
|
42
|
+
export async function getLogs(options: GetLogsOptions): Promise<void> {
|
|
43
|
+
const { txHash, fromBlock, toBlock, contractAddress, tag, nodeUrl, follow, log } = options;
|
|
44
|
+
let afterLog = options.afterLog;
|
|
45
|
+
|
|
46
|
+
if (follow) {
|
|
47
|
+
if (txHash) {
|
|
48
|
+
throw Error('Cannot use --follow with --tx-hash');
|
|
49
|
+
}
|
|
50
|
+
if (toBlock) {
|
|
51
|
+
throw Error('Cannot use --follow with --to-block');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (txHash !== undefined && (fromBlock !== undefined || toBlock !== undefined)) {
|
|
55
|
+
throw Error('Cannot combine --tx-hash with --from-block / --to-block');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
59
|
+
|
|
60
|
+
const drainLogs = async () => {
|
|
61
|
+
const query: PublicLogsQuery = {
|
|
62
|
+
contractAddress,
|
|
63
|
+
tags: [afterLog !== undefined ? { tag, afterLog } : tag],
|
|
64
|
+
fromBlock,
|
|
65
|
+
toBlock,
|
|
66
|
+
txHash,
|
|
67
|
+
};
|
|
68
|
+
const [logsForTag] = await queryAllPublicLogsByTags(node, query);
|
|
69
|
+
if (logsForTag.length > 0) {
|
|
70
|
+
afterLog = LogCursor.fromLog(logsForTag[logsForTag.length - 1]);
|
|
71
|
+
}
|
|
72
|
+
return logsForTag;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
if (follow) {
|
|
76
|
+
log('Fetching logs...');
|
|
77
|
+
while (true) {
|
|
78
|
+
const results = await drainLogs();
|
|
79
|
+
if (results.length === 0) {
|
|
80
|
+
await sleep(1000);
|
|
81
|
+
} else {
|
|
82
|
+
results.forEach(r => log(logResultToHumanReadable(r)));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
const results = await drainLogs();
|
|
87
|
+
if (results.length === 0) {
|
|
88
|
+
log(
|
|
89
|
+
`No logs found for {contractAddress: ${contractAddress.toString()}, tag: ${tag.toString()}` +
|
|
90
|
+
`${txHash ? `, txHash: ${txHash.toString()}` : ''}` +
|
|
91
|
+
`${fromBlock !== undefined ? `, fromBlock: ${fromBlock}` : ''}` +
|
|
92
|
+
`${toBlock !== undefined ? `, toBlock: ${toBlock}` : ''}` +
|
|
93
|
+
`${afterLog ? `, afterLog: ${afterLog.toString()}` : ''}}`,
|
|
94
|
+
);
|
|
95
|
+
} else {
|
|
96
|
+
log('Logs found: \n');
|
|
97
|
+
results.forEach(r => log(logResultToHumanReadable(r)));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec-labs/aztec.js/node';
|
|
2
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
3
|
+
|
|
4
|
+
export async function getNodeInfo(nodeUrl: string, json: boolean, log: LogFn, logJson: (output: any) => void) {
|
|
5
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
6
|
+
|
|
7
|
+
const info = await client.getNodeInfo();
|
|
8
|
+
if (json) {
|
|
9
|
+
logJson({
|
|
10
|
+
nodeVersion: info.nodeVersion,
|
|
11
|
+
l1ChainId: info.l1ChainId,
|
|
12
|
+
rollupVersion: info.rollupVersion,
|
|
13
|
+
enr: info.enr,
|
|
14
|
+
l1ContractAddresses: {
|
|
15
|
+
rollup: info.l1ContractAddresses.rollupAddress.toString(),
|
|
16
|
+
registry: info.l1ContractAddresses.registryAddress.toString(),
|
|
17
|
+
inbox: info.l1ContractAddresses.inboxAddress.toString(),
|
|
18
|
+
outbox: info.l1ContractAddresses.outboxAddress.toString(),
|
|
19
|
+
feeJuice: info.l1ContractAddresses.feeJuiceAddress.toString(),
|
|
20
|
+
stakingAsset: info.l1ContractAddresses.stakingAssetAddress.toString(),
|
|
21
|
+
feeJuicePortal: info.l1ContractAddresses.feeJuicePortalAddress.toString(),
|
|
22
|
+
coinIssuer: info.l1ContractAddresses.coinIssuerAddress.toString(),
|
|
23
|
+
rewardDistributor: info.l1ContractAddresses.rewardDistributorAddress.toString(),
|
|
24
|
+
governanceProposer: info.l1ContractAddresses.governanceProposerAddress.toString(),
|
|
25
|
+
governance: info.l1ContractAddresses.governanceAddress.toString(),
|
|
26
|
+
feeAssetHandler: info.l1ContractAddresses.feeAssetHandlerAddress?.toString(),
|
|
27
|
+
stakingAssetHandler: info.l1ContractAddresses.stakingAssetHandlerAddress?.toString(),
|
|
28
|
+
},
|
|
29
|
+
protocolContractAddresses: {
|
|
30
|
+
classRegistry: info.protocolContractAddresses.classRegistry.toString(),
|
|
31
|
+
feeJuice: info.protocolContractAddresses.feeJuice.toString(),
|
|
32
|
+
instanceRegistry: info.protocolContractAddresses.instanceRegistry.toString(),
|
|
33
|
+
multiCallEntrypoint: info.protocolContractAddresses.multiCallEntrypoint.toString(),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
log(`Node Version: ${info.nodeVersion}`);
|
|
38
|
+
log(`Chain Id: ${info.l1ChainId}`);
|
|
39
|
+
log(`Rollup Version: ${info.rollupVersion}`);
|
|
40
|
+
log(`Node ENR: ${info.enr}`);
|
|
41
|
+
log(`L1 Contract Addresses:`);
|
|
42
|
+
log(` Rollup Address: ${info.l1ContractAddresses.rollupAddress.toString()}`);
|
|
43
|
+
log(` Registry Address: ${info.l1ContractAddresses.registryAddress.toString()}`);
|
|
44
|
+
log(` L1 -> L2 Inbox Address: ${info.l1ContractAddresses.inboxAddress.toString()}`);
|
|
45
|
+
log(` L2 -> L1 Outbox Address: ${info.l1ContractAddresses.outboxAddress.toString()}`);
|
|
46
|
+
log(` Fee Juice Address: ${info.l1ContractAddresses.feeJuiceAddress.toString()}`);
|
|
47
|
+
log(` Staking Asset Address: ${info.l1ContractAddresses.stakingAssetAddress.toString()}`);
|
|
48
|
+
log(` Fee Juice Portal Address: ${info.l1ContractAddresses.feeJuicePortalAddress.toString()}`);
|
|
49
|
+
log(` CoinIssuer Address: ${info.l1ContractAddresses.coinIssuerAddress.toString()}`);
|
|
50
|
+
log(` RewardDistributor Address: ${info.l1ContractAddresses.rewardDistributorAddress.toString()}`);
|
|
51
|
+
log(` GovernanceProposer Address: ${info.l1ContractAddresses.governanceProposerAddress.toString()}`);
|
|
52
|
+
log(` Governance Address: ${info.l1ContractAddresses.governanceAddress.toString()}`);
|
|
53
|
+
log(` FeeAssetHandler Address: ${info.l1ContractAddresses.feeAssetHandlerAddress?.toString()}`);
|
|
54
|
+
log(` StakingAssetHandler Address: ${info.l1ContractAddresses.stakingAssetHandlerAddress?.toString()}`);
|
|
55
|
+
log(`L2 Contract Addresses:`);
|
|
56
|
+
log(` Class Registry: ${info.protocolContractAddresses.classRegistry.toString()}`);
|
|
57
|
+
log(` Fee Juice: ${info.protocolContractAddresses.feeJuice.toString()}`);
|
|
58
|
+
log(` Instance Deployer: ${info.protocolContractAddresses.instanceRegistry.toString()}`);
|
|
59
|
+
log(` MultiCall: ${info.protocolContractAddresses.multiCallEntrypoint.toString()}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { LogFn, Logger } from '@aztec-labs/foundation/log';
|
|
2
|
+
import type { Command } from 'commander';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
logJson,
|
|
6
|
+
nodeOption,
|
|
7
|
+
parseAztecAddress,
|
|
8
|
+
parseField,
|
|
9
|
+
parseOptionalInteger,
|
|
10
|
+
parseOptionalLogCursor,
|
|
11
|
+
parseOptionalTxHash,
|
|
12
|
+
parseTag,
|
|
13
|
+
} from '../../utils/commands.js';
|
|
14
|
+
|
|
15
|
+
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
16
|
+
program
|
|
17
|
+
.command('get-block')
|
|
18
|
+
.description('Gets info for a given block or latest.')
|
|
19
|
+
.argument('[blockNumber]', 'Block height', parseOptionalInteger)
|
|
20
|
+
.addOption(nodeOption)
|
|
21
|
+
.action(async (blockNumber, options) => {
|
|
22
|
+
const { getBlock } = await import('./get_block.js');
|
|
23
|
+
await getBlock(options.nodeUrl, blockNumber, log);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
program
|
|
27
|
+
.command('get-current-min-fee')
|
|
28
|
+
.description('Gets the current base fee.')
|
|
29
|
+
.addOption(nodeOption)
|
|
30
|
+
.action(async options => {
|
|
31
|
+
const { getCurrentMinFee } = await import('./get_current_min_fee.js');
|
|
32
|
+
await getCurrentMinFee(options.rpcUrl, debugLogger, log);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
program
|
|
36
|
+
.command('get-l1-to-l2-message-witness')
|
|
37
|
+
.description('Gets a L1 to L2 message witness.')
|
|
38
|
+
.requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
|
|
39
|
+
.requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
|
|
40
|
+
.requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
|
|
41
|
+
.addOption(nodeOption)
|
|
42
|
+
.action(async ({ contractAddress, messageHash, secret, nodeUrl }) => {
|
|
43
|
+
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
44
|
+
await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
program
|
|
48
|
+
.command('get-logs')
|
|
49
|
+
.description('Gets public logs for a contract and tag, optionally restricted by block range or tx hash.')
|
|
50
|
+
.requiredOption('-ca, --contract-address <address>', 'Contract address that emitted the logs.', parseAztecAddress)
|
|
51
|
+
.requiredOption('--tag <tag>', 'Tag (Fr value) to filter logs by.', parseTag)
|
|
52
|
+
.option('-tx, --tx-hash <txHash>', 'A transaction hash to restrict the search to.', parseOptionalTxHash)
|
|
53
|
+
.option(
|
|
54
|
+
'-fb, --from-block <blockNum>',
|
|
55
|
+
'Initial block number for getting logs (defaults to 1).',
|
|
56
|
+
parseOptionalInteger,
|
|
57
|
+
)
|
|
58
|
+
.option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
|
|
59
|
+
.option(
|
|
60
|
+
'-al --after-log <cursor>',
|
|
61
|
+
'Log cursor of the form <blockNumber>-<txIndexWithinBlock>-<logIndexWithinTx> to resume pagination after.',
|
|
62
|
+
parseOptionalLogCursor,
|
|
63
|
+
)
|
|
64
|
+
.addOption(nodeOption)
|
|
65
|
+
.option('--follow', 'If set, will keep polling for new logs until interrupted.')
|
|
66
|
+
.action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, tag, nodeUrl, follow }) => {
|
|
67
|
+
const { getLogs } = await import('./get_logs.js');
|
|
68
|
+
await getLogs({ txHash, fromBlock, toBlock, afterLog, contractAddress, tag, nodeUrl, follow, log });
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
program
|
|
72
|
+
.command('block-number')
|
|
73
|
+
.description('Gets the current Aztec L2 block number.')
|
|
74
|
+
.addOption(nodeOption)
|
|
75
|
+
.action(async (options: any) => {
|
|
76
|
+
const { blockNumber } = await import('./block_number.js');
|
|
77
|
+
await blockNumber(options.nodeUrl, log);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
program
|
|
81
|
+
.command('get-node-info')
|
|
82
|
+
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
83
|
+
.option('--json', 'Emit output as json')
|
|
84
|
+
.addOption(nodeOption)
|
|
85
|
+
.action(async options => {
|
|
86
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
87
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
return program;
|
|
91
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
2
|
+
import type { Command } from 'commander';
|
|
3
|
+
|
|
4
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger } from '../../utils/commands.js';
|
|
5
|
+
|
|
6
|
+
export function injectCommands(program: Command, log: LogFn) {
|
|
7
|
+
program
|
|
8
|
+
.command('setup-protocol-contracts')
|
|
9
|
+
.description('Bootstrap the blockchain by initializing all the protocol contracts')
|
|
10
|
+
.addOption(nodeOption)
|
|
11
|
+
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
12
|
+
.option('--json', 'Output the contract addresses in JSON format')
|
|
13
|
+
.action(async options => {
|
|
14
|
+
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
15
|
+
await setupL2Contracts(options.nodeUrl, options.testAccounts, options.json, log);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.command('sequencers')
|
|
20
|
+
.argument('<command>', 'Command to run: list, add, remove, who-next')
|
|
21
|
+
.argument('[who]', 'Who to add/remove')
|
|
22
|
+
.description('Manages or queries registered sequencers on the L1 rollup contract.')
|
|
23
|
+
.requiredOption<string[]>(
|
|
24
|
+
'--l1-rpc-urls <string>',
|
|
25
|
+
'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)',
|
|
26
|
+
(arg: string) => arg.split(','),
|
|
27
|
+
[ETHEREUM_HOSTS],
|
|
28
|
+
)
|
|
29
|
+
.option(
|
|
30
|
+
'-m, --mnemonic <string>',
|
|
31
|
+
'The mnemonic for the sender of the tx',
|
|
32
|
+
'test test test test test test test test test test test junk',
|
|
33
|
+
)
|
|
34
|
+
.option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger)
|
|
35
|
+
.addOption(nodeOption)
|
|
36
|
+
.addOption(l1ChainIdOption)
|
|
37
|
+
.action(async (command, who, options) => {
|
|
38
|
+
const { sequencers } = await import('./sequencers.js');
|
|
39
|
+
await sequencers({
|
|
40
|
+
command: command,
|
|
41
|
+
who,
|
|
42
|
+
mnemonic: options.mnemonic,
|
|
43
|
+
nodeUrl: options.nodeUrl,
|
|
44
|
+
l1RpcUrls: options.l1RpcUrls,
|
|
45
|
+
chainId: options.l1ChainId,
|
|
46
|
+
log,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return program;
|
|
51
|
+
}
|