@aztec/cli 0.17.0 → 0.77.0-testnet-ignition.17
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 +10 -16
- package/dest/cmds/contracts/index.d.ts +4 -0
- package/dest/cmds/contracts/index.d.ts.map +1 -0
- package/dest/cmds/contracts/index.js +12 -0
- package/dest/cmds/contracts/inspect_contract.d.ts +3 -0
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -0
- package/dest/cmds/contracts/inspect_contract.js +37 -0
- package/dest/cmds/{parse_parameter_struct.d.ts → contracts/parse_parameter_struct.d.ts} +1 -4
- package/dest/cmds/contracts/parse_parameter_struct.d.ts.map +1 -0
- package/dest/cmds/contracts/parse_parameter_struct.js +13 -0
- package/dest/cmds/devnet/bootstrap_network.d.ts +3 -0
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -0
- package/dest/cmds/devnet/bootstrap_network.js +196 -0
- package/dest/cmds/devnet/faucet.d.ts +4 -0
- package/dest/cmds/devnet/faucet.d.ts.map +1 -0
- package/dest/cmds/devnet/faucet.js +26 -0
- package/dest/cmds/devnet/index.d.ts +4 -0
- package/dest/cmds/devnet/index.d.ts.map +1 -0
- package/dest/cmds/devnet/index.js +14 -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 +24 -0
- package/dest/cmds/infrastructure/sequencers.d.ts +13 -0
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -0
- package/dest/cmds/infrastructure/sequencers.js +93 -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 +43 -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 +10 -0
- package/dest/cmds/l1/assume_proven_through.d.ts +3 -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/bridge_erc20.d.ts +4 -0
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -0
- package/dest/cmds/l1/bridge_erc20.js +31 -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.d.ts +4 -0
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -0
- package/dest/cmds/l1/deploy_l1_contracts.js +29 -0
- package/dest/cmds/l1/deploy_l1_verifier.d.ts +5 -0
- package/dest/cmds/l1/deploy_l1_verifier.d.ts.map +1 -0
- package/dest/cmds/l1/deploy_l1_verifier.js +54 -0
- package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -0
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -0
- package/dest/cmds/l1/deploy_new_rollup.js +19 -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 +18 -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 +33 -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 +85 -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 +208 -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 +145 -0
- package/dest/cmds/l1/update_l1_validators.d.ts +30 -0
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -0
- package/dest/cmds/l1/update_l1_validators.js +186 -0
- package/dest/cmds/misc/compute_selector.d.ts +3 -0
- package/dest/cmds/misc/compute_selector.d.ts.map +1 -0
- package/dest/cmds/misc/compute_selector.js +5 -0
- package/dest/cmds/misc/example_contracts.d.ts +3 -0
- package/dest/cmds/misc/example_contracts.d.ts.map +1 -0
- package/dest/cmds/misc/example_contracts.js +6 -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_and_hash.d.ts +3 -0
- package/dest/cmds/misc/generate_secret_and_hash.d.ts.map +1 -0
- package/dest/cmds/misc/generate_secret_and_hash.js +11 -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 +44 -0
- package/dest/cmds/misc/setup_contracts.d.ts +7 -0
- package/dest/cmds/misc/setup_contracts.d.ts.map +1 -0
- package/dest/cmds/misc/setup_contracts.js +27 -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.map +1 -0
- package/dest/cmds/misc/update/github.js +3 -0
- package/dest/{update → cmds/misc/update}/noir.d.ts +2 -2
- package/dest/cmds/misc/update/noir.d.ts.map +1 -0
- package/dest/cmds/misc/update/noir.js +45 -0
- package/dest/{update → cmds/misc/update}/npm.d.ts +3 -3
- package/dest/cmds/misc/update/npm.d.ts.map +1 -0
- package/dest/cmds/misc/update/npm.js +127 -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 +52 -0
- package/dest/cmds/pxe/add_contract.d.ts +5 -0
- package/dest/cmds/pxe/add_contract.d.ts.map +1 -0
- package/dest/cmds/pxe/add_contract.js +29 -0
- package/dest/cmds/pxe/block_number.d.ts +3 -0
- package/dest/cmds/pxe/block_number.d.ts.map +1 -0
- package/dest/cmds/pxe/block_number.js +10 -0
- package/dest/cmds/pxe/get_account.d.ts +4 -0
- package/dest/cmds/pxe/get_account.d.ts.map +1 -0
- package/dest/cmds/pxe/get_account.js +10 -0
- package/dest/cmds/pxe/get_accounts.d.ts +3 -0
- package/dest/cmds/pxe/get_accounts.d.ts.map +1 -0
- package/dest/cmds/pxe/get_accounts.js +25 -0
- package/dest/cmds/pxe/get_block.d.ts +3 -0
- package/dest/cmds/pxe/get_block.d.ts.map +1 -0
- package/dest/cmds/pxe/get_block.js +9 -0
- package/dest/cmds/pxe/get_contract_data.d.ts +4 -0
- package/dest/cmds/pxe/get_contract_data.d.ts.map +1 -0
- package/dest/cmds/pxe/get_contract_data.js +31 -0
- package/dest/cmds/pxe/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/pxe/get_current_base_fee.js +7 -0
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +4 -0
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +11 -0
- package/dest/cmds/pxe/get_logs.d.ts +4 -0
- package/dest/cmds/pxe/get_logs.d.ts.map +1 -0
- package/dest/cmds/pxe/get_logs.js +51 -0
- package/dest/cmds/pxe/get_node_info.d.ts +3 -0
- package/dest/cmds/pxe/get_node_info.d.ts.map +1 -0
- package/dest/cmds/pxe/get_node_info.js +61 -0
- package/dest/cmds/pxe/get_pxe_info.d.ts +3 -0
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +1 -0
- package/dest/cmds/pxe/get_pxe_info.js +11 -0
- package/dest/cmds/pxe/index.d.ts +4 -0
- package/dest/cmds/pxe/index.d.ts.map +1 -0
- package/dest/cmds/pxe/index.js +55 -0
- package/dest/utils/aztec.d.ts +68 -0
- package/dest/utils/aztec.d.ts.map +1 -0
- package/dest/utils/aztec.js +173 -0
- package/dest/{parse_args.d.ts → utils/commands.d.ts} +50 -12
- package/dest/utils/commands.d.ts.map +1 -0
- package/dest/utils/commands.js +303 -0
- package/dest/{encoding.d.ts → utils/encoding.d.ts} +1 -1
- package/dest/utils/encoding.d.ts.map +1 -0
- package/dest/utils/encoding.js +103 -0
- package/dest/utils/github.d.ts +4 -0
- package/dest/utils/github.d.ts.map +1 -0
- package/dest/utils/github.js +3 -0
- package/dest/utils/index.d.ts +5 -0
- package/dest/utils/index.d.ts.map +1 -0
- package/dest/utils/index.js +4 -0
- package/dest/utils/inspect.d.ts +17 -0
- package/dest/utils/inspect.d.ts.map +1 -0
- package/dest/utils/inspect.js +177 -0
- package/package.json +68 -22
- package/src/cmds/contracts/index.ts +34 -0
- package/src/cmds/contracts/inspect_contract.ts +51 -0
- package/src/cmds/contracts/parse_parameter_struct.ts +27 -0
- package/src/cmds/devnet/bootstrap_network.ts +318 -0
- package/src/cmds/devnet/faucet.ts +33 -0
- package/src/cmds/devnet/index.ts +60 -0
- package/src/cmds/infrastructure/index.ts +55 -0
- package/src/cmds/infrastructure/sequencers.ts +103 -0
- package/src/cmds/infrastructure/setup_l2_contract.ts +47 -0
- package/src/cmds/l1/advance_epoch.ts +12 -0
- package/src/cmds/l1/assume_proven_through.ts +19 -0
- package/src/cmds/l1/bridge_erc20.ts +52 -0
- package/src/cmds/l1/create_l1_account.ts +17 -0
- package/src/cmds/l1/deploy_l1_contracts.ts +63 -0
- package/src/cmds/l1/deploy_l1_verifier.ts +105 -0
- package/src/cmds/l1/deploy_new_rollup.ts +58 -0
- package/src/cmds/l1/get_l1_addresses.ts +30 -0
- package/src/cmds/l1/get_l1_balance.ts +44 -0
- package/src/cmds/l1/governance_utils.ts +187 -0
- package/src/cmds/l1/index.ts +556 -0
- package/src/cmds/l1/prover_stats.ts +202 -0
- package/src/cmds/l1/update_l1_validators.ts +238 -0
- package/src/cmds/misc/compute_selector.ts +7 -0
- package/src/cmds/misc/example_contracts.ts +12 -0
- package/src/cmds/misc/generate_bootnode_enr.ts +12 -0
- package/src/cmds/misc/generate_p2p_private_key.ts +10 -0
- package/src/cmds/misc/generate_secret_and_hash.ts +15 -0
- package/src/cmds/misc/generate_secret_key.ts +5 -0
- package/src/cmds/misc/index.ts +92 -0
- package/src/cmds/misc/setup_contracts.ts +40 -0
- package/src/cmds/misc/update/common.ts +16 -0
- package/src/cmds/misc/update/github.ts +3 -0
- package/src/cmds/misc/update/noir.ts +57 -0
- package/src/cmds/misc/update/npm.ts +154 -0
- package/src/cmds/misc/update/utils.ts +50 -0
- package/src/cmds/misc/update.ts +78 -0
- package/src/cmds/pxe/add_contract.ts +41 -0
- package/src/cmds/pxe/block_number.ts +9 -0
- package/src/cmds/pxe/get_account.ts +16 -0
- package/src/cmds/pxe/get_accounts.ts +35 -0
- package/src/cmds/pxe/get_block.ts +10 -0
- package/src/cmds/pxe/get_contract_data.ts +51 -0
- package/src/cmds/pxe/get_current_base_fee.ts +9 -0
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +25 -0
- package/src/cmds/pxe/get_logs.ts +66 -0
- package/src/cmds/pxe/get_node_info.ts +71 -0
- package/src/cmds/pxe/get_pxe_info.ts +13 -0
- package/src/cmds/pxe/index.ts +170 -0
- package/src/utils/aztec.ts +248 -0
- package/src/utils/commands.ts +384 -0
- package/src/utils/encoding.ts +117 -0
- package/src/utils/github.ts +3 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/inspect.ts +208 -0
- package/dest/bin/index.d.ts +0 -3
- package/dest/bin/index.d.ts.map +0 -1
- package/dest/bin/index.js +0 -19
- package/dest/client.d.ts +0 -17
- package/dest/client.d.ts.map +0 -1
- package/dest/client.js +0 -60
- package/dest/cmds/add_contract.d.ts +0 -7
- package/dest/cmds/add_contract.d.ts.map +0 -1
- package/dest/cmds/add_contract.js +0 -15
- package/dest/cmds/add_note.d.ts +0 -8
- package/dest/cmds/add_note.d.ts.map +0 -1
- package/dest/cmds/add_note.js +0 -13
- package/dest/cmds/block_number.d.ts +0 -6
- package/dest/cmds/block_number.d.ts.map +0 -1
- package/dest/cmds/block_number.js +0 -10
- package/dest/cmds/call.d.ts +0 -7
- package/dest/cmds/call.d.ts.map +0 -1
- package/dest/cmds/call.js +0 -18
- package/dest/cmds/check_deploy.d.ts +0 -7
- package/dest/cmds/check_deploy.d.ts.map +0 -1
- package/dest/cmds/check_deploy.js +0 -16
- package/dest/cmds/compute_selector.d.ts +0 -6
- package/dest/cmds/compute_selector.d.ts.map +0 -1
- package/dest/cmds/compute_selector.js +0 -9
- package/dest/cmds/create_account.d.ts +0 -7
- package/dest/cmds/create_account.d.ts.map +0 -1
- package/dest/cmds/create_account.js +0 -31
- package/dest/cmds/deploy.d.ts +0 -7
- package/dest/cmds/deploy.d.ts.map +0 -1
- package/dest/cmds/deploy.js +0 -58
- package/dest/cmds/deploy_l1_contracts.d.ts +0 -6
- package/dest/cmds/deploy_l1_contracts.d.ts.map +0 -1
- package/dest/cmds/deploy_l1_contracts.js +0 -15
- package/dest/cmds/example_contracts.d.ts +0 -6
- package/dest/cmds/example_contracts.d.ts.map +0 -1
- package/dest/cmds/example_contracts.js +0 -10
- package/dest/cmds/generate_p2p_private_key.d.ts +0 -6
- package/dest/cmds/generate_p2p_private_key.d.ts.map +0 -1
- package/dest/cmds/generate_p2p_private_key.js +0 -11
- package/dest/cmds/generate_private_key.d.ts +0 -6
- package/dest/cmds/generate_private_key.d.ts.map +0 -1
- package/dest/cmds/generate_private_key.js +0 -22
- package/dest/cmds/get_account.d.ts +0 -7
- package/dest/cmds/get_account.d.ts.map +0 -1
- package/dest/cmds/get_account.js +0 -15
- package/dest/cmds/get_accounts.d.ts +0 -6
- package/dest/cmds/get_accounts.d.ts.map +0 -1
- package/dest/cmds/get_accounts.js +0 -18
- package/dest/cmds/get_contract_data.d.ts +0 -7
- package/dest/cmds/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/get_contract_data.js +0 -28
- package/dest/cmds/get_logs.d.ts +0 -7
- package/dest/cmds/get_logs.d.ts.map +0 -1
- package/dest/cmds/get_logs.js +0 -54
- package/dest/cmds/get_node_info.d.ts +0 -6
- package/dest/cmds/get_node_info.d.ts.map +0 -1
- package/dest/cmds/get_node_info.js +0 -15
- package/dest/cmds/get_recipient.d.ts +0 -7
- package/dest/cmds/get_recipient.d.ts.map +0 -1
- package/dest/cmds/get_recipient.js +0 -15
- package/dest/cmds/get_recipients.d.ts +0 -6
- package/dest/cmds/get_recipients.d.ts.map +0 -1
- package/dest/cmds/get_recipients.js +0 -18
- package/dest/cmds/get_tx_receipt.d.ts +0 -7
- package/dest/cmds/get_tx_receipt.d.ts.map +0 -1
- package/dest/cmds/get_tx_receipt.js +0 -16
- package/dest/cmds/inspect_contract.d.ts +0 -6
- package/dest/cmds/inspect_contract.d.ts.map +0 -1
- package/dest/cmds/inspect_contract.js +0 -19
- package/dest/cmds/parse_parameter_struct.d.ts.map +0 -1
- package/dest/cmds/parse_parameter_struct.js +0 -20
- package/dest/cmds/register_account.d.ts +0 -7
- package/dest/cmds/register_account.d.ts.map +0 -1
- package/dest/cmds/register_account.js +0 -13
- package/dest/cmds/register_recipient.d.ts +0 -7
- package/dest/cmds/register_recipient.d.ts.map +0 -1
- package/dest/cmds/register_recipient.js +0 -11
- package/dest/cmds/send.d.ts +0 -7
- package/dest/cmds/send.d.ts.map +0 -1
- package/dest/cmds/send.js +0 -27
- package/dest/cmds/unbox.d.ts +0 -7
- package/dest/cmds/unbox.d.ts.map +0 -1
- package/dest/cmds/unbox.js +0 -133
- package/dest/encoding.d.ts.map +0 -1
- package/dest/encoding.js +0 -114
- package/dest/github.d.ts.map +0 -1
- package/dest/github.js +0 -4
- package/dest/index.d.ts +0 -10
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -321
- package/dest/parse_args.d.ts.map +0 -1
- package/dest/parse_args.js +0 -233
- package/dest/test/mocks.d.ts +0 -3
- package/dest/test/mocks.d.ts.map +0 -1
- package/dest/test/mocks.js +0 -65
- package/dest/update/common.d.ts.map +0 -1
- package/dest/update/common.js +0 -2
- package/dest/update/noir.d.ts.map +0 -1
- package/dest/update/noir.js +0 -63
- package/dest/update/npm.d.ts.map +0 -1
- package/dest/update/npm.js +0 -125
- package/dest/update/update.d.ts +0 -3
- package/dest/update/update.d.ts.map +0 -1
- package/dest/update/update.js +0 -58
- package/dest/utils.d.ts +0 -70
- package/dest/utils.d.ts.map +0 -1
- package/dest/utils.js +0 -168
- /package/dest/{update → cmds/misc/update}/common.d.ts +0 -0
- /package/dest/{github.d.ts → cmds/misc/update/github.d.ts} +0 -0
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
+
|
|
4
|
+
import { type Command, Option } from 'commander';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ETHEREUM_HOSTS,
|
|
8
|
+
PRIVATE_KEY,
|
|
9
|
+
l1ChainIdOption,
|
|
10
|
+
makePxeOption,
|
|
11
|
+
parseAztecAddress,
|
|
12
|
+
parseBigint,
|
|
13
|
+
parseEthereumAddress,
|
|
14
|
+
pxeOption,
|
|
15
|
+
} from '../../utils/commands.js';
|
|
16
|
+
|
|
17
|
+
const l1RpcUrlsOption = new Option(
|
|
18
|
+
'--l1-rpc-urls <string>',
|
|
19
|
+
'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)',
|
|
20
|
+
)
|
|
21
|
+
.env('ETHEREUM_HOSTS')
|
|
22
|
+
.default([ETHEREUM_HOSTS])
|
|
23
|
+
.makeOptionMandatory(true)
|
|
24
|
+
.argParser((arg: string) => arg.split(',').map(url => url.trim()));
|
|
25
|
+
|
|
26
|
+
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
27
|
+
const { BB_BINARY_PATH, BB_WORKING_DIRECTORY } = process.env;
|
|
28
|
+
|
|
29
|
+
program
|
|
30
|
+
.command('deploy-l1-contracts')
|
|
31
|
+
.description('Deploys all necessary Ethereum contracts for Aztec.')
|
|
32
|
+
.addOption(l1RpcUrlsOption)
|
|
33
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
34
|
+
.option('--validators <string>', 'Comma separated list of validators')
|
|
35
|
+
.option(
|
|
36
|
+
'-m, --mnemonic <string>',
|
|
37
|
+
'The mnemonic to use in deployment',
|
|
38
|
+
'test test test test test test test test test test test junk',
|
|
39
|
+
)
|
|
40
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
|
|
41
|
+
.addOption(l1ChainIdOption)
|
|
42
|
+
.option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
|
|
43
|
+
.option('--json', 'Output the contract addresses in JSON format')
|
|
44
|
+
.option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
|
|
45
|
+
.action(async options => {
|
|
46
|
+
const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
|
|
47
|
+
|
|
48
|
+
const initialValidators =
|
|
49
|
+
options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
|
|
50
|
+
await deployL1Contracts(
|
|
51
|
+
options.l1RpcUrls,
|
|
52
|
+
options.l1ChainId,
|
|
53
|
+
options.privateKey,
|
|
54
|
+
options.mnemonic,
|
|
55
|
+
options.mnemonicIndex,
|
|
56
|
+
options.salt,
|
|
57
|
+
options.testAccounts,
|
|
58
|
+
options.json,
|
|
59
|
+
initialValidators,
|
|
60
|
+
log,
|
|
61
|
+
debugLogger,
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
program
|
|
66
|
+
.command('deploy-new-rollup')
|
|
67
|
+
.description('Deploys a new rollup contract and a payload to upgrade the registry with it.')
|
|
68
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
69
|
+
.addOption(l1RpcUrlsOption)
|
|
70
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
71
|
+
.option('--validators <string>', 'Comma separated list of validators')
|
|
72
|
+
.option(
|
|
73
|
+
'-m, --mnemonic <string>',
|
|
74
|
+
'The mnemonic to use in deployment',
|
|
75
|
+
'test test test test test test test test test test test junk',
|
|
76
|
+
)
|
|
77
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
|
|
78
|
+
.addOption(l1ChainIdOption)
|
|
79
|
+
.option('--salt <number>', 'The optional salt to use in deployment', arg => parseInt(arg))
|
|
80
|
+
.option('--json', 'Output the contract addresses in JSON format')
|
|
81
|
+
.option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
|
|
82
|
+
.action(async options => {
|
|
83
|
+
const { deployNewRollup } = await import('./deploy_new_rollup.js');
|
|
84
|
+
|
|
85
|
+
const initialValidators =
|
|
86
|
+
options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
|
|
87
|
+
await deployNewRollup(
|
|
88
|
+
options.registryAddress,
|
|
89
|
+
options.l1RpcUrls,
|
|
90
|
+
options.l1ChainId,
|
|
91
|
+
options.privateKey,
|
|
92
|
+
options.mnemonic,
|
|
93
|
+
options.mnemonicIndex,
|
|
94
|
+
options.salt,
|
|
95
|
+
options.testAccounts,
|
|
96
|
+
options.json,
|
|
97
|
+
initialValidators,
|
|
98
|
+
log,
|
|
99
|
+
debugLogger,
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
program
|
|
104
|
+
.command('deposit-governance-tokens')
|
|
105
|
+
.description('Deposits governance tokens to the governance contract.')
|
|
106
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
107
|
+
.requiredOption('--recipient <string>', 'The recipient of the tokens', parseEthereumAddress)
|
|
108
|
+
.requiredOption('-a, --amount <string>', 'The amount of tokens to deposit', parseBigint)
|
|
109
|
+
.option('--mint', 'Mint the tokens on L1', false)
|
|
110
|
+
.addOption(l1RpcUrlsOption)
|
|
111
|
+
.addOption(l1ChainIdOption)
|
|
112
|
+
.option('-p, --private-key <string>', 'The private key to use to deposit', PRIVATE_KEY)
|
|
113
|
+
.option(
|
|
114
|
+
'-m, --mnemonic <string>',
|
|
115
|
+
'The mnemonic to use to deposit',
|
|
116
|
+
'test test test test test test test test test test test junk',
|
|
117
|
+
)
|
|
118
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to deposit', arg => parseInt(arg), 0)
|
|
119
|
+
.action(async options => {
|
|
120
|
+
const { depositGovernanceTokens } = await import('./governance_utils.js');
|
|
121
|
+
await depositGovernanceTokens({
|
|
122
|
+
registryAddress: options.registryAddress.toString(),
|
|
123
|
+
recipient: options.recipient.toString(),
|
|
124
|
+
amount: options.amount,
|
|
125
|
+
mint: options.mint,
|
|
126
|
+
rpcUrls: options.l1RpcUrls,
|
|
127
|
+
chainId: options.l1ChainId,
|
|
128
|
+
privateKey: options.privateKey,
|
|
129
|
+
mnemonic: options.mnemonic,
|
|
130
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
131
|
+
debugLogger,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
program
|
|
136
|
+
.command('propose-with-lock')
|
|
137
|
+
.description('Makes a proposal to governance with a lock')
|
|
138
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
139
|
+
.requiredOption('-p, --payload-address <string>', 'The address of the payload contract', parseEthereumAddress)
|
|
140
|
+
.addOption(l1RpcUrlsOption)
|
|
141
|
+
.addOption(l1ChainIdOption)
|
|
142
|
+
.option('-pk, --private-key <string>', 'The private key to use to propose', PRIVATE_KEY)
|
|
143
|
+
.option(
|
|
144
|
+
'-m, --mnemonic <string>',
|
|
145
|
+
'The mnemonic to use to propose',
|
|
146
|
+
'test test test test test test test test test test test junk',
|
|
147
|
+
)
|
|
148
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to propose', arg => parseInt(arg), 0)
|
|
149
|
+
.option('--json', 'Output the proposal ID in JSON format')
|
|
150
|
+
.action(async options => {
|
|
151
|
+
const { proposeWithLock } = await import('./governance_utils.js');
|
|
152
|
+
await proposeWithLock({
|
|
153
|
+
payloadAddress: options.payloadAddress.toString(),
|
|
154
|
+
registryAddress: options.registryAddress.toString(),
|
|
155
|
+
rpcUrls: options.l1RpcUrls,
|
|
156
|
+
chainId: options.l1ChainId,
|
|
157
|
+
privateKey: options.privateKey,
|
|
158
|
+
mnemonic: options.mnemonic,
|
|
159
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
160
|
+
debugLogger: debugLogger,
|
|
161
|
+
json: options.json,
|
|
162
|
+
log,
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
program
|
|
167
|
+
.command('vote-on-governance-proposal')
|
|
168
|
+
.description('Votes on a governance proposal.')
|
|
169
|
+
.requiredOption('-p, --proposal-id <string>', 'The ID of the proposal', parseBigint)
|
|
170
|
+
.option('-a, --vote-amount <string>', 'The amount of tokens to vote', parseBigint)
|
|
171
|
+
.requiredOption(
|
|
172
|
+
'--in-favor <boolean>',
|
|
173
|
+
'Whether to vote in favor of the proposal. Use "yea" for true, any other value for false.',
|
|
174
|
+
arg => arg === 'yea' || arg === 'true' || arg === '1' || arg === 'yes',
|
|
175
|
+
)
|
|
176
|
+
.requiredOption('--wait <boolean>', 'Whether to wait until the proposal is active', arg => arg === 'true')
|
|
177
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
178
|
+
.addOption(l1RpcUrlsOption)
|
|
179
|
+
.addOption(l1ChainIdOption)
|
|
180
|
+
.option('-pk, --private-key <string>', 'The private key to use to vote', PRIVATE_KEY)
|
|
181
|
+
.option(
|
|
182
|
+
'-m, --mnemonic <string>',
|
|
183
|
+
'The mnemonic to use to vote',
|
|
184
|
+
'test test test test test test test test test test test junk',
|
|
185
|
+
)
|
|
186
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to vote', arg => parseInt(arg), 0)
|
|
187
|
+
.action(async options => {
|
|
188
|
+
const { voteOnGovernanceProposal } = await import('./governance_utils.js');
|
|
189
|
+
await voteOnGovernanceProposal({
|
|
190
|
+
proposalId: options.proposalId,
|
|
191
|
+
voteAmount: options.voteAmount,
|
|
192
|
+
inFavor: options.inFavor,
|
|
193
|
+
waitTilActive: options.wait,
|
|
194
|
+
registryAddress: options.registryAddress.toString(),
|
|
195
|
+
rpcUrls: options.l1RpcUrls,
|
|
196
|
+
chainId: options.l1ChainId,
|
|
197
|
+
privateKey: options.privateKey,
|
|
198
|
+
mnemonic: options.mnemonic,
|
|
199
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
200
|
+
debugLogger,
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
program
|
|
205
|
+
.command('execute-governance-proposal')
|
|
206
|
+
.description('Executes a governance proposal.')
|
|
207
|
+
.requiredOption('-p, --proposal-id <string>', 'The ID of the proposal', parseBigint)
|
|
208
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
209
|
+
.requiredOption('--wait <boolean>', 'Whether to wait until the proposal is executable', arg => arg === 'true')
|
|
210
|
+
.addOption(l1RpcUrlsOption)
|
|
211
|
+
.addOption(l1ChainIdOption)
|
|
212
|
+
.option('-pk, --private-key <string>', 'The private key to use to vote', PRIVATE_KEY)
|
|
213
|
+
.option(
|
|
214
|
+
'-m, --mnemonic <string>',
|
|
215
|
+
'The mnemonic to use to vote',
|
|
216
|
+
'test test test test test test test test test test test junk',
|
|
217
|
+
)
|
|
218
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to vote', arg => parseInt(arg), 0)
|
|
219
|
+
.action(async options => {
|
|
220
|
+
const { executeGovernanceProposal } = await import('./governance_utils.js');
|
|
221
|
+
await executeGovernanceProposal({
|
|
222
|
+
proposalId: options.proposalId,
|
|
223
|
+
registryAddress: options.registryAddress.toString(),
|
|
224
|
+
waitTilExecutable: options.wait,
|
|
225
|
+
rpcUrls: options.l1RpcUrls,
|
|
226
|
+
chainId: options.l1ChainId,
|
|
227
|
+
privateKey: options.privateKey,
|
|
228
|
+
mnemonic: options.mnemonic,
|
|
229
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
230
|
+
debugLogger,
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
program
|
|
235
|
+
.command('get-l1-addresses')
|
|
236
|
+
.description('Gets the addresses of the L1 contracts.')
|
|
237
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
238
|
+
.addOption(l1RpcUrlsOption)
|
|
239
|
+
.requiredOption('-v, --rollup-version <number>', 'The version of the rollup', arg => {
|
|
240
|
+
if (arg === 'canonical' || arg === 'latest' || arg === '') {
|
|
241
|
+
return 'canonical';
|
|
242
|
+
}
|
|
243
|
+
const version = parseInt(arg);
|
|
244
|
+
if (isNaN(version)) {
|
|
245
|
+
throw new Error('Invalid rollup version');
|
|
246
|
+
}
|
|
247
|
+
return version;
|
|
248
|
+
})
|
|
249
|
+
.addOption(l1ChainIdOption)
|
|
250
|
+
.option('--json', 'Output the addresses in JSON format')
|
|
251
|
+
.action(async options => {
|
|
252
|
+
const { getL1Addresses } = await import('./get_l1_addresses.js');
|
|
253
|
+
await getL1Addresses(
|
|
254
|
+
options.registryAddress,
|
|
255
|
+
options.rollupVersion,
|
|
256
|
+
options.l1RpcUrls,
|
|
257
|
+
options.l1ChainId,
|
|
258
|
+
options.json,
|
|
259
|
+
log,
|
|
260
|
+
);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
program
|
|
264
|
+
.command('generate-l1-account')
|
|
265
|
+
.description('Generates a new private key for an account on L1.')
|
|
266
|
+
.option('--json', 'Output the private key in JSON format')
|
|
267
|
+
.action(async () => {
|
|
268
|
+
const { generateL1Account } = await import('./update_l1_validators.js');
|
|
269
|
+
const account = generateL1Account();
|
|
270
|
+
log(JSON.stringify(account, null, 2));
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
program
|
|
274
|
+
.command('add-l1-validator')
|
|
275
|
+
.description('Adds a validator to the L1 rollup contract.')
|
|
276
|
+
.addOption(l1RpcUrlsOption)
|
|
277
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
278
|
+
.option(
|
|
279
|
+
'-m, --mnemonic <string>',
|
|
280
|
+
'The mnemonic to use in deployment',
|
|
281
|
+
'test test test test test test test test test test test junk',
|
|
282
|
+
)
|
|
283
|
+
.addOption(l1ChainIdOption)
|
|
284
|
+
.option('--validator <address>', 'ethereum address of the validator', parseEthereumAddress)
|
|
285
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
286
|
+
.option('--withdrawer <address>', 'ethereum address of the withdrawer', parseEthereumAddress)
|
|
287
|
+
.action(async options => {
|
|
288
|
+
const { addL1Validator } = await import('./update_l1_validators.js');
|
|
289
|
+
await addL1Validator({
|
|
290
|
+
rpcUrls: options.l1RpcUrls,
|
|
291
|
+
chainId: options.l1ChainId,
|
|
292
|
+
privateKey: options.privateKey,
|
|
293
|
+
mnemonic: options.mnemonic,
|
|
294
|
+
validatorAddress: options.validator,
|
|
295
|
+
rollupAddress: options.rollup,
|
|
296
|
+
withdrawerAddress: options.withdrawer,
|
|
297
|
+
log,
|
|
298
|
+
debugLogger,
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
program
|
|
303
|
+
.command('remove-l1-validator')
|
|
304
|
+
.description('Removes a validator to the L1 rollup contract.')
|
|
305
|
+
.addOption(l1RpcUrlsOption)
|
|
306
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
307
|
+
.option(
|
|
308
|
+
'-m, --mnemonic <string>',
|
|
309
|
+
'The mnemonic to use in deployment',
|
|
310
|
+
'test test test test test test test test test test test junk',
|
|
311
|
+
)
|
|
312
|
+
.addOption(l1ChainIdOption)
|
|
313
|
+
.option('--validator <address>', 'ethereum address of the validator', parseEthereumAddress)
|
|
314
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
315
|
+
.action(async options => {
|
|
316
|
+
const { removeL1Validator } = await import('./update_l1_validators.js');
|
|
317
|
+
await removeL1Validator({
|
|
318
|
+
rpcUrls: options.l1RpcUrls,
|
|
319
|
+
chainId: options.l1ChainId,
|
|
320
|
+
privateKey: options.privateKey,
|
|
321
|
+
mnemonic: options.mnemonic,
|
|
322
|
+
validatorAddress: options.validator,
|
|
323
|
+
rollupAddress: options.rollup,
|
|
324
|
+
log,
|
|
325
|
+
debugLogger,
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
program
|
|
330
|
+
.command('fast-forward-epochs')
|
|
331
|
+
.description('Fast forwards the epoch of the L1 rollup contract.')
|
|
332
|
+
.addOption(l1RpcUrlsOption)
|
|
333
|
+
.addOption(l1ChainIdOption)
|
|
334
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
335
|
+
.option('--count <number>', 'The number of epochs to fast forward', arg => BigInt(parseInt(arg)), 1n)
|
|
336
|
+
.action(async options => {
|
|
337
|
+
const { fastForwardEpochs } = await import('./update_l1_validators.js');
|
|
338
|
+
await fastForwardEpochs({
|
|
339
|
+
rpcUrls: options.l1RpcUrls,
|
|
340
|
+
chainId: options.l1ChainId,
|
|
341
|
+
rollupAddress: options.rollup,
|
|
342
|
+
numEpochs: options.count,
|
|
343
|
+
log,
|
|
344
|
+
debugLogger,
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
program
|
|
349
|
+
.command('debug-rollup')
|
|
350
|
+
.description('Debugs the rollup contract.')
|
|
351
|
+
.addOption(l1RpcUrlsOption)
|
|
352
|
+
.addOption(l1ChainIdOption)
|
|
353
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
354
|
+
.action(async options => {
|
|
355
|
+
const { debugRollup } = await import('./update_l1_validators.js');
|
|
356
|
+
await debugRollup({
|
|
357
|
+
rpcUrls: options.l1RpcUrls,
|
|
358
|
+
chainId: options.l1ChainId,
|
|
359
|
+
privateKey: options.privateKey,
|
|
360
|
+
mnemonic: options.mnemonic,
|
|
361
|
+
rollupAddress: options.rollup,
|
|
362
|
+
log,
|
|
363
|
+
debugLogger,
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
program
|
|
368
|
+
.command('prune-rollup')
|
|
369
|
+
.description('Prunes the pending chain on the rollup contract.')
|
|
370
|
+
.addOption(l1RpcUrlsOption)
|
|
371
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
372
|
+
.option(
|
|
373
|
+
'-m, --mnemonic <string>',
|
|
374
|
+
'The mnemonic to use in deployment',
|
|
375
|
+
'test test test test test test test test test test test junk',
|
|
376
|
+
)
|
|
377
|
+
.addOption(l1ChainIdOption)
|
|
378
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
379
|
+
.action(async options => {
|
|
380
|
+
const { pruneRollup } = await import('./update_l1_validators.js');
|
|
381
|
+
await pruneRollup({
|
|
382
|
+
rpcUrls: options.rpcUrls,
|
|
383
|
+
chainId: options.l1ChainId,
|
|
384
|
+
privateKey: options.privateKey,
|
|
385
|
+
mnemonic: options.mnemonic,
|
|
386
|
+
rollupAddress: options.rollup,
|
|
387
|
+
log,
|
|
388
|
+
debugLogger,
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
program
|
|
393
|
+
.command('deploy-l1-verifier')
|
|
394
|
+
.description('Deploys the rollup verifier contract')
|
|
395
|
+
.addOption(l1RpcUrlsOption)
|
|
396
|
+
.addOption(l1ChainIdOption)
|
|
397
|
+
.addOption(makePxeOption(false).conflicts('rollup-address'))
|
|
398
|
+
.addOption(
|
|
399
|
+
new Option('--rollup-address <string>', 'The address of the rollup contract')
|
|
400
|
+
.env('ROLLUP_CONTRACT_ADDRESS')
|
|
401
|
+
.argParser(parseEthereumAddress)
|
|
402
|
+
.conflicts('rpc-url'),
|
|
403
|
+
)
|
|
404
|
+
.option('--l1-private-key <string>', 'The L1 private key to use for deployment', PRIVATE_KEY)
|
|
405
|
+
.option(
|
|
406
|
+
'-m, --mnemonic <string>',
|
|
407
|
+
'The mnemonic to use in deployment',
|
|
408
|
+
'test test test test test test test test test test test junk',
|
|
409
|
+
)
|
|
410
|
+
.requiredOption('--verifier <verifier>', 'Either mock or real', 'real')
|
|
411
|
+
.option('--bb <path>', 'Path to bb binary', BB_BINARY_PATH)
|
|
412
|
+
.option('--bb-working-dir <path>', 'Path to bb working directory', BB_WORKING_DIRECTORY)
|
|
413
|
+
.action(async options => {
|
|
414
|
+
const { deployMockVerifier, deployUltraHonkVerifier } = await import('./deploy_l1_verifier.js');
|
|
415
|
+
if (options.verifier === 'mock') {
|
|
416
|
+
await deployMockVerifier(
|
|
417
|
+
options.rollupAddress?.toString(),
|
|
418
|
+
options.l1RpcUrls,
|
|
419
|
+
options.l1ChainId,
|
|
420
|
+
options.l1PrivateKey,
|
|
421
|
+
options.mnemonic,
|
|
422
|
+
options.rpcUrl,
|
|
423
|
+
log,
|
|
424
|
+
debugLogger,
|
|
425
|
+
);
|
|
426
|
+
} else {
|
|
427
|
+
await deployUltraHonkVerifier(
|
|
428
|
+
options.rollupAddress?.toString(),
|
|
429
|
+
options.l1RpcUrls,
|
|
430
|
+
options.l1ChainId,
|
|
431
|
+
options.l1PrivateKey,
|
|
432
|
+
options.mnemonic,
|
|
433
|
+
options.rpcUrl,
|
|
434
|
+
options.bb,
|
|
435
|
+
options.bbWorkingDir,
|
|
436
|
+
log,
|
|
437
|
+
debugLogger,
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
program
|
|
443
|
+
.command('bridge-erc20')
|
|
444
|
+
.description('Bridges ERC20 tokens to L2.')
|
|
445
|
+
.argument('<amount>', 'The amount of Fee Juice to mint and bridge.', parseBigint)
|
|
446
|
+
.argument('<recipient>', 'Aztec address of the recipient.', parseAztecAddress)
|
|
447
|
+
.addOption(l1RpcUrlsOption)
|
|
448
|
+
.option(
|
|
449
|
+
'-m, --mnemonic <string>',
|
|
450
|
+
'The mnemonic to use for deriving the Ethereum address that will mint and bridge',
|
|
451
|
+
'test test test test test test test test test test test junk',
|
|
452
|
+
)
|
|
453
|
+
.option('--mint', 'Mint the tokens on L1', false)
|
|
454
|
+
.option('--private', 'If the bridge should use the private flow', false)
|
|
455
|
+
.addOption(l1ChainIdOption)
|
|
456
|
+
.requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress)
|
|
457
|
+
.requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress)
|
|
458
|
+
.option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
459
|
+
.option('--json', 'Output the claim in JSON format')
|
|
460
|
+
.action(async (amount, recipient, options) => {
|
|
461
|
+
const { bridgeERC20 } = await import('./bridge_erc20.js');
|
|
462
|
+
await bridgeERC20(
|
|
463
|
+
amount,
|
|
464
|
+
recipient,
|
|
465
|
+
options.l1RpcUrls,
|
|
466
|
+
options.l1ChainId,
|
|
467
|
+
options.l1PrivateKey,
|
|
468
|
+
options.mnemonic,
|
|
469
|
+
options.token,
|
|
470
|
+
options.portal,
|
|
471
|
+
options.private,
|
|
472
|
+
options.mint,
|
|
473
|
+
options.json,
|
|
474
|
+
log,
|
|
475
|
+
debugLogger,
|
|
476
|
+
);
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
program
|
|
480
|
+
.command('create-l1-account')
|
|
481
|
+
.option('--json', 'Output the account in JSON format')
|
|
482
|
+
.action(async options => {
|
|
483
|
+
const { createL1Account } = await import('./create_l1_account.js');
|
|
484
|
+
createL1Account(options.json, log);
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
program
|
|
488
|
+
.command('get-l1-balance')
|
|
489
|
+
.description('Gets the balance of an ERC token in L1 for the given Ethereum address.')
|
|
490
|
+
.argument('<who>', 'Ethereum address to check.', parseEthereumAddress)
|
|
491
|
+
.addOption(l1RpcUrlsOption)
|
|
492
|
+
.option('-t, --token <string>', 'The address of the token to check the balance of', parseEthereumAddress)
|
|
493
|
+
.addOption(l1ChainIdOption)
|
|
494
|
+
.option('--json', 'Output the balance in JSON format')
|
|
495
|
+
.action(async (who, options) => {
|
|
496
|
+
const { getL1Balance } = await import('./get_l1_balance.js');
|
|
497
|
+
await getL1Balance(who, options.token, options.l1RpcUrls, options.l1ChainId, options.json, log);
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
program
|
|
501
|
+
.command('set-proven-through', { hidden: true })
|
|
502
|
+
.description(
|
|
503
|
+
'Instructs the L1 rollup contract to assume all blocks until the given number are automatically proven.',
|
|
504
|
+
)
|
|
505
|
+
.argument('[blockNumber]', 'The target block number, defaults to the latest pending block number.', parseBigint)
|
|
506
|
+
.addOption(l1RpcUrlsOption)
|
|
507
|
+
.addOption(pxeOption)
|
|
508
|
+
.action(async (blockNumber, options) => {
|
|
509
|
+
const { assumeProvenThrough } = await import('./assume_proven_through.js');
|
|
510
|
+
await assumeProvenThrough(blockNumber, options.l1RpcUrls, options.rpcUrl, log);
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
program
|
|
514
|
+
.command('advance-epoch')
|
|
515
|
+
.description('Use L1 cheat codes to warp time until the next epoch.')
|
|
516
|
+
.addOption(l1RpcUrlsOption)
|
|
517
|
+
.addOption(pxeOption)
|
|
518
|
+
.action(async options => {
|
|
519
|
+
const { advanceEpoch } = await import('./advance_epoch.js');
|
|
520
|
+
await advanceEpoch(options.l1RpcUrls, options.rpcUrl, log);
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
program
|
|
524
|
+
.command('prover-stats', { hidden: true })
|
|
525
|
+
.addOption(l1RpcUrlsOption)
|
|
526
|
+
.addOption(l1ChainIdOption)
|
|
527
|
+
.option('--start-block <number>', 'The L1 block number to start from', parseBigint, 1n)
|
|
528
|
+
.option('--end-block <number>', 'The last L1 block number to query', parseBigint)
|
|
529
|
+
.option('--batch-size <number>', 'The number of blocks to query in each batch', parseBigint, 100n)
|
|
530
|
+
.option('--proving-timeout <number>', 'Cutoff for proving time to consider a block', parseBigint)
|
|
531
|
+
.option('--l1-rollup-address <string>', 'Address of the rollup contract (required if node URL is not set)')
|
|
532
|
+
.option(
|
|
533
|
+
'--node-url <string>',
|
|
534
|
+
'JSON RPC URL of an Aztec node to retrieve the rollup contract address (required if L1 rollup address is not set)',
|
|
535
|
+
)
|
|
536
|
+
.option('--raw-logs', 'Output raw logs instead of aggregated stats')
|
|
537
|
+
.action(async options => {
|
|
538
|
+
const { proverStats } = await import('./prover_stats.js');
|
|
539
|
+
const { l1RpcUrls, chainId, l1RollupAddress, startBlock, endBlock, batchSize, nodeUrl, provingTimeout, rawLogs } =
|
|
540
|
+
options;
|
|
541
|
+
await proverStats({
|
|
542
|
+
l1RpcUrls,
|
|
543
|
+
chainId,
|
|
544
|
+
l1RollupAddress,
|
|
545
|
+
startBlock,
|
|
546
|
+
endBlock,
|
|
547
|
+
batchSize,
|
|
548
|
+
nodeUrl,
|
|
549
|
+
provingTimeout,
|
|
550
|
+
rawLogs,
|
|
551
|
+
log,
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
return program;
|
|
556
|
+
}
|