@aztec/cli 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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 +2 -428
- 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 +7 -0
- 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/contracts/index.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +4 -10
- package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
- package/dest/cmds/infrastructure/index.d.ts +3 -3
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -9
- package/dest/cmds/infrastructure/sequencers.d.ts +3 -5
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +15 -7
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +2 -2
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +10 -25
- package/dest/cmds/l1/advance_epoch.d.ts +2 -2
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +6 -5
- package/dest/cmds/l1/assume_proven_through.d.ts +2 -2
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +8 -6
- package/dest/cmds/l1/bridge_erc20.d.ts +2 -2
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +3 -2
- package/dest/cmds/l1/create_l1_account.d.ts +1 -1
- 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.js → deploy_l1_contracts_cmd.js} +42 -7
- package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +5 -5
- package/dest/cmds/l1/get_l1_addresses.d.ts +2 -2
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
- package/dest/cmds/l1/get_l1_addresses.js +5 -2
- package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
- package/dest/cmds/l1/get_l1_balance.js +4 -2
- package/dest/cmds/l1/governance_utils.d.ts +5 -5
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
- package/dest/cmds/l1/governance_utils.js +3 -1
- package/dest/cmds/l1/index.d.ts +1 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +22 -36
- package/dest/cmds/l1/prover_stats.d.ts +1 -1
- package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
- package/dest/cmds/l1/prover_stats.js +32 -30
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +2 -2
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
- package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
- package/dest/cmds/l1/update_l1_validators.d.ts +10 -5
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +74 -9
- package/dest/cmds/misc/compute_selector.d.ts +1 -1
- package/dest/cmds/misc/example_contracts.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
- package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +2 -2
- package/dest/cmds/misc/generate_secret_key.d.ts +2 -2
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_key.js +1 -1
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +1 -1
- package/dest/cmds/misc/update/common.d.ts +1 -1
- package/dest/cmds/misc/update/github.d.ts +1 -1
- package/dest/cmds/misc/update/noir.d.ts +1 -1
- package/dest/cmds/misc/update/npm.d.ts +1 -1
- package/dest/cmds/misc/update/npm.js +1 -1
- package/dest/cmds/misc/update/utils.d.ts +1 -1
- package/dest/cmds/misc/update.d.ts +1 -1
- 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/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 +32 -0
- package/dest/cmds/validator_keys/new.d.ts +29 -0
- package/dest/cmds/validator_keys/new.d.ts.map +1 -0
- package/dest/cmds/validator_keys/new.js +134 -0
- package/dest/cmds/validator_keys/shared.d.ts +68 -0
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
- package/dest/cmds/validator_keys/shared.js +274 -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 +25 -0
- package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
- package/dest/cmds/validator_keys/utils.js +52 -0
- package/dest/config/cached_fetch.d.ts +18 -0
- package/dest/config/cached_fetch.d.ts.map +1 -0
- package/dest/config/cached_fetch.js +54 -0
- package/dest/config/chain_l2_config.d.ts +41 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +524 -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/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 +115 -0
- package/dest/utils/aztec.d.ts +8 -20
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +22 -67
- package/dest/utils/commands.d.ts +21 -12
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +38 -11
- package/dest/utils/encoding.d.ts +1 -1
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/github.d.ts +1 -1
- package/dest/utils/index.d.ts +1 -1
- package/dest/utils/inspect.d.ts +5 -11
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +13 -95
- package/dest/utils/setup_contracts.d.ts +2 -4
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +2 -22
- package/package.json +43 -28
- 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/{pxe → aztec_node}/get_logs.ts +11 -9
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/contracts/inspect_contract.ts +4 -11
- package/src/cmds/infrastructure/index.ts +7 -18
- package/src/cmds/infrastructure/sequencers.ts +13 -11
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -30
- package/src/cmds/l1/advance_epoch.ts +6 -5
- package/src/cmds/l1/assume_proven_through.ts +10 -6
- package/src/cmds/l1/bridge_erc20.ts +5 -2
- package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +44 -24
- package/src/cmds/l1/deploy_new_rollup.ts +6 -9
- package/src/cmds/l1/get_l1_addresses.ts +5 -3
- package/src/cmds/l1/get_l1_balance.ts +2 -2
- package/src/cmds/l1/governance_utils.ts +3 -8
- package/src/cmds/l1/index.ts +28 -66
- package/src/cmds/l1/prover_stats.ts +42 -31
- package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
- package/src/cmds/l1/update_l1_validators.ts +88 -18
- package/src/cmds/misc/generate_secret_and_hash.ts +2 -2
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- package/src/cmds/misc/index.ts +1 -1
- package/src/cmds/misc/update/npm.ts +1 -1
- package/src/cmds/validator_keys/add.ts +123 -0
- package/src/cmds/validator_keys/generate_bls_keypair.ts +34 -0
- package/src/cmds/validator_keys/index.ts +142 -0
- package/src/cmds/validator_keys/new.ts +207 -0
- package/src/cmds/validator_keys/shared.ts +326 -0
- package/src/cmds/validator_keys/staker.ts +301 -0
- package/src/cmds/validator_keys/utils.ts +81 -0
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +694 -0
- package/src/config/enrich_env.ts +15 -0
- package/src/config/get_l1_config.ts +31 -0
- package/src/config/index.ts +4 -0
- package/src/config/network_config.ts +147 -0
- package/src/utils/aztec.ts +27 -118
- package/src/utils/commands.ts +52 -15
- package/src/utils/encoding.ts +1 -1
- package/src/utils/inspect.ts +19 -111
- package/src/utils/setup_contracts.ts +4 -43
- package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
- package/dest/cmds/devnet/bootstrap_network.js +0 -216
- package/dest/cmds/devnet/faucet.d.ts +0 -4
- package/dest/cmds/devnet/faucet.d.ts.map +0 -1
- package/dest/cmds/devnet/faucet.js +0 -26
- package/dest/cmds/devnet/index.d.ts +0 -4
- package/dest/cmds/devnet/index.d.ts.map +0 -1
- package/dest/cmds/devnet/index.js +0 -14
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- 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_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- 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_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- 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 +0 -4
- 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/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts +0 -4
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -55
- package/src/cmds/devnet/bootstrap_network.ts +0 -321
- package/src/cmds/devnet/faucet.ts +0 -33
- package/src/cmds/devnet/index.ts +0 -60
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- 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/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -170
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/utils/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,KAAK,EACV,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,iBA0BjC;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,iBAmE1C"}
|
package/dest/utils/inspect.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
|
|
4
|
-
const block = await pxe.getBlock(blockNumber);
|
|
1
|
+
export async function inspectBlock(aztecNode, blockNumber, log, opts = {}) {
|
|
2
|
+
const block = await aztecNode.getBlock(blockNumber);
|
|
5
3
|
if (!block) {
|
|
6
4
|
log(`No block found for block number ${blockNumber}`);
|
|
7
5
|
return;
|
|
@@ -16,21 +14,19 @@ export async function inspectBlock(pxe, blockNumber, log, opts = {}) {
|
|
|
16
14
|
log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
|
|
17
15
|
if (opts.showTxs) {
|
|
18
16
|
log(``);
|
|
19
|
-
const artifactMap = await getKnownArtifacts(pxe);
|
|
20
17
|
for (const txHash of block.body.txEffects.map((tx)=>tx.txHash)){
|
|
21
|
-
await inspectTx(
|
|
22
|
-
includeBlockInfo: false
|
|
23
|
-
artifactMap
|
|
18
|
+
await inspectTx(aztecNode, txHash, log, {
|
|
19
|
+
includeBlockInfo: false
|
|
24
20
|
});
|
|
25
21
|
}
|
|
26
22
|
} else {
|
|
27
23
|
log(` Transactions: ${block.body.txEffects.length}`);
|
|
28
24
|
}
|
|
29
25
|
}
|
|
30
|
-
export async function inspectTx(
|
|
26
|
+
export async function inspectTx(aztecNode, txHash, log, opts = {}) {
|
|
31
27
|
const [receipt, effectsInBlock] = await Promise.all([
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
aztecNode.getTxReceipt(txHash),
|
|
29
|
+
aztecNode.getTxEffect(txHash)
|
|
34
30
|
]);
|
|
35
31
|
// Base tx data
|
|
36
32
|
log(`Tx ${txHash.toString()}`);
|
|
@@ -42,7 +38,6 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
42
38
|
return;
|
|
43
39
|
}
|
|
44
40
|
const effects = effectsInBlock.data;
|
|
45
|
-
const artifactMap = opts?.artifactMap ?? await getKnownArtifacts(pxe);
|
|
46
41
|
if (opts.includeBlockInfo) {
|
|
47
42
|
log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);
|
|
48
43
|
}
|
|
@@ -74,32 +69,12 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
74
69
|
log(` Note hash: ${note.toShortString()}`);
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
|
-
//
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const deployed = deployNullifiers[nullifier.toString()];
|
|
84
|
-
const note = deployed ? (await pxe.getNotes({
|
|
85
|
-
siloedNullifier: nullifier,
|
|
86
|
-
contractAddress: deployed
|
|
87
|
-
}))[0] : undefined;
|
|
88
|
-
const initialized = initNullifiers[nullifier.toString()];
|
|
89
|
-
const registered = classNullifiers[nullifier.toString()];
|
|
90
|
-
if (nullifier.toBuffer().equals(txHash.toBuffer())) {
|
|
91
|
-
log(` Transaction hash nullifier ${nullifier.toShortString()}`);
|
|
92
|
-
} else if (note) {
|
|
93
|
-
inspectNote(note, artifactMap, log, `Nullifier ${nullifier.toShortString()} for note`);
|
|
94
|
-
} else if (deployed) {
|
|
95
|
-
log(` Contract ${toFriendlyAddress(deployed, artifactMap)} deployed via nullifier ${nullifier.toShortString()}`);
|
|
96
|
-
} else if (initialized) {
|
|
97
|
-
log(` Contract ${toFriendlyAddress(initialized, artifactMap)} initialized via nullifier ${nullifier.toShortString()}`);
|
|
98
|
-
} else if (registered) {
|
|
99
|
-
log(` Class ${registered} registered via nullifier ${nullifier.toShortString()}`);
|
|
100
|
-
} else {
|
|
101
|
-
log(` Unknown nullifier ${nullifier.toString()}`);
|
|
102
|
-
}
|
|
72
|
+
// Created nullifiers
|
|
73
|
+
const nullifiers = effects.nullifiers;
|
|
74
|
+
if (nullifiers.length > 0) {
|
|
75
|
+
log(' Created nullifiers:');
|
|
76
|
+
for (const nullifier of nullifiers){
|
|
77
|
+
log(` Nullifier: ${nullifier.toShortString()}`);
|
|
103
78
|
}
|
|
104
79
|
}
|
|
105
80
|
// L2 to L1 messages
|
|
@@ -110,60 +85,3 @@ export async function inspectTx(pxe, txHash, log, opts = {}) {
|
|
|
110
85
|
}
|
|
111
86
|
}
|
|
112
87
|
}
|
|
113
|
-
function inspectNote(note, artifactMap, log, text = 'Note') {
|
|
114
|
-
const artifact = artifactMap[note.contractAddress.toString()];
|
|
115
|
-
const contract = artifact?.name ?? note.contractAddress.toString();
|
|
116
|
-
log(` ${text} at ${contract}`);
|
|
117
|
-
log(` Recipient: ${toFriendlyAddress(note.recipient, artifactMap)}`);
|
|
118
|
-
for (const field of note.note.items){
|
|
119
|
-
log(` ${field.toString()}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function toFriendlyAddress(address, artifactMap) {
|
|
123
|
-
const artifact = artifactMap[address.toString()];
|
|
124
|
-
if (!artifact) {
|
|
125
|
-
return address.toString();
|
|
126
|
-
}
|
|
127
|
-
return `${artifact.name}<${address.toString()}>`;
|
|
128
|
-
}
|
|
129
|
-
async function getKnownNullifiers(pxe, artifactMap) {
|
|
130
|
-
const knownContracts = await pxe.getContracts();
|
|
131
|
-
const deployerAddress = ProtocolContractAddress.ContractInstanceRegistry;
|
|
132
|
-
const classRegistryAddress = ProtocolContractAddress.ContractClassRegistry;
|
|
133
|
-
const initNullifiers = {};
|
|
134
|
-
const deployNullifiers = {};
|
|
135
|
-
const classNullifiers = {};
|
|
136
|
-
for (const contract of knownContracts){
|
|
137
|
-
initNullifiers[(await siloNullifier(contract, contract.toField())).toString()] = contract;
|
|
138
|
-
deployNullifiers[(await siloNullifier(deployerAddress, contract.toField())).toString()] = contract;
|
|
139
|
-
}
|
|
140
|
-
for (const artifact of Object.values(artifactMap)){
|
|
141
|
-
classNullifiers[(await siloNullifier(classRegistryAddress, artifact.classId)).toString()] = `${artifact.name}Class<${artifact.classId}>`;
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
initNullifiers,
|
|
145
|
-
deployNullifiers,
|
|
146
|
-
classNullifiers
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
async function getKnownArtifacts(pxe) {
|
|
150
|
-
const knownContractAddresses = await pxe.getContracts();
|
|
151
|
-
const knownContracts = (await Promise.all(knownContractAddresses.map((contractAddress)=>pxe.getContractMetadata(contractAddress)))).map((contractMetadata)=>contractMetadata.contractInstance);
|
|
152
|
-
const classIds = [
|
|
153
|
-
...new Set(knownContracts.map((contract)=>contract?.currentContractClassId))
|
|
154
|
-
];
|
|
155
|
-
const knownArtifacts = (await Promise.all(classIds.map((classId)=>classId ? pxe.getContractClassMetadata(classId) : undefined))).map((contractClassMetadata)=>contractClassMetadata ? {
|
|
156
|
-
...contractClassMetadata.artifact,
|
|
157
|
-
classId: contractClassMetadata.contractClass?.id
|
|
158
|
-
} : undefined);
|
|
159
|
-
const map = {};
|
|
160
|
-
for (const instance of knownContracts){
|
|
161
|
-
if (instance) {
|
|
162
|
-
const artifact = knownArtifacts.find((a)=>a?.classId?.equals(instance.currentContractClassId));
|
|
163
|
-
if (artifact) {
|
|
164
|
-
map[instance.address.toString()] = artifact;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return map;
|
|
169
|
-
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { AztecAddress
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
2
|
export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
4
|
-
|
|
5
|
-
//# sourceMappingURL=setup_contracts.d.ts.map
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dXBfY29udHJhY3RzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvc2V0dXBfY29udHJhY3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBWTlELHdCQUFzQixzQkFBc0IsSUFBSSxPQUFPLENBQUMsWUFBWSxDQUFDLENBTXBFIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAY9D,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,YAAY,CAAC,CAMpE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
3
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
3
|
-
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
4
4
|
async function getSponsoredFPCContract() {
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
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
|
|
@@ -14,23 +14,3 @@ export async function getSponsoredFPCAddress() {
|
|
|
14
14
|
});
|
|
15
15
|
return sponsoredFPCInstance.address;
|
|
16
16
|
}
|
|
17
|
-
export async function setupSponsoredFPC(pxe, log, waitOpts = DefaultWaitOpts, waitForProvenOptions) {
|
|
18
|
-
const SponsoredFPCContract = await getSponsoredFPCContract();
|
|
19
|
-
const address = await getSponsoredFPCAddress();
|
|
20
|
-
const paymentMethod = new SponsoredFeePaymentMethod(address);
|
|
21
|
-
const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
|
|
22
|
-
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
|
|
23
|
-
const deployTx = SponsoredFPCContract.deploy(deployer).send({
|
|
24
|
-
from: AztecAddress.ZERO,
|
|
25
|
-
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
26
|
-
universalDeploy: true,
|
|
27
|
-
fee: {
|
|
28
|
-
paymentMethod
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const deployed = await deployTx.deployed(waitOpts);
|
|
32
|
-
if (waitForProvenOptions !== undefined) {
|
|
33
|
-
await waitForProven(pxe, await deployTx.getReceipt(), waitForProvenOptions);
|
|
34
|
-
}
|
|
35
|
-
log(`SponsoredFPC: ${deployed.address}`);
|
|
36
|
-
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "4.0.0-nightly.
|
|
3
|
+
"version": "4.0.0-nightly.20260108",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
7
7
|
"./devnet": "./dest/cmds/devnet/index.js",
|
|
8
8
|
"./infrastructure": "./dest/cmds/infrastructure/index.js",
|
|
9
9
|
"./l1": "./dest/cmds/l1/index.js",
|
|
10
|
-
"./
|
|
10
|
+
"./l1/validators": "./dest/cmds/l1/update_l1_validators.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",
|
|
14
|
+
"./validator_keys": "./dest/cmds/validator_keys/index.js",
|
|
13
15
|
"./setup-contracts": "./dest/cmds/misc/setup_contracts.js",
|
|
14
16
|
"./utils": "./dest/utils/index.js",
|
|
15
|
-
"./inspect": "./dest/utils/inspect.js"
|
|
17
|
+
"./inspect": "./dest/utils/inspect.js",
|
|
18
|
+
"./config": "./dest/config/index.js",
|
|
19
|
+
"./config/chain": "./dest/config/chain_l2_config.js",
|
|
20
|
+
"./config/network": "./dest/config/network_config.js"
|
|
16
21
|
},
|
|
17
22
|
"typedocOptions": {
|
|
18
23
|
"entryPoints": [
|
|
@@ -22,8 +27,8 @@
|
|
|
22
27
|
"tsconfig": "./tsconfig.json"
|
|
23
28
|
},
|
|
24
29
|
"scripts": {
|
|
25
|
-
"build": "yarn clean && tsc
|
|
26
|
-
"build:dev": "tsc
|
|
30
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
31
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
27
32
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
28
33
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
29
34
|
},
|
|
@@ -69,29 +74,37 @@
|
|
|
69
74
|
]
|
|
70
75
|
},
|
|
71
76
|
"dependencies": {
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/
|
|
80
|
-
"@aztec/
|
|
81
|
-
"@aztec/
|
|
77
|
+
"@aztec/accounts": "4.0.0-nightly.20260108",
|
|
78
|
+
"@aztec/archiver": "4.0.0-nightly.20260108",
|
|
79
|
+
"@aztec/aztec.js": "4.0.0-nightly.20260108",
|
|
80
|
+
"@aztec/constants": "4.0.0-nightly.20260108",
|
|
81
|
+
"@aztec/entrypoints": "4.0.0-nightly.20260108",
|
|
82
|
+
"@aztec/ethereum": "4.0.0-nightly.20260108",
|
|
83
|
+
"@aztec/foundation": "4.0.0-nightly.20260108",
|
|
84
|
+
"@aztec/l1-artifacts": "4.0.0-nightly.20260108",
|
|
85
|
+
"@aztec/node-keystore": "4.0.0-nightly.20260108",
|
|
86
|
+
"@aztec/node-lib": "4.0.0-nightly.20260108",
|
|
87
|
+
"@aztec/p2p": "4.0.0-nightly.20260108",
|
|
88
|
+
"@aztec/protocol-contracts": "4.0.0-nightly.20260108",
|
|
89
|
+
"@aztec/stdlib": "4.0.0-nightly.20260108",
|
|
90
|
+
"@aztec/test-wallet": "4.0.0-nightly.20260108",
|
|
91
|
+
"@aztec/world-state": "4.0.0-nightly.20260108",
|
|
92
|
+
"@ethersproject/wallet": "^5.8.0",
|
|
82
93
|
"@iarna/toml": "^2.2.5",
|
|
83
94
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
95
|
+
"@scure/bip39": "^2.0.1",
|
|
84
96
|
"commander": "^12.1.0",
|
|
85
97
|
"lodash.chunk": "^4.2.0",
|
|
86
98
|
"lodash.groupby": "^4.6.0",
|
|
87
99
|
"semver": "^7.5.4",
|
|
88
100
|
"source-map-support": "^0.5.21",
|
|
89
101
|
"tslib": "^2.4.0",
|
|
90
|
-
"viem": "2.
|
|
102
|
+
"viem": "npm:@aztec/viem@2.38.2"
|
|
91
103
|
},
|
|
92
104
|
"devDependencies": {
|
|
93
|
-
"@aztec/
|
|
94
|
-
"@aztec/
|
|
105
|
+
"@aztec/aztec-node": "4.0.0-nightly.20260108",
|
|
106
|
+
"@aztec/kv-store": "4.0.0-nightly.20260108",
|
|
107
|
+
"@aztec/telemetry-client": "4.0.0-nightly.20260108",
|
|
95
108
|
"@jest/globals": "^30.0.0",
|
|
96
109
|
"@types/jest": "^30.0.0",
|
|
97
110
|
"@types/lodash.chunk": "^4.2.9",
|
|
@@ -100,6 +113,7 @@
|
|
|
100
113
|
"@types/node": "^22.15.17",
|
|
101
114
|
"@types/semver": "^7.5.2",
|
|
102
115
|
"@types/source-map-support": "^0.5.10",
|
|
116
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
103
117
|
"jest": "^30.0.0",
|
|
104
118
|
"jest-mock-extended": "^4.0.0",
|
|
105
119
|
"ts-jest": "^29.4.0",
|
|
@@ -107,20 +121,21 @@
|
|
|
107
121
|
"typescript": "^5.3.3"
|
|
108
122
|
},
|
|
109
123
|
"peerDependencies": {
|
|
110
|
-
"@aztec/accounts": "4.0.0-nightly.
|
|
111
|
-
"@aztec/bb-prover": "4.0.0-nightly.
|
|
112
|
-
"@aztec/ethereum": "4.0.0-nightly.
|
|
113
|
-
"@aztec/l1-artifacts": "4.0.0-nightly.
|
|
114
|
-
"@aztec/noir-contracts.js": "4.0.0-nightly.
|
|
115
|
-
"@aztec/noir-protocol-circuits-types": "4.0.0-nightly.
|
|
116
|
-
"@aztec/noir-test-contracts.js": "4.0.0-nightly.
|
|
117
|
-
"@aztec/protocol-contracts": "4.0.0-nightly.
|
|
118
|
-
"@aztec/stdlib": "4.0.0-nightly.
|
|
124
|
+
"@aztec/accounts": "4.0.0-nightly.20260108",
|
|
125
|
+
"@aztec/bb-prover": "4.0.0-nightly.20260108",
|
|
126
|
+
"@aztec/ethereum": "4.0.0-nightly.20260108",
|
|
127
|
+
"@aztec/l1-artifacts": "4.0.0-nightly.20260108",
|
|
128
|
+
"@aztec/noir-contracts.js": "4.0.0-nightly.20260108",
|
|
129
|
+
"@aztec/noir-protocol-circuits-types": "4.0.0-nightly.20260108",
|
|
130
|
+
"@aztec/noir-test-contracts.js": "4.0.0-nightly.20260108",
|
|
131
|
+
"@aztec/protocol-contracts": "4.0.0-nightly.20260108",
|
|
132
|
+
"@aztec/stdlib": "4.0.0-nightly.20260108"
|
|
119
133
|
},
|
|
120
134
|
"files": [
|
|
121
135
|
"dest",
|
|
122
136
|
"src",
|
|
123
|
-
"!*.test.*"
|
|
137
|
+
"!*.test.*",
|
|
138
|
+
"public_include_metric_prefixes.json"
|
|
124
139
|
],
|
|
125
140
|
"types": "./dest/index.d.ts",
|
|
126
141
|
"engines": {
|
|
@@ -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/aztec.js/node';
|
|
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,11 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { LogFn } from '@aztec/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/aztec.js/node';
|
|
2
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
+
import type { LogFn, Logger } from '@aztec/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/aztec.js/addresses';
|
|
2
|
+
import type { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
4
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
5
|
+
import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/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
|
+
}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type { AztecAddress
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { LogFilter, LogId } from '@aztec/aztec.js/log';
|
|
3
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
4
|
+
import type { TxHash } from '@aztec/aztec.js/tx';
|
|
5
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
6
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
4
7
|
import { sleep } from '@aztec/foundation/sleep';
|
|
5
8
|
|
|
6
9
|
export async function getLogs(
|
|
7
10
|
txHash: TxHash,
|
|
8
|
-
fromBlock:
|
|
9
|
-
toBlock:
|
|
11
|
+
fromBlock: BlockNumber,
|
|
12
|
+
toBlock: BlockNumber,
|
|
10
13
|
afterLog: LogId,
|
|
11
14
|
contractAddress: AztecAddress,
|
|
12
|
-
|
|
15
|
+
nodeUrl: string,
|
|
13
16
|
follow: boolean,
|
|
14
|
-
debugLogger: Logger,
|
|
15
17
|
log: LogFn,
|
|
16
18
|
) {
|
|
17
|
-
const
|
|
19
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
18
20
|
|
|
19
21
|
if (follow) {
|
|
20
22
|
if (txHash) {
|
|
@@ -28,7 +30,7 @@ export async function getLogs(
|
|
|
28
30
|
const filter: LogFilter = { txHash, fromBlock, toBlock, afterLog, contractAddress };
|
|
29
31
|
|
|
30
32
|
const fetchLogs = async () => {
|
|
31
|
-
const response = await
|
|
33
|
+
const response = await node.getPublicLogs(filter);
|
|
32
34
|
const logs = response.logs;
|
|
33
35
|
|
|
34
36
|
if (!logs.length) {
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { LogFn
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
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,87 @@
|
|
|
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
|
+
} 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(nodeOption)
|
|
22
|
+
.action(async (blockNumber, options) => {
|
|
23
|
+
const { getBlock } = await import('./get_block.js');
|
|
24
|
+
await getBlock(options.nodeUrl, blockNumber, log);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
program
|
|
28
|
+
.command('get-current-min-fee')
|
|
29
|
+
.description('Gets the current base fee.')
|
|
30
|
+
.addOption(nodeOption)
|
|
31
|
+
.action(async options => {
|
|
32
|
+
const { getCurrentMinFee } = await import('./get_current_min_fee.js');
|
|
33
|
+
await getCurrentMinFee(options.rpcUrl, debugLogger, log);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
program
|
|
37
|
+
.command('get-l1-to-l2-message-witness')
|
|
38
|
+
.description('Gets a L1 to L2 message witness.')
|
|
39
|
+
.requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
|
|
40
|
+
.requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField)
|
|
41
|
+
.requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField)
|
|
42
|
+
.addOption(nodeOption)
|
|
43
|
+
.action(async ({ contractAddress, messageHash, secret, nodeUrl }) => {
|
|
44
|
+
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
45
|
+
await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
program
|
|
49
|
+
.command('get-logs')
|
|
50
|
+
.description('Gets all the public logs from an intersection of all the filter params.')
|
|
51
|
+
.option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
|
|
52
|
+
.option(
|
|
53
|
+
'-fb, --from-block <blockNum>',
|
|
54
|
+
'Initial block number for getting logs (defaults to 1).',
|
|
55
|
+
parseOptionalInteger,
|
|
56
|
+
)
|
|
57
|
+
.option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
|
|
58
|
+
.option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
|
|
59
|
+
.option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
|
|
60
|
+
.addOption(nodeOption)
|
|
61
|
+
.option('--follow', 'If set, will keep polling for new logs until interrupted.')
|
|
62
|
+
.action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow }) => {
|
|
63
|
+
const { getLogs } = await import('./get_logs.js');
|
|
64
|
+
await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
program
|
|
68
|
+
.command('block-number')
|
|
69
|
+
.description('Gets the current Aztec L2 block number.')
|
|
70
|
+
.addOption(nodeOption)
|
|
71
|
+
.action(async (options: any) => {
|
|
72
|
+
const { blockNumber } = await import('./block_number.js');
|
|
73
|
+
await blockNumber(options.nodeUrl, log);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
program
|
|
77
|
+
.command('get-node-info')
|
|
78
|
+
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
79
|
+
.option('--json', 'Emit output as json')
|
|
80
|
+
.addOption(nodeOption)
|
|
81
|
+
.action(async options => {
|
|
82
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
83
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return program;
|
|
87
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sha256 } from '@aztec/foundation/crypto';
|
|
1
|
+
import { sha256 } from '@aztec/foundation/crypto/sha256';
|
|
2
2
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
3
|
import {
|
|
4
4
|
type FunctionArtifact,
|
|
@@ -29,16 +29,9 @@ export async function inspectContract(contractArtifactFile: string, debugLogger:
|
|
|
29
29
|
log(`\tpublic bytecode commitment: ${contractClass.publicBytecodeCommitment.toString()}`);
|
|
30
30
|
log(`\tpublic bytecode length: ${contractClass.packedBytecode.length} bytes (${bytecodeLengthInFields} fields)`);
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
await Promise.all(externalFunctions.map(f => logFunction(f, log)));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const internalFunctions = contractFns.filter(f => f.isInternal);
|
|
39
|
-
if (internalFunctions.length > 0) {
|
|
40
|
-
log(`\nInternal functions:`);
|
|
41
|
-
await Promise.all(internalFunctions.map(f => logFunction(f, log)));
|
|
32
|
+
if (contractFns.length > 0) {
|
|
33
|
+
log(`\nExternal contract functions:`);
|
|
34
|
+
await Promise.all(contractFns.map(f => logFunction(f, log)));
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
37
|
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import type { LogFn
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption,
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger } from '../../utils/commands.js';
|
|
6
6
|
|
|
7
|
-
export function injectCommands(program: Command, log: LogFn
|
|
7
|
+
export function injectCommands(program: Command, log: LogFn) {
|
|
8
8
|
program
|
|
9
9
|
.command('setup-protocol-contracts')
|
|
10
10
|
.description('Bootstrap the blockchain by initializing all the protocol contracts')
|
|
11
|
-
.addOption(
|
|
11
|
+
.addOption(nodeOption)
|
|
12
12
|
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
13
|
-
.option('--sponsoredFPC', 'Deploy a sponsored FPC.')
|
|
14
13
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
15
|
-
.option('--skipProofWait', "Don't wait for proofs to land.")
|
|
16
14
|
.action(async options => {
|
|
17
15
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
18
|
-
await setupL2Contracts(
|
|
19
|
-
options.rpcUrl,
|
|
20
|
-
options.testAccounts,
|
|
21
|
-
options.sponsoredFPC,
|
|
22
|
-
options.json,
|
|
23
|
-
options.skipProofWait,
|
|
24
|
-
log,
|
|
25
|
-
);
|
|
16
|
+
await setupL2Contracts(options.nodeUrl, options.testAccounts, options.json, log);
|
|
26
17
|
});
|
|
27
18
|
|
|
28
19
|
program
|
|
@@ -42,7 +33,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
42
33
|
'test test test test test test test test test test test junk',
|
|
43
34
|
)
|
|
44
35
|
.option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger)
|
|
45
|
-
.addOption(
|
|
36
|
+
.addOption(nodeOption)
|
|
46
37
|
.addOption(l1ChainIdOption)
|
|
47
38
|
.action(async (command, who, options) => {
|
|
48
39
|
const { sequencers } = await import('./sequencers.js');
|
|
@@ -50,12 +41,10 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
50
41
|
command: command,
|
|
51
42
|
who,
|
|
52
43
|
mnemonic: options.mnemonic,
|
|
53
|
-
|
|
44
|
+
nodeUrl: options.nodeUrl,
|
|
54
45
|
l1RpcUrls: options.l1RpcUrls,
|
|
55
46
|
chainId: options.l1ChainId,
|
|
56
|
-
blockNumber: options.blockNumber,
|
|
57
47
|
log,
|
|
58
|
-
debugLogger,
|
|
59
48
|
});
|
|
60
49
|
});
|
|
61
50
|
|