@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,181 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
2
|
+
import { Command, Option } from 'commander';
|
|
3
|
+
|
|
4
|
+
import { parseAztecAddress, parseEthereumAddress, parseHex, parseOptionalInteger } from '../../utils/commands.js';
|
|
5
|
+
import { defaultBlsPath } from './utils.js';
|
|
6
|
+
|
|
7
|
+
export function injectCommands(program: Command, log: LogFn) {
|
|
8
|
+
const group = program
|
|
9
|
+
.command('validator-keys')
|
|
10
|
+
.aliases(['valKeys', 'valkeys'])
|
|
11
|
+
.description('Manage validator keystores for node operators');
|
|
12
|
+
|
|
13
|
+
group
|
|
14
|
+
.command('new')
|
|
15
|
+
.summary('Generate a new validator keystore JSON')
|
|
16
|
+
.description('Generates a new validator keystore with ETH secp256k1 accounts and optional BLS accounts')
|
|
17
|
+
.option('--data-dir <path>', 'Directory to store keystore(s). Defaults to ~/.aztec/keystore')
|
|
18
|
+
.option('--file <name>', 'Keystore file name. Defaults to key1.json (or keyN.json if key1.json exists)')
|
|
19
|
+
.option('--count <N>', 'Number of validators to generate', parseOptionalInteger)
|
|
20
|
+
.option('--publisher-count <N>', 'Number of publisher accounts per validator (default 0)', value =>
|
|
21
|
+
parseOptionalInteger(value, 0),
|
|
22
|
+
)
|
|
23
|
+
.option('--publishers <privateKeys>', 'Comma-separated list of publisher private keys for all validators.', value =>
|
|
24
|
+
value.split(',').map((key: string) => key.trim()),
|
|
25
|
+
)
|
|
26
|
+
.option('--mnemonic <mnemonic>', 'Mnemonic for ETH/BLS derivation')
|
|
27
|
+
.option('--passphrase <str>', 'Optional passphrase for mnemonic')
|
|
28
|
+
.option('--account-index <N>', 'Base account index for ETH/BLS derivation', parseOptionalInteger)
|
|
29
|
+
.option('--address-index <N>', 'Base address index for ETH/BLS derivation', parseOptionalInteger)
|
|
30
|
+
.option(
|
|
31
|
+
'--coinbase <address>',
|
|
32
|
+
'Coinbase ETH address to use when proposing. Defaults to attester address.',
|
|
33
|
+
parseEthereumAddress,
|
|
34
|
+
)
|
|
35
|
+
.option(
|
|
36
|
+
'--funding-account <privateKey|address>',
|
|
37
|
+
'ETH funding account used to top up publisher EOAs. Provide a private key, or an address together with --remote-signer.',
|
|
38
|
+
)
|
|
39
|
+
.option('--remote-signer <url>', 'Default remote signer URL for accounts in this file')
|
|
40
|
+
.option('--ikm <hex>', 'Initial keying material for BLS (alternative to mnemonic)', value => parseHex(value, 32))
|
|
41
|
+
.option('--bls-path <path>', `EIP-2334 path (default ${defaultBlsPath})`)
|
|
42
|
+
.addOption(
|
|
43
|
+
new Option('--password <str>', 'Shared password for writing ETH JSON V3 and BLS EIP-2335 keystore files').env(
|
|
44
|
+
'AZTEC_KEYSTORE_PASSWORD',
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
.option('--password-file <path>', 'File containing the shared password for writing keystore files')
|
|
48
|
+
.addOption(
|
|
49
|
+
new Option('--eth-password <str>', 'Password for writing ETH JSON V3 keystore files').env(
|
|
50
|
+
'AZTEC_ETH_KEYSTORE_PASSWORD',
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
.option('--eth-password-file <path>', 'File containing the password for writing ETH JSON V3 keystore files')
|
|
54
|
+
.addOption(
|
|
55
|
+
new Option('--bls-password <str>', 'Password for writing BLS EIP-2335 keystore files').env(
|
|
56
|
+
'AZTEC_BLS_KEYSTORE_PASSWORD',
|
|
57
|
+
),
|
|
58
|
+
)
|
|
59
|
+
.option('--bls-password-file <path>', 'File containing the password for writing BLS EIP-2335 keystore files')
|
|
60
|
+
.option('--encrypted-keystore-dir <dir>', 'Output directory for encrypted keystore file(s)')
|
|
61
|
+
.option('--json', 'Echo resulting JSON to stdout')
|
|
62
|
+
.option('--staker-output', 'Generate a single staker output JSON file with an array of validator entries')
|
|
63
|
+
.option('--gse-address <address>', 'GSE contract address (required with --staker-output)', parseEthereumAddress)
|
|
64
|
+
.option('--l1-rpc-urls <urls>', 'L1 RPC URLs (comma-separated, required with --staker-output)', value =>
|
|
65
|
+
value.split(','),
|
|
66
|
+
)
|
|
67
|
+
.option(
|
|
68
|
+
'-c, --l1-chain-id <number>',
|
|
69
|
+
'L1 chain ID (required with --staker-output)',
|
|
70
|
+
value => parseInt(value),
|
|
71
|
+
31337,
|
|
72
|
+
)
|
|
73
|
+
.requiredOption('--fee-recipient <address>', 'Aztec address that will receive fees', parseAztecAddress)
|
|
74
|
+
.action(async options => {
|
|
75
|
+
const { newValidatorKeystore } = await import('./new.js');
|
|
76
|
+
|
|
77
|
+
await newValidatorKeystore(options, log);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
group
|
|
81
|
+
.command('add')
|
|
82
|
+
.summary('Augment an existing validator keystore JSON')
|
|
83
|
+
.description('Adds attester/publisher/BLS entries to an existing keystore using the same flags as new')
|
|
84
|
+
.argument('<existing>', 'Path to existing keystore JSON')
|
|
85
|
+
.option('--data-dir <path>', 'Directory where keystore(s) live. (default: ~/.aztec/keystore)')
|
|
86
|
+
.option('--file <name>', 'Override output file name. (default: key<N>.json)')
|
|
87
|
+
.option('--count <N>', 'Number of validators to add. (default: 1)', parseOptionalInteger)
|
|
88
|
+
.option('--publisher-count <N>', 'Number of publisher accounts per validator (default 0)', value =>
|
|
89
|
+
parseOptionalInteger(value, 0),
|
|
90
|
+
)
|
|
91
|
+
.option('--publishers <privateKeys>', 'Comma-separated list of publisher private keys for all validators.', value =>
|
|
92
|
+
value.split(',').map((key: string) => key.trim()),
|
|
93
|
+
)
|
|
94
|
+
.option('--mnemonic <mnemonic>', 'Mnemonic for ETH/BLS derivation')
|
|
95
|
+
.option('--passphrase <str>', 'Optional passphrase for mnemonic')
|
|
96
|
+
.option('--account-index <N>', 'Base account index for ETH/BLS derivation', parseOptionalInteger)
|
|
97
|
+
.option('--address-index <N>', 'Base address index for ETH/BLS derivation', parseOptionalInteger)
|
|
98
|
+
.option(
|
|
99
|
+
'--coinbase <address>',
|
|
100
|
+
'Coinbase ETH address to use when proposing. Defaults to attester address.',
|
|
101
|
+
parseEthereumAddress,
|
|
102
|
+
)
|
|
103
|
+
.option('--remote-signer <url>', 'Default remote signer URL for accounts in this file')
|
|
104
|
+
.option('--ikm <hex>', 'Initial keying material for BLS (alternative to mnemonic)', value => parseHex(value, 32))
|
|
105
|
+
.option('--bls-path <path>', `EIP-2334 path (default ${defaultBlsPath})`)
|
|
106
|
+
.option('--empty', 'Generate an empty skeleton without keys')
|
|
107
|
+
.option(
|
|
108
|
+
'--password <str>',
|
|
109
|
+
'Password for writing keystore files (ETH JSON V3 and BLS EIP-2335). Empty string allowed',
|
|
110
|
+
)
|
|
111
|
+
.option('--encrypted-keystore-dir <dir>', 'Output directory for encrypted keystore file(s)')
|
|
112
|
+
.option('--json', 'Echo resulting JSON to stdout')
|
|
113
|
+
.requiredOption('--fee-recipient <address>', 'Aztec address that will receive fees', parseAztecAddress)
|
|
114
|
+
.action(async (existing: string, options) => {
|
|
115
|
+
const { addValidatorKeys } = await import('./add.js');
|
|
116
|
+
await addValidatorKeys(existing, options, log);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
group
|
|
120
|
+
.command('set-funding-account')
|
|
121
|
+
.summary('Set the funding account of an existing keystore')
|
|
122
|
+
.description(
|
|
123
|
+
'Sets the keystore-level ETH funding account used to top up publisher EOAs, replacing any existing one',
|
|
124
|
+
)
|
|
125
|
+
.argument('<existing>', 'Path to existing keystore JSON')
|
|
126
|
+
.argument(
|
|
127
|
+
'<privateKey|address>',
|
|
128
|
+
'Funding account: a private key, or an address (needs --remote-signer unless the keystore already defines one)',
|
|
129
|
+
)
|
|
130
|
+
.option(
|
|
131
|
+
'--remote-signer <url>',
|
|
132
|
+
'Remote signer URL for the funding account (required with an address unless the keystore already defines one)',
|
|
133
|
+
)
|
|
134
|
+
.option(
|
|
135
|
+
'--password <str>',
|
|
136
|
+
'Password for writing the funding key as an encrypted ETH JSON V3 file. Empty string allowed',
|
|
137
|
+
)
|
|
138
|
+
.option('--encrypted-keystore-dir <dir>', 'Output directory for the encrypted funding key file')
|
|
139
|
+
.option('--json', 'Echo resulting JSON to stdout')
|
|
140
|
+
.action(async (existing: string, fundingAccount: string, options) => {
|
|
141
|
+
const { setFundingAccount } = await import('./set_funding_account.js');
|
|
142
|
+
await setFundingAccount(existing, fundingAccount, options, log);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
group
|
|
146
|
+
.command('staker')
|
|
147
|
+
.summary('Generate staking JSON from keystore')
|
|
148
|
+
.description(
|
|
149
|
+
'Reads a validator keystore and outputs staking data with BLS public keys for each attester (skips mnemonics)',
|
|
150
|
+
)
|
|
151
|
+
.requiredOption('--from <keystore>', 'Path to keystore JSON file')
|
|
152
|
+
.option('--password <password>', 'Password for decrypting encrypted keystores (if not specified in keystore file)')
|
|
153
|
+
.requiredOption('--gse-address <address>', 'GSE contract address', parseEthereumAddress)
|
|
154
|
+
.option('--l1-rpc-urls <urls>', 'L1 RPC URLs (comma-separated)', value => value.split(','), [
|
|
155
|
+
'http://localhost:8545',
|
|
156
|
+
])
|
|
157
|
+
.option('-c, --l1-chain-id <number>', 'L1 chain ID', value => parseInt(value), 31337)
|
|
158
|
+
.option('--output <file>', 'Output file path (if not specified, JSON is written to stdout)')
|
|
159
|
+
.action(async options => {
|
|
160
|
+
const { generateStakerJson } = await import('./staker.js');
|
|
161
|
+
await generateStakerJson(options, log);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// top-level convenience: aztec generate-bls-keypair
|
|
165
|
+
program
|
|
166
|
+
.command('generate-bls-keypair')
|
|
167
|
+
.description('Generate a BLS keypair with convenience flags')
|
|
168
|
+
.option('--mnemonic <mnemonic>', 'Mnemonic for BLS derivation')
|
|
169
|
+
.option('--ikm <hex>', 'Initial keying material for BLS (alternative to mnemonic)', value => parseHex(value, 32))
|
|
170
|
+
.option('--bls-path <path>', `EIP-2334 path (default ${defaultBlsPath})`)
|
|
171
|
+
.option('--g2', 'Derive on G2 subgroup')
|
|
172
|
+
.option('--compressed', 'Output compressed public key')
|
|
173
|
+
.option('--json', 'Print JSON output to stdout')
|
|
174
|
+
.option('--out <file>', 'Write output to file')
|
|
175
|
+
.action(async options => {
|
|
176
|
+
const { generateBlsKeypair } = await import('./generate_bls_keypair.js');
|
|
177
|
+
await generateBlsKeypair(options, log);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
return program;
|
|
181
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { prettyPrintJSON } from '@aztec-labs/cli/utils';
|
|
2
|
+
import { createEthereumChain } from '@aztec-labs/ethereum/chain';
|
|
3
|
+
import { GSEContract } from '@aztec-labs/ethereum/contracts';
|
|
4
|
+
import type { EthAddress } from '@aztec-labs/foundation/eth-address';
|
|
5
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
6
|
+
import type { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
7
|
+
import { wordlist } from '@scure/bip39/wordlists/english.js';
|
|
8
|
+
import { readFile, writeFile } from 'fs/promises';
|
|
9
|
+
import { basename, dirname, join } from 'path';
|
|
10
|
+
import { createPublicClient, fallback, http } from 'viem';
|
|
11
|
+
import { generateMnemonic, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
buildValidatorEntries,
|
|
15
|
+
encryptFundingAccountToFile,
|
|
16
|
+
logValidatorSummaries,
|
|
17
|
+
maybePrintJson,
|
|
18
|
+
resolveFundingAccount,
|
|
19
|
+
resolveKeystoreOutputPath,
|
|
20
|
+
writeBlsBn254ToFile,
|
|
21
|
+
writeEthJsonV3ToFile,
|
|
22
|
+
writeKeystoreFile,
|
|
23
|
+
} from './shared.js';
|
|
24
|
+
import { processAttesterAccounts } from './staker.js';
|
|
25
|
+
import {
|
|
26
|
+
validateBlsPathOptions,
|
|
27
|
+
validateFundingAccountOptions,
|
|
28
|
+
validatePublisherOptions,
|
|
29
|
+
validateRemoteSignerOptions,
|
|
30
|
+
validateStakerOutputOptions,
|
|
31
|
+
} from './utils.js';
|
|
32
|
+
|
|
33
|
+
export type NewValidatorKeystoreOptions = {
|
|
34
|
+
dataDir?: string;
|
|
35
|
+
file?: string;
|
|
36
|
+
count?: number;
|
|
37
|
+
publisherCount?: number;
|
|
38
|
+
publishers?: string[];
|
|
39
|
+
mnemonic?: string;
|
|
40
|
+
passphrase?: string;
|
|
41
|
+
accountIndex?: number;
|
|
42
|
+
addressIndex?: number;
|
|
43
|
+
separatePublisher?: boolean;
|
|
44
|
+
ikm?: string;
|
|
45
|
+
blsPath?: string;
|
|
46
|
+
password?: string;
|
|
47
|
+
passwordFile?: string;
|
|
48
|
+
ethPassword?: string;
|
|
49
|
+
ethPasswordFile?: string;
|
|
50
|
+
blsPassword?: string;
|
|
51
|
+
blsPasswordFile?: string;
|
|
52
|
+
encryptedKeystoreDir?: string;
|
|
53
|
+
json?: boolean;
|
|
54
|
+
feeRecipient: AztecAddress;
|
|
55
|
+
coinbase?: EthAddress;
|
|
56
|
+
fundingAccount?: string;
|
|
57
|
+
remoteSigner?: string;
|
|
58
|
+
stakerOutput?: boolean;
|
|
59
|
+
gseAddress?: EthAddress;
|
|
60
|
+
l1RpcUrls?: string[];
|
|
61
|
+
l1ChainId?: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type PasswordSourceOptions = Pick<
|
|
65
|
+
NewValidatorKeystoreOptions,
|
|
66
|
+
'password' | 'passwordFile' | 'ethPassword' | 'ethPasswordFile' | 'blsPassword' | 'blsPasswordFile'
|
|
67
|
+
>;
|
|
68
|
+
|
|
69
|
+
type PasswordSource = {
|
|
70
|
+
password?: string;
|
|
71
|
+
passwordFile?: string;
|
|
72
|
+
passwordOption: string;
|
|
73
|
+
passwordFileOption: string;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
function validatePassword(password: string, source: string): string {
|
|
77
|
+
if (password.length === 0) {
|
|
78
|
+
throw new Error(`${source} cannot be empty`);
|
|
79
|
+
}
|
|
80
|
+
return password;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function stripOneTrailingNewline(password: string): string {
|
|
84
|
+
if (password.endsWith('\n')) {
|
|
85
|
+
password = password.slice(0, -1);
|
|
86
|
+
}
|
|
87
|
+
if (password.endsWith('\r')) {
|
|
88
|
+
password = password.slice(0, -1);
|
|
89
|
+
}
|
|
90
|
+
return password;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function resolvePasswordSource(source: PasswordSource): Promise<string | undefined> {
|
|
94
|
+
if (source.password !== undefined && source.passwordFile !== undefined) {
|
|
95
|
+
throw new Error(`${source.passwordOption} and ${source.passwordFileOption} cannot be used together`);
|
|
96
|
+
}
|
|
97
|
+
if (source.password !== undefined) {
|
|
98
|
+
return validatePassword(source.password, source.passwordOption);
|
|
99
|
+
}
|
|
100
|
+
if (source.passwordFile !== undefined) {
|
|
101
|
+
if (source.passwordFile.length === 0) {
|
|
102
|
+
throw new Error(`${source.passwordFileOption} cannot be empty`);
|
|
103
|
+
}
|
|
104
|
+
const password = stripOneTrailingNewline(await readFile(source.passwordFile, 'utf-8'));
|
|
105
|
+
return validatePassword(password, source.passwordFileOption);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function resolvePasswords(options: PasswordSourceOptions) {
|
|
112
|
+
const sharedPassword = await resolvePasswordSource({
|
|
113
|
+
password: options.password,
|
|
114
|
+
passwordFile: options.passwordFile,
|
|
115
|
+
passwordOption: '--password',
|
|
116
|
+
passwordFileOption: '--password-file',
|
|
117
|
+
});
|
|
118
|
+
const ethPassword =
|
|
119
|
+
(await resolvePasswordSource({
|
|
120
|
+
password: options.ethPassword,
|
|
121
|
+
passwordFile: options.ethPasswordFile,
|
|
122
|
+
passwordOption: '--eth-password',
|
|
123
|
+
passwordFileOption: '--eth-password-file',
|
|
124
|
+
})) ?? sharedPassword;
|
|
125
|
+
const blsPassword =
|
|
126
|
+
(await resolvePasswordSource({
|
|
127
|
+
password: options.blsPassword,
|
|
128
|
+
passwordFile: options.blsPasswordFile,
|
|
129
|
+
passwordOption: '--bls-password',
|
|
130
|
+
passwordFileOption: '--bls-password-file',
|
|
131
|
+
})) ?? sharedPassword;
|
|
132
|
+
|
|
133
|
+
if (ethPassword === undefined && blsPassword === undefined) {
|
|
134
|
+
return {};
|
|
135
|
+
}
|
|
136
|
+
if (ethPassword === undefined || blsPassword === undefined) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
'Both ETH and BLS passwords are required when writing encrypted keystores. Provide --password to use one password for both, or provide both --eth-password and --bls-password.',
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return { ethPassword, blsPassword };
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export async function newValidatorKeystore(options: NewValidatorKeystoreOptions, log: LogFn) {
|
|
145
|
+
// validate bls-path inputs before proceeding with key generation
|
|
146
|
+
validateBlsPathOptions(options);
|
|
147
|
+
// validate staker output options before proceeding with key generation
|
|
148
|
+
validateStakerOutputOptions(options);
|
|
149
|
+
// validate publisher options
|
|
150
|
+
validatePublisherOptions(options);
|
|
151
|
+
// validate remote signer options
|
|
152
|
+
validateRemoteSignerOptions(options);
|
|
153
|
+
// validate funding account option
|
|
154
|
+
validateFundingAccountOptions(options);
|
|
155
|
+
|
|
156
|
+
const {
|
|
157
|
+
dataDir,
|
|
158
|
+
file,
|
|
159
|
+
count,
|
|
160
|
+
publisherCount = 0,
|
|
161
|
+
publishers,
|
|
162
|
+
json,
|
|
163
|
+
coinbase,
|
|
164
|
+
fundingAccount,
|
|
165
|
+
accountIndex = 0,
|
|
166
|
+
addressIndex = 0,
|
|
167
|
+
feeRecipient,
|
|
168
|
+
remoteSigner,
|
|
169
|
+
blsPath,
|
|
170
|
+
ikm,
|
|
171
|
+
mnemonic: _mnemonic,
|
|
172
|
+
password: passwordOption,
|
|
173
|
+
passwordFile,
|
|
174
|
+
ethPassword: ethPasswordOption,
|
|
175
|
+
ethPasswordFile,
|
|
176
|
+
blsPassword: blsPasswordOption,
|
|
177
|
+
blsPasswordFile,
|
|
178
|
+
encryptedKeystoreDir,
|
|
179
|
+
stakerOutput,
|
|
180
|
+
gseAddress,
|
|
181
|
+
l1RpcUrls,
|
|
182
|
+
l1ChainId,
|
|
183
|
+
} = options;
|
|
184
|
+
|
|
185
|
+
const { ethPassword, blsPassword } = await resolvePasswords({
|
|
186
|
+
password: passwordOption,
|
|
187
|
+
passwordFile,
|
|
188
|
+
ethPassword: ethPasswordOption,
|
|
189
|
+
ethPasswordFile,
|
|
190
|
+
blsPassword: blsPasswordOption,
|
|
191
|
+
blsPasswordFile,
|
|
192
|
+
});
|
|
193
|
+
const shouldEncryptKeystores = ethPassword !== undefined && blsPassword !== undefined;
|
|
194
|
+
const mnemonic = _mnemonic ?? generateMnemonic(wordlist);
|
|
195
|
+
|
|
196
|
+
if (!_mnemonic && !json && !shouldEncryptKeystores) {
|
|
197
|
+
log('No mnemonic provided, generating new one...');
|
|
198
|
+
log(`Using new mnemonic:`);
|
|
199
|
+
log('');
|
|
200
|
+
log(mnemonic);
|
|
201
|
+
log('');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const validatorCount = typeof count === 'number' && Number.isFinite(count) && count > 0 ? Math.floor(count) : 1;
|
|
205
|
+
const { outputPath } = await resolveKeystoreOutputPath(dataDir, file);
|
|
206
|
+
const keystoreOutDir = dirname(outputPath);
|
|
207
|
+
|
|
208
|
+
const { validators, summaries } = await buildValidatorEntries({
|
|
209
|
+
validatorCount,
|
|
210
|
+
publisherCount,
|
|
211
|
+
publishers,
|
|
212
|
+
accountIndex,
|
|
213
|
+
baseAddressIndex: addressIndex,
|
|
214
|
+
mnemonic,
|
|
215
|
+
ikm,
|
|
216
|
+
blsPath,
|
|
217
|
+
feeRecipient,
|
|
218
|
+
coinbase,
|
|
219
|
+
remoteSigner,
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
let resolvedFundingAccount = fundingAccount ? resolveFundingAccount(fundingAccount, remoteSigner) : undefined;
|
|
223
|
+
|
|
224
|
+
// If password provided, write ETH JSON V3 and BLS BN254 keystores and replace plaintext
|
|
225
|
+
if (shouldEncryptKeystores) {
|
|
226
|
+
const encryptedKeystoreOutDir =
|
|
227
|
+
encryptedKeystoreDir && encryptedKeystoreDir.length > 0 ? encryptedKeystoreDir : keystoreOutDir;
|
|
228
|
+
await writeEthJsonV3ToFile(validators, { outDir: encryptedKeystoreOutDir, password: ethPassword });
|
|
229
|
+
await writeBlsBn254ToFile(validators, { outDir: encryptedKeystoreOutDir, password: blsPassword });
|
|
230
|
+
if (resolvedFundingAccount) {
|
|
231
|
+
resolvedFundingAccount = await encryptFundingAccountToFile(resolvedFundingAccount, {
|
|
232
|
+
outDir: encryptedKeystoreOutDir,
|
|
233
|
+
password: ethPassword,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const keystore = {
|
|
239
|
+
schemaVersion: 1,
|
|
240
|
+
validators,
|
|
241
|
+
...(resolvedFundingAccount ? { fundingAccount: resolvedFundingAccount } : {}),
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
await writeKeystoreFile(outputPath, keystore);
|
|
245
|
+
|
|
246
|
+
// Generate staker outputs if requested
|
|
247
|
+
const allStakerOutputs: any[] = [];
|
|
248
|
+
if (stakerOutput && gseAddress && l1RpcUrls && l1ChainId !== undefined) {
|
|
249
|
+
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
250
|
+
const publicClient = createPublicClient({
|
|
251
|
+
chain: chain.chainInfo,
|
|
252
|
+
transport: fallback(l1RpcUrls.map(url => http(url, { batch: false }))),
|
|
253
|
+
});
|
|
254
|
+
const gse = new GSEContract(publicClient, gseAddress);
|
|
255
|
+
|
|
256
|
+
// Extract keystore base name without extension for unique staker output filenames
|
|
257
|
+
const keystoreBaseName = basename(outputPath, '.json');
|
|
258
|
+
|
|
259
|
+
// Process each validator
|
|
260
|
+
for (let i = 0; i < validators.length; i++) {
|
|
261
|
+
const validator = validators[i];
|
|
262
|
+
const outputs = await processAttesterAccounts(validator.attester, gse);
|
|
263
|
+
|
|
264
|
+
// Collect all staker outputs
|
|
265
|
+
for (let j = 0; j < outputs.length; j++) {
|
|
266
|
+
allStakerOutputs.push(outputs[j]);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Write a single JSON file with all staker outputs
|
|
271
|
+
if (allStakerOutputs.length > 0) {
|
|
272
|
+
const stakerOutputPath = join(keystoreOutDir, `${keystoreBaseName}_staker_output.json`);
|
|
273
|
+
await writeFile(stakerOutputPath, prettyPrintJSON(allStakerOutputs), 'utf-8');
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const outputData = !_mnemonic && !shouldEncryptKeystores ? { ...keystore, generatedMnemonic: mnemonic } : keystore;
|
|
278
|
+
|
|
279
|
+
// Handle JSON output
|
|
280
|
+
if (json) {
|
|
281
|
+
if (stakerOutput && allStakerOutputs.length > 0) {
|
|
282
|
+
const combinedOutput = {
|
|
283
|
+
keystore: outputData,
|
|
284
|
+
staker: allStakerOutputs,
|
|
285
|
+
};
|
|
286
|
+
maybePrintJson(log, json, combinedOutput as unknown as Record<string, any>);
|
|
287
|
+
} else {
|
|
288
|
+
maybePrintJson(log, json, outputData as unknown as Record<string, any>);
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
log(`Wrote validator keystore to ${outputPath}`);
|
|
292
|
+
if (stakerOutput && allStakerOutputs.length > 0) {
|
|
293
|
+
const keystoreBaseName = basename(outputPath, '.json');
|
|
294
|
+
const stakerOutputPath = join(keystoreOutDir, `${keystoreBaseName}_staker_output.json`);
|
|
295
|
+
log(`Wrote staker output for ${allStakerOutputs.length} validator(s) to ${stakerOutputPath}`);
|
|
296
|
+
log('');
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// print a concise summary of public keys (addresses and BLS pubkeys) if no --json options was selected
|
|
301
|
+
if (!json) {
|
|
302
|
+
logValidatorSummaries(log, summaries);
|
|
303
|
+
if (fundingAccount) {
|
|
304
|
+
const funderAddress =
|
|
305
|
+
fundingAccount.length === 66 ? privateKeyToAccount(fundingAccount as `0x${string}`).address : fundingAccount;
|
|
306
|
+
log(`funding account: ${funderAddress}`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (mnemonic && remoteSigner && !json) {
|
|
311
|
+
for (let i = 0; i < validatorCount; i++) {
|
|
312
|
+
const addrIdx = addressIndex + i;
|
|
313
|
+
const acct = mnemonicToAccount(mnemonic, {
|
|
314
|
+
accountIndex,
|
|
315
|
+
addressIndex: addrIdx,
|
|
316
|
+
});
|
|
317
|
+
log(`attester address: ${acct.address} remoteSignerUrl: ${remoteSigner}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Log staker outputs if not in JSON mode
|
|
322
|
+
if (!json && stakerOutput && allStakerOutputs.length > 0) {
|
|
323
|
+
log('\nStaker outputs:');
|
|
324
|
+
log(prettyPrintJSON(allStakerOutputs));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec-labs/foundation/log';
|
|
2
|
+
import { loadKeystoreFile } from '@aztec-labs/node-keystore/loader';
|
|
3
|
+
import type { KeyStore } from '@aztec-labs/node-keystore/types';
|
|
4
|
+
import { dirname } from 'path';
|
|
5
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
6
|
+
|
|
7
|
+
import { encryptFundingAccountToFile, maybePrintJson, resolveFundingAccount, writeKeystoreFile } from './shared.js';
|
|
8
|
+
import { validateFundingAccountOptions } from './utils.js';
|
|
9
|
+
|
|
10
|
+
export type SetFundingAccountOptions = {
|
|
11
|
+
remoteSigner?: string;
|
|
12
|
+
password?: string;
|
|
13
|
+
encryptedKeystoreDir?: string;
|
|
14
|
+
json?: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Sets the top-level funding account of an existing keystore, replacing any previous one. The
|
|
19
|
+
* account may be a private key, or an address paired with a remote signer URL. With a password,
|
|
20
|
+
* a plaintext key is encrypted to an ETH JSON V3 file and stored as a { path, password } reference.
|
|
21
|
+
*/
|
|
22
|
+
export async function setFundingAccount(
|
|
23
|
+
existing: string,
|
|
24
|
+
fundingAccount: string,
|
|
25
|
+
options: SetFundingAccountOptions,
|
|
26
|
+
log: LogFn,
|
|
27
|
+
) {
|
|
28
|
+
const { remoteSigner, password, encryptedKeystoreDir, json } = options;
|
|
29
|
+
|
|
30
|
+
const keystore: KeyStore = loadKeystoreFile(existing);
|
|
31
|
+
|
|
32
|
+
const validated = { fundingAccount, remoteSigner };
|
|
33
|
+
validateFundingAccountOptions(validated, !!keystore.remoteSigner);
|
|
34
|
+
|
|
35
|
+
let resolved = resolveFundingAccount(validated.fundingAccount!, remoteSigner);
|
|
36
|
+
if (password !== undefined) {
|
|
37
|
+
const outDir = encryptedKeystoreDir && encryptedKeystoreDir.length > 0 ? encryptedKeystoreDir : dirname(existing);
|
|
38
|
+
resolved = await encryptFundingAccountToFile(resolved, { outDir, password });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (keystore.fundingAccount) {
|
|
42
|
+
log('Replacing existing funding account in keystore');
|
|
43
|
+
}
|
|
44
|
+
keystore.fundingAccount = resolved;
|
|
45
|
+
|
|
46
|
+
await writeKeystoreFile(existing, keystore);
|
|
47
|
+
|
|
48
|
+
if (!json) {
|
|
49
|
+
const value = validated.fundingAccount!;
|
|
50
|
+
const funderAddress = value.length === 66 ? privateKeyToAccount(value as `0x${string}`).address : value;
|
|
51
|
+
log(`Set funding account ${funderAddress} in ${existing}`);
|
|
52
|
+
}
|
|
53
|
+
maybePrintJson(log, !!json, keystore as unknown as Record<string, any>);
|
|
54
|
+
}
|