@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,499 @@
|
|
|
1
|
+
import { CheckpointNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
|
+
import { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
3
|
+
import type { LogFn, Logger } from '@aztec-labs/foundation/log';
|
|
4
|
+
import { type Command, Option } from 'commander';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ETHEREUM_HOSTS,
|
|
8
|
+
MNEMONIC,
|
|
9
|
+
PRIVATE_KEY,
|
|
10
|
+
l1ChainIdOption,
|
|
11
|
+
nodeOption,
|
|
12
|
+
parseBigint,
|
|
13
|
+
parseEthereumAddress,
|
|
14
|
+
} from '../../utils/commands.js';
|
|
15
|
+
|
|
16
|
+
const l1RpcUrlsOption = new Option(
|
|
17
|
+
'--l1-rpc-urls <string>',
|
|
18
|
+
'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)',
|
|
19
|
+
)
|
|
20
|
+
.env('ETHEREUM_HOSTS')
|
|
21
|
+
.default([ETHEREUM_HOSTS])
|
|
22
|
+
.makeOptionMandatory(true)
|
|
23
|
+
.argParser((arg: string) => arg.split(',').map(url => url.trim()));
|
|
24
|
+
|
|
25
|
+
const networkOption = new Option('--network <string>', 'Network to execute against').env('NETWORK');
|
|
26
|
+
|
|
27
|
+
export function injectCommands(program: Command, log: LogFn, debugLogger: Logger) {
|
|
28
|
+
program
|
|
29
|
+
.command('deploy-l1-contracts')
|
|
30
|
+
.description('Deploys all necessary Ethereum contracts for Aztec.')
|
|
31
|
+
.addOption(l1RpcUrlsOption)
|
|
32
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
33
|
+
.option('--validators <string>', 'Comma separated list of validators')
|
|
34
|
+
.option(
|
|
35
|
+
'-m, --mnemonic <string>',
|
|
36
|
+
'The mnemonic to use in deployment',
|
|
37
|
+
'test test test test test test test test test test test junk',
|
|
38
|
+
)
|
|
39
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
|
|
40
|
+
.addOption(l1ChainIdOption)
|
|
41
|
+
.option('--json', 'Output the contract addresses in JSON format')
|
|
42
|
+
.option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
|
|
43
|
+
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
44
|
+
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
45
|
+
.option('--existing-token <address>', 'Use an existing ERC20 for both fee and staking', parseEthereumAddress)
|
|
46
|
+
.action(async options => {
|
|
47
|
+
const { deployL1ContractsCmd } = await import('./deploy_l1_contracts_cmd.js');
|
|
48
|
+
|
|
49
|
+
const initialValidators =
|
|
50
|
+
options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
|
|
51
|
+
await deployL1ContractsCmd(
|
|
52
|
+
options.l1RpcUrls,
|
|
53
|
+
options.l1ChainId,
|
|
54
|
+
options.privateKey,
|
|
55
|
+
options.mnemonic,
|
|
56
|
+
options.mnemonicIndex,
|
|
57
|
+
options.testAccounts,
|
|
58
|
+
options.sponsoredFpc,
|
|
59
|
+
options.json,
|
|
60
|
+
initialValidators,
|
|
61
|
+
options.realVerifier,
|
|
62
|
+
options.existingToken,
|
|
63
|
+
log,
|
|
64
|
+
debugLogger,
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
program
|
|
69
|
+
.command('deploy-new-rollup')
|
|
70
|
+
.description('Deploys a new rollup contract and adds it to the registry (if you are the owner).')
|
|
71
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
72
|
+
.addOption(l1RpcUrlsOption)
|
|
73
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
74
|
+
.option('--validators <string>', 'Comma separated list of validators')
|
|
75
|
+
.option(
|
|
76
|
+
'-m, --mnemonic <string>',
|
|
77
|
+
'The mnemonic to use in deployment',
|
|
78
|
+
MNEMONIC ?? 'test test test test test test test test test test test junk',
|
|
79
|
+
)
|
|
80
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', arg => parseInt(arg), 0)
|
|
81
|
+
.addOption(l1ChainIdOption)
|
|
82
|
+
.option('--json', 'Output the contract addresses in JSON format')
|
|
83
|
+
.option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts')
|
|
84
|
+
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
85
|
+
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
86
|
+
.action(async options => {
|
|
87
|
+
const { deployNewRollup } = await import('./deploy_new_rollup.js');
|
|
88
|
+
|
|
89
|
+
const initialValidators =
|
|
90
|
+
options.validators?.split(',').map((validator: string) => EthAddress.fromString(validator)) || [];
|
|
91
|
+
await deployNewRollup(
|
|
92
|
+
options.registryAddress,
|
|
93
|
+
options.l1RpcUrls,
|
|
94
|
+
options.l1ChainId,
|
|
95
|
+
options.privateKey,
|
|
96
|
+
options.mnemonic,
|
|
97
|
+
options.mnemonicIndex,
|
|
98
|
+
options.testAccounts,
|
|
99
|
+
options.sponsoredFpc,
|
|
100
|
+
options.json,
|
|
101
|
+
initialValidators,
|
|
102
|
+
options.realVerifier,
|
|
103
|
+
log,
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
program
|
|
108
|
+
.command('compute-genesis-values')
|
|
109
|
+
.description('Computes genesis values (VK tree root, protocol contracts hash, genesis archive root).')
|
|
110
|
+
.addOption(
|
|
111
|
+
new Option('--test-accounts <boolean>', 'Include initial test accounts in genesis state')
|
|
112
|
+
.env('TEST_ACCOUNTS')
|
|
113
|
+
.argParser(arg => arg === 'true'),
|
|
114
|
+
)
|
|
115
|
+
.addOption(
|
|
116
|
+
new Option('--sponsored-fpc <boolean>', 'Include sponsored FPC contract in genesis state')
|
|
117
|
+
.env('SPONSORED_FPC')
|
|
118
|
+
.argParser(arg => arg === 'true'),
|
|
119
|
+
)
|
|
120
|
+
.action(async options => {
|
|
121
|
+
const { computeGenesisValuesCmd } = await import('./compute_genesis_values.js');
|
|
122
|
+
await computeGenesisValuesCmd(options.testAccounts, options.sponsoredFpc, log);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
program
|
|
126
|
+
.command('deposit-governance-tokens')
|
|
127
|
+
.description('Deposits governance tokens to the governance contract.')
|
|
128
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
129
|
+
.requiredOption('--recipient <string>', 'The recipient of the tokens', parseEthereumAddress)
|
|
130
|
+
.requiredOption('-a, --amount <string>', 'The amount of tokens to deposit', parseBigint)
|
|
131
|
+
.option('--mint', 'Mint the tokens on L1', false)
|
|
132
|
+
.addOption(l1RpcUrlsOption)
|
|
133
|
+
.addOption(l1ChainIdOption)
|
|
134
|
+
.option('-p, --private-key <string>', 'The private key to use to deposit', PRIVATE_KEY)
|
|
135
|
+
.option(
|
|
136
|
+
'-m, --mnemonic <string>',
|
|
137
|
+
'The mnemonic to use to deposit',
|
|
138
|
+
'test test test test test test test test test test test junk',
|
|
139
|
+
)
|
|
140
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to deposit', arg => parseInt(arg), 0)
|
|
141
|
+
.action(async options => {
|
|
142
|
+
const { depositGovernanceTokens } = await import('./governance_utils.js');
|
|
143
|
+
await depositGovernanceTokens({
|
|
144
|
+
registryAddress: options.registryAddress.toString(),
|
|
145
|
+
recipient: options.recipient.toString(),
|
|
146
|
+
amount: options.amount,
|
|
147
|
+
mint: options.mint,
|
|
148
|
+
rpcUrls: options.l1RpcUrls,
|
|
149
|
+
chainId: options.l1ChainId,
|
|
150
|
+
privateKey: options.privateKey,
|
|
151
|
+
mnemonic: options.mnemonic,
|
|
152
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
153
|
+
debugLogger,
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
program
|
|
158
|
+
.command('propose-with-lock')
|
|
159
|
+
.description('Makes a proposal to governance with a lock')
|
|
160
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
161
|
+
.requiredOption('-p, --payload-address <string>', 'The address of the payload contract', parseEthereumAddress)
|
|
162
|
+
.addOption(l1RpcUrlsOption)
|
|
163
|
+
.addOption(l1ChainIdOption)
|
|
164
|
+
.option('-pk, --private-key <string>', 'The private key to use to propose', PRIVATE_KEY)
|
|
165
|
+
.option(
|
|
166
|
+
'-m, --mnemonic <string>',
|
|
167
|
+
'The mnemonic to use to propose',
|
|
168
|
+
'test test test test test test test test test test test junk',
|
|
169
|
+
)
|
|
170
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to propose', arg => parseInt(arg), 0)
|
|
171
|
+
.option('--json', 'Output the proposal ID in JSON format')
|
|
172
|
+
.action(async options => {
|
|
173
|
+
const { proposeWithLock } = await import('./governance_utils.js');
|
|
174
|
+
await proposeWithLock({
|
|
175
|
+
payloadAddress: options.payloadAddress.toString(),
|
|
176
|
+
registryAddress: options.registryAddress.toString(),
|
|
177
|
+
rpcUrls: options.l1RpcUrls,
|
|
178
|
+
chainId: options.l1ChainId,
|
|
179
|
+
privateKey: options.privateKey,
|
|
180
|
+
mnemonic: options.mnemonic,
|
|
181
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
182
|
+
debugLogger: debugLogger,
|
|
183
|
+
json: options.json,
|
|
184
|
+
log,
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
program
|
|
189
|
+
.command('vote-on-governance-proposal')
|
|
190
|
+
.description('Votes on a governance proposal.')
|
|
191
|
+
.requiredOption('-p, --proposal-id <string>', 'The ID of the proposal', parseBigint)
|
|
192
|
+
.option('-a, --vote-amount <string>', 'The amount of tokens to vote', parseBigint)
|
|
193
|
+
.requiredOption(
|
|
194
|
+
'--in-favor <boolean>',
|
|
195
|
+
'Whether to vote in favor of the proposal. Use "yea" for true, any other value for false.',
|
|
196
|
+
arg => arg === 'yea' || arg === 'true' || arg === '1' || arg === 'yes',
|
|
197
|
+
)
|
|
198
|
+
.requiredOption('--wait <boolean>', 'Whether to wait until the proposal is active', arg => arg === 'true')
|
|
199
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
200
|
+
.addOption(l1RpcUrlsOption)
|
|
201
|
+
.addOption(l1ChainIdOption)
|
|
202
|
+
.option('-pk, --private-key <string>', 'The private key to use to vote', PRIVATE_KEY)
|
|
203
|
+
.option(
|
|
204
|
+
'-m, --mnemonic <string>',
|
|
205
|
+
'The mnemonic to use to vote',
|
|
206
|
+
'test test test test test test test test test test test junk',
|
|
207
|
+
)
|
|
208
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to vote', arg => parseInt(arg), 0)
|
|
209
|
+
.action(async options => {
|
|
210
|
+
const { voteOnGovernanceProposal } = await import('./governance_utils.js');
|
|
211
|
+
await voteOnGovernanceProposal({
|
|
212
|
+
proposalId: options.proposalId,
|
|
213
|
+
voteAmount: options.voteAmount,
|
|
214
|
+
inFavor: options.inFavor,
|
|
215
|
+
waitTilActive: options.wait,
|
|
216
|
+
registryAddress: options.registryAddress.toString(),
|
|
217
|
+
rpcUrls: options.l1RpcUrls,
|
|
218
|
+
chainId: options.l1ChainId,
|
|
219
|
+
privateKey: options.privateKey,
|
|
220
|
+
mnemonic: options.mnemonic,
|
|
221
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
222
|
+
debugLogger,
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
program
|
|
227
|
+
.command('execute-governance-proposal')
|
|
228
|
+
.description('Executes a governance proposal.')
|
|
229
|
+
.requiredOption('-p, --proposal-id <string>', 'The ID of the proposal', parseBigint)
|
|
230
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
231
|
+
.requiredOption('--wait <boolean>', 'Whether to wait until the proposal is executable', arg => arg === 'true')
|
|
232
|
+
.addOption(l1RpcUrlsOption)
|
|
233
|
+
.addOption(l1ChainIdOption)
|
|
234
|
+
.option('-pk, --private-key <string>', 'The private key to use to vote', PRIVATE_KEY)
|
|
235
|
+
.option(
|
|
236
|
+
'-m, --mnemonic <string>',
|
|
237
|
+
'The mnemonic to use to vote',
|
|
238
|
+
'test test test test test test test test test test test junk',
|
|
239
|
+
)
|
|
240
|
+
.option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use to vote', arg => parseInt(arg), 0)
|
|
241
|
+
.action(async options => {
|
|
242
|
+
const { executeGovernanceProposal } = await import('./governance_utils.js');
|
|
243
|
+
await executeGovernanceProposal({
|
|
244
|
+
proposalId: options.proposalId,
|
|
245
|
+
registryAddress: options.registryAddress.toString(),
|
|
246
|
+
waitTilExecutable: options.wait,
|
|
247
|
+
rpcUrls: options.l1RpcUrls,
|
|
248
|
+
chainId: options.l1ChainId,
|
|
249
|
+
privateKey: options.privateKey,
|
|
250
|
+
mnemonic: options.mnemonic,
|
|
251
|
+
mnemonicIndex: options.mnemonicIndex,
|
|
252
|
+
debugLogger,
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
program
|
|
257
|
+
.command('get-l1-addresses')
|
|
258
|
+
.description('Gets the addresses of the L1 contracts.')
|
|
259
|
+
.requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress)
|
|
260
|
+
.addOption(l1RpcUrlsOption)
|
|
261
|
+
.requiredOption('-v, --rollup-version <number>', 'The version of the rollup', arg => {
|
|
262
|
+
if (arg === 'canonical' || arg === 'latest' || arg === '') {
|
|
263
|
+
return 'canonical';
|
|
264
|
+
}
|
|
265
|
+
const version = parseInt(arg);
|
|
266
|
+
if (isNaN(version)) {
|
|
267
|
+
throw new Error('Invalid rollup version');
|
|
268
|
+
}
|
|
269
|
+
return version;
|
|
270
|
+
})
|
|
271
|
+
.addOption(l1ChainIdOption)
|
|
272
|
+
.option('--json', 'Output the addresses in JSON format')
|
|
273
|
+
.action(async options => {
|
|
274
|
+
const { getL1Addresses } = await import('./get_l1_addresses.js');
|
|
275
|
+
await getL1Addresses(
|
|
276
|
+
options.registryAddress,
|
|
277
|
+
options.rollupVersion,
|
|
278
|
+
options.l1RpcUrls,
|
|
279
|
+
options.l1ChainId,
|
|
280
|
+
options.json,
|
|
281
|
+
log,
|
|
282
|
+
);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
program
|
|
286
|
+
.command('generate-l1-account')
|
|
287
|
+
.description('Generates a new private key for an account on L1.')
|
|
288
|
+
.option('--json', 'Output the private key in JSON format')
|
|
289
|
+
.action(async () => {
|
|
290
|
+
const { generateL1Account } = await import('./update_l1_validators.js');
|
|
291
|
+
const account = generateL1Account();
|
|
292
|
+
log(JSON.stringify(account, null, 2));
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
program
|
|
296
|
+
.command('add-l1-validator')
|
|
297
|
+
.description('Adds a validator to the L1 rollup contract via a direct deposit.')
|
|
298
|
+
.addOption(l1RpcUrlsOption)
|
|
299
|
+
.addOption(networkOption)
|
|
300
|
+
.option('-pk, --private-key <string>', 'The private key to use sending the transaction', PRIVATE_KEY)
|
|
301
|
+
.option(
|
|
302
|
+
'-m, --mnemonic <string>',
|
|
303
|
+
'The mnemonic to use sending the transaction',
|
|
304
|
+
'test test test test test test test test test test test junk',
|
|
305
|
+
)
|
|
306
|
+
.addOption(l1ChainIdOption)
|
|
307
|
+
.option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress)
|
|
308
|
+
.option('--withdrawer <address>', 'ethereum address of the withdrawer', parseEthereumAddress)
|
|
309
|
+
.option(
|
|
310
|
+
'--bls-secret-key <string>',
|
|
311
|
+
'The BN254 scalar field element used as a secret key for BLS signatures. Will be associated with the attester address.',
|
|
312
|
+
parseBigint,
|
|
313
|
+
)
|
|
314
|
+
.option('--move-with-latest-rollup', 'Whether to move with the latest rollup', true)
|
|
315
|
+
.option('--rollup <string>', 'Rollup contract address', parseEthereumAddress)
|
|
316
|
+
.action(async options => {
|
|
317
|
+
const { addL1ValidatorViaRollup } = await import('./update_l1_validators.js');
|
|
318
|
+
|
|
319
|
+
let rollupAddress = options.rollup;
|
|
320
|
+
if (!rollupAddress) {
|
|
321
|
+
const { getL1RollupAddressFromEnv } = await import('../../config/get_l1_config.js');
|
|
322
|
+
rollupAddress = await getL1RollupAddressFromEnv(options.l1RpcUrls, options.l1ChainId);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
await addL1ValidatorViaRollup({
|
|
326
|
+
rpcUrls: options.l1RpcUrls,
|
|
327
|
+
chainId: options.l1ChainId,
|
|
328
|
+
privateKey: options.privateKey,
|
|
329
|
+
mnemonic: options.mnemonic,
|
|
330
|
+
attesterAddress: options.attester,
|
|
331
|
+
blsSecretKey: options.blsSecretKey,
|
|
332
|
+
withdrawerAddress: options.withdrawer,
|
|
333
|
+
rollupAddress,
|
|
334
|
+
moveWithLatestRollup: options.moveWithLatestRollup,
|
|
335
|
+
log,
|
|
336
|
+
debugLogger,
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
program
|
|
341
|
+
.command('remove-l1-validator')
|
|
342
|
+
.description('Removes a validator to the L1 rollup contract.')
|
|
343
|
+
.addOption(l1RpcUrlsOption)
|
|
344
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
345
|
+
.option(
|
|
346
|
+
'-m, --mnemonic <string>',
|
|
347
|
+
'The mnemonic to use in deployment',
|
|
348
|
+
'test test test test test test test test test test test junk',
|
|
349
|
+
)
|
|
350
|
+
.addOption(l1ChainIdOption)
|
|
351
|
+
.option('--validator <address>', 'ethereum address of the validator', parseEthereumAddress)
|
|
352
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
353
|
+
.action(async options => {
|
|
354
|
+
const { removeL1Validator } = await import('./update_l1_validators.js');
|
|
355
|
+
await removeL1Validator({
|
|
356
|
+
rpcUrls: options.l1RpcUrls,
|
|
357
|
+
chainId: options.l1ChainId,
|
|
358
|
+
privateKey: options.privateKey,
|
|
359
|
+
mnemonic: options.mnemonic,
|
|
360
|
+
validatorAddress: options.validator,
|
|
361
|
+
rollupAddress: options.rollup,
|
|
362
|
+
log,
|
|
363
|
+
debugLogger,
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
program
|
|
368
|
+
.command('fast-forward-epochs')
|
|
369
|
+
.description('Fast forwards the epoch of the L1 rollup contract.')
|
|
370
|
+
.addOption(l1RpcUrlsOption)
|
|
371
|
+
.addOption(l1ChainIdOption)
|
|
372
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
373
|
+
.option('--count <number>', 'The number of epochs to fast forward', arg => BigInt(parseInt(arg)), 1n)
|
|
374
|
+
.action(async options => {
|
|
375
|
+
const { fastForwardEpochs } = await import('./update_l1_validators.js');
|
|
376
|
+
await fastForwardEpochs({
|
|
377
|
+
rpcUrls: options.l1RpcUrls,
|
|
378
|
+
chainId: options.l1ChainId,
|
|
379
|
+
rollupAddress: options.rollup,
|
|
380
|
+
numEpochs: options.count,
|
|
381
|
+
log,
|
|
382
|
+
debugLogger,
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
program
|
|
387
|
+
.command('trigger-seed-snapshot')
|
|
388
|
+
.description('Triggers a seed snapshot for the next epoch.')
|
|
389
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
390
|
+
.option(
|
|
391
|
+
'-m, --mnemonic <string>',
|
|
392
|
+
'The mnemonic to use in deployment',
|
|
393
|
+
'test test test test test test test test test test test junk',
|
|
394
|
+
)
|
|
395
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
396
|
+
.addOption(l1RpcUrlsOption)
|
|
397
|
+
.addOption(l1ChainIdOption)
|
|
398
|
+
.action(async options => {
|
|
399
|
+
const { triggerSeedSnapshot } = await import('./trigger_seed_snapshot.js');
|
|
400
|
+
await triggerSeedSnapshot({
|
|
401
|
+
rollupAddress: options.rollup,
|
|
402
|
+
rpcUrls: options.l1RpcUrls,
|
|
403
|
+
chainId: options.l1ChainId,
|
|
404
|
+
privateKey: options.privateKey,
|
|
405
|
+
mnemonic: options.mnemonic,
|
|
406
|
+
log,
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
program
|
|
411
|
+
.command('debug-rollup')
|
|
412
|
+
.description('Debugs the rollup contract.')
|
|
413
|
+
.addOption(l1RpcUrlsOption)
|
|
414
|
+
.addOption(l1ChainIdOption)
|
|
415
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
416
|
+
.action(async options => {
|
|
417
|
+
const { debugRollup } = await import('./update_l1_validators.js');
|
|
418
|
+
await debugRollup({
|
|
419
|
+
rpcUrls: options.l1RpcUrls,
|
|
420
|
+
chainId: options.l1ChainId,
|
|
421
|
+
privateKey: options.privateKey,
|
|
422
|
+
mnemonic: options.mnemonic,
|
|
423
|
+
rollupAddress: options.rollup,
|
|
424
|
+
log,
|
|
425
|
+
debugLogger,
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
program
|
|
430
|
+
.command('prune-rollup')
|
|
431
|
+
.description('Prunes the pending chain on the rollup contract.')
|
|
432
|
+
.addOption(l1RpcUrlsOption)
|
|
433
|
+
.option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
434
|
+
.option(
|
|
435
|
+
'-m, --mnemonic <string>',
|
|
436
|
+
'The mnemonic to use in deployment',
|
|
437
|
+
'test test test test test test test test test test test junk',
|
|
438
|
+
)
|
|
439
|
+
.addOption(l1ChainIdOption)
|
|
440
|
+
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
|
|
441
|
+
.action(async options => {
|
|
442
|
+
const { pruneRollup } = await import('./update_l1_validators.js');
|
|
443
|
+
await pruneRollup({
|
|
444
|
+
rpcUrls: options.rpcUrls,
|
|
445
|
+
chainId: options.l1ChainId,
|
|
446
|
+
privateKey: options.privateKey,
|
|
447
|
+
mnemonic: options.mnemonic,
|
|
448
|
+
rollupAddress: options.rollup,
|
|
449
|
+
log,
|
|
450
|
+
debugLogger,
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
program
|
|
455
|
+
.command('create-l1-account')
|
|
456
|
+
.option('--json', 'Output the account in JSON format')
|
|
457
|
+
.action(async options => {
|
|
458
|
+
const { createL1Account } = await import('./create_l1_account.js');
|
|
459
|
+
createL1Account(options.json, log);
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
program
|
|
463
|
+
.command('get-l1-balance')
|
|
464
|
+
.description('Gets the balance of an ERC token in L1 for the given Ethereum address.')
|
|
465
|
+
.argument('<who>', 'Ethereum address to check.', parseEthereumAddress)
|
|
466
|
+
.addOption(l1RpcUrlsOption)
|
|
467
|
+
.option('-t, --token <string>', 'The address of the token to check the balance of', parseEthereumAddress)
|
|
468
|
+
.addOption(l1ChainIdOption)
|
|
469
|
+
.option('--json', 'Output the balance in JSON format')
|
|
470
|
+
.action(async (who, options) => {
|
|
471
|
+
const { getL1Balance } = await import('./get_l1_balance.js');
|
|
472
|
+
await getL1Balance(who, options.token, options.l1RpcUrls, options.l1ChainId, options.json, log);
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
program
|
|
476
|
+
.command('set-proven-through', { hidden: true })
|
|
477
|
+
.description(
|
|
478
|
+
'Instructs the L1 rollup contract to assume all blocks until the given checkpoint are automatically proven.',
|
|
479
|
+
)
|
|
480
|
+
.argument('[checkpoint]', 'The target checkpoint, defaults to the latest pending checkpoint.', parseBigint)
|
|
481
|
+
.addOption(l1RpcUrlsOption)
|
|
482
|
+
.addOption(nodeOption)
|
|
483
|
+
.action(async (checkpoint, options) => {
|
|
484
|
+
const { assumeProvenThrough } = await import('./assume_proven_through.js');
|
|
485
|
+
await assumeProvenThrough(CheckpointNumber.fromBigInt(checkpoint), options.l1RpcUrls, options.nodeUrl, log);
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
program
|
|
489
|
+
.command('advance-epoch')
|
|
490
|
+
.description('Use L1 cheat codes to warp time until the next epoch.')
|
|
491
|
+
.addOption(l1RpcUrlsOption)
|
|
492
|
+
.addOption(nodeOption)
|
|
493
|
+
.action(async options => {
|
|
494
|
+
const { advanceEpoch } = await import('./advance_epoch.js');
|
|
495
|
+
await advanceEpoch(options.l1RpcUrls, options.nodeUrl, log);
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
return program;
|
|
499
|
+
}
|