@aztec/cli 3.0.0-nightly.20250919 → 3.0.0-nightly.20250920
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/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -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/{pxe → aztec_node}/get_node_info.js +3 -8
- package/dest/cmds/aztec_node/index.d.ts.map +1 -1
- package/dest/cmds/aztec_node/index.js +9 -1
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -1
- package/dest/cmds/devnet/bootstrap_network.js +8 -8
- package/dest/cmds/infrastructure/index.d.ts +2 -2
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -8
- package/dest/cmds/infrastructure/sequencers.d.ts +2 -3
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +3 -3
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +5 -4
- package/dest/cmds/l1/advance_epoch.d.ts +1 -1
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +4 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_l1_contracts.js +2 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +2 -2
- package/dest/cmds/pxe/index.d.ts.map +1 -1
- package/dest/cmds/pxe/index.js +1 -15
- package/dest/utils/aztec.d.ts +2 -8
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +2 -27
- package/package.json +24 -24
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +20 -0
- package/src/cmds/devnet/bootstrap_network.ts +7 -9
- package/src/cmds/infrastructure/index.ts +14 -7
- package/src/cmds/infrastructure/sequencers.ts +5 -6
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -4
- package/src/cmds/l1/advance_epoch.ts +4 -4
- package/src/cmds/l1/deploy_l1_contracts.ts +0 -2
- package/src/cmds/l1/index.ts +0 -2
- package/src/cmds/pxe/index.ts +0 -27
- package/src/utils/aztec.ts +1 -39
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_current_base_fee.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_current_base_fee.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAIvF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
+
export async function getCurrentBaseFee(nodeUrl, debugLogger, log) {
|
|
4
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
5
|
+
const fees = await node.getCurrentBaseFees();
|
|
6
|
+
log(`Current fees: ${jsonStringify(fees)}`);
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBA2D3G"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { createAztecNodeClient
|
|
2
|
-
export async function getNodeInfo(
|
|
3
|
-
|
|
4
|
-
if (pxeRequest) {
|
|
5
|
-
client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
6
|
-
} else {
|
|
7
|
-
client = createAztecNodeClient(rpcUrl);
|
|
8
|
-
}
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
export async function getNodeInfo(nodeUrl, json, log, logJson) {
|
|
3
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
9
4
|
const info = await client.getNodeInfo();
|
|
10
5
|
if (json) {
|
|
11
6
|
logJson({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAwE/E"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { nodeOption, parseAztecAddress, parseField, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash, pxeOption } from '../../utils/commands.js';
|
|
1
|
+
import { logJson, nodeOption, parseAztecAddress, parseField, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash, pxeOption } from '../../utils/commands.js';
|
|
2
2
|
export function injectCommands(program, log, debugLogger) {
|
|
3
3
|
program.command('get-block').description('Gets info for a given block or latest.').argument('[blockNumber]', 'Block height', parseOptionalInteger).addOption(pxeOption).addOption(nodeOption).action(async (blockNumber, options)=>{
|
|
4
4
|
const { getBlock } = await import('./get_block.js');
|
|
5
5
|
await getBlock(options.rpcUrl, options.nodeUrl, blockNumber, debugLogger, log);
|
|
6
6
|
});
|
|
7
|
+
program.command('get-current-base-fee').description('Gets the current base fee.').addOption(nodeOption).action(async (options)=>{
|
|
8
|
+
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
9
|
+
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
10
|
+
});
|
|
7
11
|
program.command('get-l1-to-l2-message-witness').description('Gets a L1 to L2 message witness.').requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress).requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField).requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField).addOption(nodeOption).action(async ({ contractAddress, messageHash, secret, nodeUrl })=>{
|
|
8
12
|
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
9
13
|
await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
|
|
@@ -16,5 +20,9 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
16
20
|
const { blockNumber } = await import('./block_number.js');
|
|
17
21
|
await blockNumber(options.nodeUrl, log);
|
|
18
22
|
});
|
|
23
|
+
program.command('get-node-info').description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.').option('--json', 'Emit output as json').addOption(nodeOption).action(async (options)=>{
|
|
24
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
25
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
26
|
+
});
|
|
19
27
|
return program;
|
|
20
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap_network.d.ts","sourceRoot":"","sources":["../../../src/cmds/devnet/bootstrap_network.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAsB3D,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,EACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,MAAM,iBAuFjB"}
|
|
@@ -15,7 +15,7 @@ const provenWaitOpts = {
|
|
|
15
15
|
export async function bootstrapNetwork(pxeUrl, nodeUrl, l1Urls, l1ChainId, l1PrivateKey, l1Mnemonic, addressIndex, json, log, debugLog) {
|
|
16
16
|
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
17
17
|
const node = createAztecNodeClient(nodeUrl);
|
|
18
|
-
const wallet = new TestWallet(pxe);
|
|
18
|
+
const wallet = new TestWallet(pxe, node);
|
|
19
19
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
20
20
|
// so all we need to do is register them to our pxe.
|
|
21
21
|
const [accountData] = await getInitialTestAccountsData();
|
|
@@ -27,11 +27,11 @@ export async function bootstrapNetwork(pxeUrl, nodeUrl, l1Urls, l1ChainId, l1Pri
|
|
|
27
27
|
}), createEthereumChain(l1Urls, +l1ChainId).chainInfo);
|
|
28
28
|
const { erc20Address, portalAddress } = await deployERC20(l1Client);
|
|
29
29
|
const { token, bridge } = await deployToken(wallet, defaultAccountAddress, portalAddress);
|
|
30
|
-
await initPortal(
|
|
30
|
+
await initPortal(node, l1Client, erc20Address, portalAddress, bridge.address);
|
|
31
31
|
const fpcAdmin = defaultAccountAddress;
|
|
32
32
|
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
33
33
|
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
34
|
-
await fundFPC(
|
|
34
|
+
await fundFPC(node, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
|
|
35
35
|
if (json) {
|
|
36
36
|
log(JSON.stringify({
|
|
37
37
|
devCoinL1: erc20Address.toString(),
|
|
@@ -137,9 +137,9 @@ export async function bootstrapNetwork(pxeUrl, nodeUrl, l1Urls, l1ChainId, l1Pri
|
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Step 3. Initialize DevCoin's L1 portal
|
|
140
|
-
*/ async function initPortal(
|
|
140
|
+
*/ async function initPortal(aztecNode, l1Client, erc20, portal, bridge) {
|
|
141
141
|
const { TokenPortalAbi } = await import('@aztec/l1-artifacts');
|
|
142
|
-
const { l1ContractAddresses: { registryAddress } } = await
|
|
142
|
+
const { l1ContractAddresses: { registryAddress } } = await aztecNode.getNodeInfo();
|
|
143
143
|
const contract = getContract({
|
|
144
144
|
abi: TokenPortalAbi,
|
|
145
145
|
address: portal.toString(),
|
|
@@ -185,16 +185,16 @@ async function deployCounter(wallet, defaultAccountAddress) {
|
|
|
185
185
|
return info;
|
|
186
186
|
}
|
|
187
187
|
// NOTE: Disabling for now in order to get devnet running
|
|
188
|
-
async function fundFPC(
|
|
188
|
+
async function fundFPC(node, counterAddress, wallet, defaultAccountAddress, l1Client, fpcAddress, debugLog) {
|
|
189
189
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
190
190
|
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
191
191
|
const { FeeJuiceContract } = await import('@aztec/noir-contracts.js/FeeJuice');
|
|
192
192
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
193
193
|
// @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
|
|
194
194
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
195
|
-
const { protocolContractAddresses: { feeJuice } } = await
|
|
195
|
+
const { protocolContractAddresses: { feeJuice } } = await node.getNodeInfo();
|
|
196
196
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
197
|
-
const feeJuicePortal = await L1FeeJuicePortalManager.new(
|
|
197
|
+
const feeJuicePortal = await L1FeeJuicePortalManager.new(node, l1Client, debugLog);
|
|
198
198
|
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(fpcAddress, undefined, true);
|
|
199
199
|
await retryUntil(async ()=>await node.getL1ToL2MessageBlock(Fr.fromHexString(messageHash)) !== undefined, 'message sync', 600, 1);
|
|
200
200
|
const counter = await CounterContract.at(counterAddress, wallet);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LogFn
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
|
-
export declare function injectCommands(program: Command, log: LogFn
|
|
3
|
+
export declare function injectCommands(program: Command, log: LogFn): Command;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,WAuD1D"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
2
|
-
export function injectCommands(program, log
|
|
3
|
-
program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(pxeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--sponsoredFPC', 'Deploy a sponsored FPC.').option('--json', 'Output the contract addresses in JSON format').action(async (options)=>{
|
|
1
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
2
|
+
export function injectCommands(program, log) {
|
|
3
|
+
program.command('setup-protocol-contracts').description('Bootstrap the blockchain by initializing all the protocol contracts').addOption(pxeOption).addOption(nodeOption).option('--testAccounts', 'Deploy funded test accounts.').option('--sponsoredFPC', 'Deploy a sponsored FPC.').option('--json', 'Output the contract addresses in JSON format').action(async (options)=>{
|
|
4
4
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
5
|
-
await setupL2Contracts(options.rpcUrl, options.testAccounts, options.sponsoredFPC, options.json, log);
|
|
5
|
+
await setupL2Contracts(options.rpcUrl, options.nodeUrl, options.testAccounts, options.sponsoredFPC, options.json, log);
|
|
6
6
|
});
|
|
7
7
|
program.command('sequencers').argument('<command>', 'Command to run: list, add, remove, who-next').argument('[who]', 'Who to add/remove').description('Manages or queries registered sequencers on the L1 rollup contract.').requiredOption('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)', (arg)=>arg.split(','), [
|
|
8
8
|
ETHEREUM_HOSTS
|
|
9
|
-
]).option('-m, --mnemonic <string>', 'The mnemonic for the sender of the tx', 'test test test test test test test test test test test junk').option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger).addOption(
|
|
9
|
+
]).option('-m, --mnemonic <string>', 'The mnemonic for the sender of the tx', 'test test test test test test test test test test test junk').option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger).addOption(nodeOption).addOption(l1ChainIdOption).action(async (command, who, options)=>{
|
|
10
10
|
const { sequencers } = await import('./sequencers.js');
|
|
11
11
|
await sequencers({
|
|
12
12
|
command: command,
|
|
13
13
|
who,
|
|
14
14
|
mnemonic: options.mnemonic,
|
|
15
|
-
|
|
15
|
+
nodeUrl: options.nodeUrl,
|
|
16
16
|
l1RpcUrls: options.l1RpcUrls,
|
|
17
17
|
chainId: options.l1ChainId,
|
|
18
18
|
blockNumber: options.blockNumber,
|
|
19
|
-
log
|
|
20
|
-
debugLogger
|
|
19
|
+
log
|
|
21
20
|
});
|
|
22
21
|
});
|
|
23
22
|
return program;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type { LogFn
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
export declare function sequencers(opts: {
|
|
3
3
|
command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
|
|
4
4
|
who?: string;
|
|
5
5
|
mnemonic?: string;
|
|
6
6
|
bn254SecretKey?: bigint;
|
|
7
|
-
|
|
7
|
+
nodeUrl: string;
|
|
8
8
|
l1RpcUrls: string[];
|
|
9
9
|
chainId: number;
|
|
10
10
|
blockNumber?: number;
|
|
11
11
|
log: LogFn;
|
|
12
|
-
debugLogger: Logger;
|
|
13
12
|
}): Promise<void>;
|
|
14
13
|
//# sourceMappingURL=sequencers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;CACZ,iBAoGA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Fr,
|
|
1
|
+
import { Fr, createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
3
|
import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
4
4
|
import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
|
|
5
5
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
6
6
|
export async function sequencers(opts) {
|
|
7
|
-
const { command, who: maybeWho, mnemonic, bn254SecretKey,
|
|
8
|
-
const client =
|
|
7
|
+
const { command, who: maybeWho, mnemonic, bn254SecretKey, nodeUrl, l1RpcUrls, chainId, log } = opts;
|
|
8
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
9
9
|
const { l1ContractAddresses } = await client.getNodeInfo();
|
|
10
10
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
11
11
|
const publicClient = createPublicClient({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function setupL2Contracts(
|
|
2
|
+
export declare function setupL2Contracts(pxeUrl: string, nodeUrl: string, testAccounts: boolean, sponsoredFPC: boolean, json: boolean, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=setup_l2_contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup_l2_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/setup_l2_contract.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,iBA+BX"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import { createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
2
|
+
import { createAztecNodeClient, createPXEClient, makeFetch } from '@aztec/aztec.js';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
5
|
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
6
6
|
import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
|
|
7
|
-
export async function setupL2Contracts(
|
|
7
|
+
export async function setupL2Contracts(pxeUrl, nodeUrl, testAccounts, sponsoredFPC, json, log) {
|
|
8
8
|
const waitOpts = {
|
|
9
9
|
timeout: 180,
|
|
10
10
|
interval: 1
|
|
11
11
|
};
|
|
12
12
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
13
13
|
log('setupL2Contracts: Creating PXE client...');
|
|
14
|
-
const pxe = createPXEClient(
|
|
14
|
+
const pxe = createPXEClient(pxeUrl, {}, makeFetch([
|
|
15
15
|
1,
|
|
16
16
|
1,
|
|
17
17
|
1,
|
|
18
18
|
1,
|
|
19
19
|
1
|
|
20
20
|
], false));
|
|
21
|
-
const
|
|
21
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
22
|
+
const wallet = new TestWallet(pxe, node);
|
|
22
23
|
let deployedAccountManagers = [];
|
|
23
24
|
if (testAccounts) {
|
|
24
25
|
log('setupL2Contracts: Deploying test accounts...');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function advanceEpoch(l1RpcUrls: string[],
|
|
2
|
+
export declare function advanceEpoch(l1RpcUrls: string[], nodeUrl: string, log: LogFn): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=advance_epoch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advance_epoch.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/advance_epoch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"advance_epoch.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/advance_epoch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAQlF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
|
-
export async function advanceEpoch(l1RpcUrls,
|
|
4
|
-
const
|
|
5
|
-
const rollupAddress = await
|
|
3
|
+
export async function advanceEpoch(l1RpcUrls, nodeUrl, log) {
|
|
4
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
5
|
+
const rollupAddress = await aztecNode.getNodeInfo().then((i)=>i.l1ContractAddresses.rollupAddress);
|
|
6
6
|
const cheat = RollupCheatCodes.create(l1RpcUrls, {
|
|
7
7
|
rollupAddress
|
|
8
8
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function deployL1Contracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, sponsoredFPC: boolean, acceleratedTestDeployments: boolean, json: boolean, createVerificationJson: string | false, initialValidators: EthAddress[], realVerifier: boolean,
|
|
3
|
+
export declare function deployL1Contracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, testAccounts: boolean, sponsoredFPC: boolean, acceleratedTestDeployments: boolean, json: boolean, createVerificationJson: string | false, initialValidators: EthAddress[], realVerifier: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=deploy_l1_contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAM,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,iBAAiB,EAAE,UAAU,EAAE,EAC/B,YAAY,EAAE,OAAO,EACrB,
|
|
1
|
+
{"version":3,"file":"deploy_l1_contracts.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/deploy_l1_contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAM,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,0BAA0B,EAAE,OAAO,EACnC,IAAI,EAAE,OAAO,EACb,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,iBAAiB,EAAE,UAAU,EAAE,EAC/B,YAAY,EAAE,OAAO,EACrB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBA6DpB"}
|
|
@@ -5,7 +5,7 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
5
5
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
6
6
|
import { deployAztecContracts } from '../../utils/aztec.js';
|
|
7
7
|
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
8
|
-
export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, acceleratedTestDeployments, json, createVerificationJson, initialValidators, realVerifier,
|
|
8
|
+
export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, testAccounts, sponsoredFPC, acceleratedTestDeployments, json, createVerificationJson, initialValidators, realVerifier, log, debugLogger) {
|
|
9
9
|
const config = getL1ContractsConfigEnvVars();
|
|
10
10
|
const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
|
|
11
11
|
const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
|
|
@@ -16,7 +16,7 @@ export async function deployL1Contracts(rpcUrls, chainId, privateKey, mnemonic,
|
|
|
16
16
|
withdrawer: a,
|
|
17
17
|
bn254SecretKey: new SecretValue(Fr.random().toBigInt())
|
|
18
18
|
}));
|
|
19
|
-
const { l1ContractAddresses } = await deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidatorOperators, genesisArchiveRoot, fundingNeeded, acceleratedTestDeployments, config, realVerifier, createVerificationJson,
|
|
19
|
+
const { l1ContractAddresses } = await deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidatorOperators, genesisArchiveRoot, fundingNeeded, acceleratedTestDeployments, config, realVerifier, createVerificationJson, debugLogger);
|
|
20
20
|
if (json) {
|
|
21
21
|
log(JSON.stringify(Object.fromEntries(Object.entries(l1ContractAddresses).map(([k, v])=>[
|
|
22
22
|
k,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAejD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAejD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAghB/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -8,10 +8,10 @@ const l1RpcUrlsOption = new Option('--l1-rpc-urls <string>', 'List of Ethereum h
|
|
|
8
8
|
]).makeOptionMandatory(true).argParser((arg)=>arg.split(',').map((url)=>url.trim()));
|
|
9
9
|
const networkOption = new Option('--network <string>', 'Network to execute against').env('NETWORK');
|
|
10
10
|
export function injectCommands(program, log, debugLogger) {
|
|
11
|
-
program.command('deploy-l1-contracts').description('Deploys all necessary Ethereum contracts for Aztec.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--validators <string>', 'Comma separated list of validators').option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', (arg)=>parseInt(arg), 0).addOption(l1ChainIdOption).option('--salt <number>', 'The optional salt to use in deployment', (arg)=>parseInt(arg)).option('--json', 'Output the contract addresses in JSON format').option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts').option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract').option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false).option('--real-verifier', 'Deploy the real verifier', false).option('--
|
|
11
|
+
program.command('deploy-l1-contracts').description('Deploys all necessary Ethereum contracts for Aztec.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--validators <string>', 'Comma separated list of validators').option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', (arg)=>parseInt(arg), 0).addOption(l1ChainIdOption).option('--salt <number>', 'The optional salt to use in deployment', (arg)=>parseInt(arg)).option('--json', 'Output the contract addresses in JSON format').option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts').option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract').option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false).option('--real-verifier', 'Deploy the real verifier', false).option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false).action(async (options)=>{
|
|
12
12
|
const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
|
|
13
13
|
const initialValidators = options.validators?.split(',').map((validator)=>EthAddress.fromString(validator)) || [];
|
|
14
|
-
await deployL1Contracts(options.l1RpcUrls, options.l1ChainId, options.privateKey, options.mnemonic, options.mnemonicIndex, options.salt, options.testAccounts, options.sponsoredFpc, options.acceleratedTestDeployments, options.json, options.createVerificationJson, initialValidators, options.realVerifier,
|
|
14
|
+
await deployL1Contracts(options.l1RpcUrls, options.l1ChainId, options.privateKey, options.mnemonic, options.mnemonicIndex, options.salt, options.testAccounts, options.sponsoredFpc, options.acceleratedTestDeployments, options.json, options.createVerificationJson, initialValidators, options.realVerifier, log, debugLogger);
|
|
15
15
|
});
|
|
16
16
|
program.command('deploy-new-rollup').description('Deploys a new rollup contract and adds it to the registry (if you are the owner).').requiredOption('-r, --registry-address <string>', 'The address of the registry contract', parseEthereumAddress).addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--validators <string>', 'Comma separated list of validators').option('-m, --mnemonic <string>', 'The mnemonic to use in deployment', MNEMONIC ?? 'test test test test test test test test test test test junk').option('-i, --mnemonic-index <number>', 'The index of the mnemonic to use in deployment', (arg)=>parseInt(arg), 0).addOption(l1ChainIdOption).option('--salt <number>', 'The optional salt to use in deployment', (arg)=>parseInt(arg)).option('--json', 'Output the contract addresses in JSON format').option('--test-accounts', 'Populate genesis state with initial fee juice for test accounts').option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract').option('--real-verifier', 'Deploy the real verifier', false).action(async (options)=>{
|
|
17
17
|
const { deployNewRollup } = await import('./deploy_new_rollup.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAyE/E"}
|
package/dest/cmds/pxe/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { logJson,
|
|
2
|
+
import { logJson, parseAztecAddress, parseEthereumAddress, parseFieldFromHexString, parsePublicKey, pxeOption } from '../../utils/commands.js';
|
|
3
3
|
export function injectCommands(program, log, debugLogger) {
|
|
4
4
|
program.command('add-contract').description('Adds an existing contract to the PXE. This is useful if you have deployed a contract outside of the PXE and want to use it with the PXE.').requiredOption('-c, --contract-artifact <fileLocation>', "A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts.js").requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress).requiredOption('--init-hash <init hash>', 'Initialization hash', parseFieldFromHexString).option('--salt <salt>', 'Optional deployment salt', parseFieldFromHexString).option('-p, --public-key <public key>', 'Optional public key for this contract', parsePublicKey).option('--portal-address <address>', 'Optional address to a portal contract on L1', parseEthereumAddress).option('--deployer-address <address>', 'Optional address of the contract deployer', parseAztecAddress).addOption(pxeOption).action(async (options)=>{
|
|
5
5
|
const { addContract } = await import('./add_contract.js');
|
|
6
6
|
await addContract(options.rpcUrl, options.contractArtifact, options.contractAddress, options.initHash, options.salt ?? Fr.ZERO, options.publicKey, options.deployerAddress, debugLogger, log);
|
|
7
7
|
});
|
|
8
|
-
program.command('get-current-base-fee').description('Gets the current base fee.').addOption(pxeOption).action(async (options)=>{
|
|
9
|
-
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
10
|
-
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
11
|
-
});
|
|
12
8
|
program.command('get-contract-data').description('Gets information about the Aztec contract deployed at the specified address.').argument('<contractAddress>', 'Aztec address of the contract.', parseAztecAddress).addOption(pxeOption).option('-b, --include-bytecode <boolean>', "Include the contract's public function bytecode, if any.", false).action(async (contractAddress, options)=>{
|
|
13
9
|
const { getContractData } = await import('./get_contract_data.js');
|
|
14
10
|
await getContractData(options.rpcUrl, contractAddress, options.includeBytecode, debugLogger, log);
|
|
@@ -21,16 +17,6 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
21
17
|
const { getAccount } = await import('./get_account.js');
|
|
22
18
|
await getAccount(address, options.rpcUrl, debugLogger, log);
|
|
23
19
|
});
|
|
24
|
-
program.command('get-node-info').description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.').option('--node-url <string>', 'URL of the node.').option('--json', 'Emit output as json').addOption(makePxeOption(false)).action(async (options)=>{
|
|
25
|
-
const { getNodeInfo } = await import('./get_node_info.js');
|
|
26
|
-
let url;
|
|
27
|
-
if (options.nodeUrl) {
|
|
28
|
-
url = options.nodeUrl;
|
|
29
|
-
} else {
|
|
30
|
-
url = options.rpcUrl;
|
|
31
|
-
}
|
|
32
|
-
await getNodeInfo(url, !options.nodeUrl, debugLogger, options.json, log, logJson(log));
|
|
33
|
-
});
|
|
34
20
|
program.command('get-pxe-info').description('Gets the information of a PXE at a URL.').addOption(pxeOption).action(async (options)=>{
|
|
35
21
|
const { getPXEInfo } = await import('./get_pxe_info.js');
|
|
36
22
|
await getPXEInfo(options.rpcUrl, debugLogger, log);
|
package/dest/utils/aztec.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import { type ContractArtifact, type FunctionAbi } from '@aztec/aztec.js/abi';
|
|
3
3
|
import { type DeployL1ContractsReturnType, type L1ContractsConfig, type Operator, RollupContract } from '@aztec/ethereum';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -18,7 +18,7 @@ export declare function getFunctionAbi(artifact: ContractArtifact, fnName: strin
|
|
|
18
18
|
* @param privateKey - The private key to be used in contract deployment.
|
|
19
19
|
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
20
20
|
*/
|
|
21
|
-
export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false,
|
|
21
|
+
export declare function deployAztecContracts(rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, acceleratedTestDeployments: boolean, config: L1ContractsConfig, realVerifier: boolean, createVerificationJson: string | false, debugLogger: Logger): Promise<DeployL1ContractsReturnType>;
|
|
22
22
|
export declare function deployNewRollupContracts(registryAddress: EthAddress, rpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, mnemonicIndex: number, salt: number | undefined, initialValidators: Operator[], genesisArchiveRoot: Fr, feeJuicePortalInitialBalance: bigint, config: L1ContractsConfig, realVerifier: boolean, logger: Logger): Promise<{
|
|
23
23
|
rollup: RollupContract;
|
|
24
24
|
slashFactoryAddress: EthAddress;
|
|
@@ -60,10 +60,4 @@ export declare const stripLeadingHex: (hex: string) => string;
|
|
|
60
60
|
*/
|
|
61
61
|
export declare const addLeadingHex: (hex: string) => `0x${string}`;
|
|
62
62
|
export declare function prettyPrintNargoToml(config: NoirPackageConfig): string;
|
|
63
|
-
/**
|
|
64
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
65
|
-
* @param pxe - PXE client.
|
|
66
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
67
|
-
*/
|
|
68
|
-
export declare function checkServerVersion(pxe: PXE, expectedVersionRange: string): Promise<void>;
|
|
69
63
|
//# sourceMappingURL=aztec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQhE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAMtF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,0BAA0B,EAAE,OAAO,EACnC,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,OAAO,EACrB,sBAAsB,EAAE,MAAM,GAAG,KAAK,EACtC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,CAAC,CAgCtC;AAED,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,UAAU,EAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,QAAQ,EAAE,EAC7B,kBAAkB,EAAE,EAAE,EACtB,4BAA4B,EAAE,MAAM,EACpC,MAAM,EAAE,iBAAiB,EACzB,YAAY,EAAE,OAAO,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,mBAAmB,EAAE,UAAU,CAAA;CAAE,CAAC,CA6CtE;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAKjE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,6BA4BpE;AAED;;;;;;;GAOG;AACH,wBAAsB,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK;;;;GAO3G;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAK7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,KAAK,MAAM,EAKtD,CAAC;AAOF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUtE"}
|
package/dest/utils/aztec.js
CHANGED
|
@@ -5,7 +5,6 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
5
5
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
6
6
|
import TOML from '@iarna/toml';
|
|
7
7
|
import { readFile } from 'fs/promises';
|
|
8
|
-
import { gtr, ltr, satisfies, valid } from 'semver';
|
|
9
8
|
import { encodeArgs } from './encoding.js';
|
|
10
9
|
/**
|
|
11
10
|
* Helper to get an ABI function or throw error if it doesn't exist.
|
|
@@ -25,7 +24,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
25
24
|
* @param chainId - The chain ID of the L1 host.
|
|
26
25
|
* @param privateKey - The private key to be used in contract deployment.
|
|
27
26
|
* @param mnemonic - The mnemonic to be used in contract deployment.
|
|
28
|
-
*/ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson,
|
|
27
|
+
*/ export async function deployAztecContracts(rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, acceleratedTestDeployments, config, realVerifier, createVerificationJson, debugLogger) {
|
|
29
28
|
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
30
29
|
const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
|
|
31
30
|
const account = !privateKey ? mnemonicToAccount(mnemonic, {
|
|
@@ -43,7 +42,7 @@ import { encodeArgs } from './encoding.js';
|
|
|
43
42
|
feeJuicePortalInitialBalance,
|
|
44
43
|
realVerifier,
|
|
45
44
|
...config
|
|
46
|
-
}, config, createVerificationJson
|
|
45
|
+
}, config, createVerificationJson);
|
|
47
46
|
return result;
|
|
48
47
|
}
|
|
49
48
|
export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId, privateKey, mnemonic, mnemonicIndex, salt, initialValidators, genesisArchiveRoot, feeJuicePortalInitialBalance, config, realVerifier, logger) {
|
|
@@ -177,27 +176,3 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
|
|
|
177
176
|
});
|
|
178
177
|
return partialToml + '\n[dependencies]\n' + dependenciesToml.join('\n') + '\n';
|
|
179
178
|
}
|
|
180
|
-
/** Mismatch between server and client versions. */ class VersionMismatchError extends Error {
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
184
|
-
* @param pxe - PXE client.
|
|
185
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
186
|
-
*/ export async function checkServerVersion(pxe, expectedVersionRange) {
|
|
187
|
-
const serverName = 'Aztec Node';
|
|
188
|
-
const { nodeVersion } = await pxe.getNodeInfo();
|
|
189
|
-
if (!nodeVersion) {
|
|
190
|
-
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
|
|
191
|
-
}
|
|
192
|
-
if (!nodeVersion || !valid(nodeVersion)) {
|
|
193
|
-
throw new VersionMismatchError(`Missing or invalid version identifier for ${serverName} (${nodeVersion ?? 'empty'}).`);
|
|
194
|
-
} else if (!satisfies(nodeVersion, expectedVersionRange)) {
|
|
195
|
-
if (gtr(nodeVersion, expectedVersionRange)) {
|
|
196
|
-
throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which is newer than the expected by this CLI (${expectedVersionRange}). Consider upgrading your CLI to a newer version.`);
|
|
197
|
-
} else if (ltr(nodeVersion, expectedVersionRange)) {
|
|
198
|
-
throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which is older than the expected by this CLI (${expectedVersionRange}). Consider upgrading your ${serverName} to a newer version.`);
|
|
199
|
-
} else {
|
|
200
|
-
throw new VersionMismatchError(`${serverName} is running version ${nodeVersion} which does not match the expected by this CLI (${expectedVersionRange}).`);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250920",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./contracts": "./dest/cmds/contracts/index.js",
|
|
@@ -71,20 +71,20 @@
|
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
75
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
76
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
77
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
78
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
79
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
80
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
81
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
82
|
-
"@aztec/node-lib": "3.0.0-nightly.
|
|
83
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
84
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
85
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
86
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
87
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
74
|
+
"@aztec/accounts": "3.0.0-nightly.20250920",
|
|
75
|
+
"@aztec/archiver": "3.0.0-nightly.20250920",
|
|
76
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250920",
|
|
77
|
+
"@aztec/constants": "3.0.0-nightly.20250920",
|
|
78
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250920",
|
|
79
|
+
"@aztec/ethereum": "3.0.0-nightly.20250920",
|
|
80
|
+
"@aztec/foundation": "3.0.0-nightly.20250920",
|
|
81
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250920",
|
|
82
|
+
"@aztec/node-lib": "3.0.0-nightly.20250920",
|
|
83
|
+
"@aztec/p2p": "3.0.0-nightly.20250920",
|
|
84
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250920",
|
|
85
|
+
"@aztec/stdlib": "3.0.0-nightly.20250920",
|
|
86
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250920",
|
|
87
|
+
"@aztec/world-state": "3.0.0-nightly.20250920",
|
|
88
88
|
"@iarna/toml": "^2.2.5",
|
|
89
89
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
90
90
|
"commander": "^12.1.0",
|
|
@@ -111,15 +111,15 @@
|
|
|
111
111
|
"typescript": "^5.3.3"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
115
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
116
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
117
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
118
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
119
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
120
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
121
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
122
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
114
|
+
"@aztec/accounts": "3.0.0-nightly.20250920",
|
|
115
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250920",
|
|
116
|
+
"@aztec/ethereum": "3.0.0-nightly.20250920",
|
|
117
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250920",
|
|
118
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250920",
|
|
119
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250920",
|
|
120
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250920",
|
|
121
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250920",
|
|
122
|
+
"@aztec/stdlib": "3.0.0-nightly.20250920"
|
|
123
123
|
},
|
|
124
124
|
"files": [
|
|
125
125
|
"dest",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
|
+
|
|
5
|
+
export async function getCurrentBaseFee(nodeUrl: string, debugLogger: Logger, log: LogFn) {
|
|
6
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
7
|
+
const fees = await node.getCurrentBaseFees();
|
|
8
|
+
log(`Current fees: ${jsonStringify(fees)}`);
|
|
9
|
+
}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { LogFn
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
+
|
|
4
|
+
export async function getNodeInfo(nodeUrl: string, json: boolean, log: LogFn, logJson: (output: any) => void) {
|
|
5
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
3
6
|
|
|
4
|
-
export async function getNodeInfo(
|
|
5
|
-
rpcUrl: string,
|
|
6
|
-
pxeRequest: boolean,
|
|
7
|
-
debugLogger: Logger,
|
|
8
|
-
json: boolean,
|
|
9
|
-
log: LogFn,
|
|
10
|
-
logJson: (output: any) => void,
|
|
11
|
-
) {
|
|
12
|
-
let client: AztecNode | PXE;
|
|
13
|
-
if (pxeRequest) {
|
|
14
|
-
client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
15
|
-
} else {
|
|
16
|
-
client = createAztecNodeClient(rpcUrl);
|
|
17
|
-
}
|
|
18
7
|
const info = await client.getNodeInfo();
|
|
19
8
|
if (json) {
|
|
20
9
|
logJson({
|
|
@@ -3,6 +3,7 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
logJson,
|
|
6
7
|
nodeOption,
|
|
7
8
|
parseAztecAddress,
|
|
8
9
|
parseField,
|
|
@@ -25,6 +26,15 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
25
26
|
await getBlock(options.rpcUrl, options.nodeUrl, blockNumber, debugLogger, log);
|
|
26
27
|
});
|
|
27
28
|
|
|
29
|
+
program
|
|
30
|
+
.command('get-current-base-fee')
|
|
31
|
+
.description('Gets the current base fee.')
|
|
32
|
+
.addOption(nodeOption)
|
|
33
|
+
.action(async options => {
|
|
34
|
+
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
35
|
+
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
36
|
+
});
|
|
37
|
+
|
|
28
38
|
program
|
|
29
39
|
.command('get-l1-to-l2-message-witness')
|
|
30
40
|
.description('Gets a L1 to L2 message witness.')
|
|
@@ -65,5 +75,15 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
65
75
|
await blockNumber(options.nodeUrl, log);
|
|
66
76
|
});
|
|
67
77
|
|
|
78
|
+
program
|
|
79
|
+
.command('get-node-info')
|
|
80
|
+
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
81
|
+
.option('--json', 'Emit output as json')
|
|
82
|
+
.addOption(nodeOption)
|
|
83
|
+
.action(async options => {
|
|
84
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
85
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
86
|
+
});
|
|
87
|
+
|
|
68
88
|
return program;
|
|
69
89
|
}
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
EthAddress,
|
|
7
7
|
Fr,
|
|
8
8
|
L1FeeJuicePortalManager,
|
|
9
|
-
type PXE,
|
|
10
9
|
type WaitForProvenOpts,
|
|
11
10
|
type WaitOpts,
|
|
12
11
|
type Wallet,
|
|
@@ -58,7 +57,7 @@ export async function bootstrapNetwork(
|
|
|
58
57
|
) {
|
|
59
58
|
const pxe = await createCompatibleClient(pxeUrl, debugLog);
|
|
60
59
|
const node = createAztecNodeClient(nodeUrl);
|
|
61
|
-
const wallet = new TestWallet(pxe);
|
|
60
|
+
const wallet = new TestWallet(pxe, node);
|
|
62
61
|
|
|
63
62
|
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
|
|
64
63
|
// so all we need to do is register them to our pxe.
|
|
@@ -85,14 +84,14 @@ export async function bootstrapNetwork(
|
|
|
85
84
|
|
|
86
85
|
const { token, bridge } = await deployToken(wallet, defaultAccountAddress, portalAddress);
|
|
87
86
|
|
|
88
|
-
await initPortal(
|
|
87
|
+
await initPortal(node, l1Client, erc20Address, portalAddress, bridge.address);
|
|
89
88
|
|
|
90
89
|
const fpcAdmin = defaultAccountAddress;
|
|
91
90
|
const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
|
|
92
91
|
|
|
93
92
|
const counter = await deployCounter(wallet, defaultAccountAddress);
|
|
94
93
|
|
|
95
|
-
await fundFPC(
|
|
94
|
+
await fundFPC(node, counter.address, wallet, defaultAccountAddress, l1Client, fpc.address, debugLog);
|
|
96
95
|
|
|
97
96
|
if (json) {
|
|
98
97
|
log(
|
|
@@ -219,7 +218,7 @@ async function deployToken(
|
|
|
219
218
|
* Step 3. Initialize DevCoin's L1 portal
|
|
220
219
|
*/
|
|
221
220
|
async function initPortal(
|
|
222
|
-
|
|
221
|
+
aztecNode: AztecNode,
|
|
223
222
|
l1Client: ExtendedViemWalletClient,
|
|
224
223
|
erc20: EthAddress,
|
|
225
224
|
portal: EthAddress,
|
|
@@ -228,7 +227,7 @@ async function initPortal(
|
|
|
228
227
|
const { TokenPortalAbi } = await import('@aztec/l1-artifacts');
|
|
229
228
|
const {
|
|
230
229
|
l1ContractAddresses: { registryAddress },
|
|
231
|
-
} = await
|
|
230
|
+
} = await aztecNode.getNodeInfo();
|
|
232
231
|
|
|
233
232
|
const contract = getContract({
|
|
234
233
|
abi: TokenPortalAbi,
|
|
@@ -278,7 +277,6 @@ async function deployCounter(wallet: Wallet, defaultAccountAddress: AztecAddress
|
|
|
278
277
|
|
|
279
278
|
// NOTE: Disabling for now in order to get devnet running
|
|
280
279
|
async function fundFPC(
|
|
281
|
-
pxe: PXE,
|
|
282
280
|
node: AztecNode,
|
|
283
281
|
counterAddress: AztecAddress,
|
|
284
282
|
wallet: Wallet,
|
|
@@ -295,11 +293,11 @@ async function fundFPC(
|
|
|
295
293
|
const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
|
|
296
294
|
const {
|
|
297
295
|
protocolContractAddresses: { feeJuice },
|
|
298
|
-
} = await
|
|
296
|
+
} = await node.getNodeInfo();
|
|
299
297
|
|
|
300
298
|
const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
|
|
301
299
|
|
|
302
|
-
const feeJuicePortal = await L1FeeJuicePortalManager.new(
|
|
300
|
+
const feeJuicePortal = await L1FeeJuicePortalManager.new(node, l1Client, debugLog);
|
|
303
301
|
|
|
304
302
|
const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(
|
|
305
303
|
fpcAddress,
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import type { LogFn
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
|
|
5
|
-
import { ETHEREUM_HOSTS, l1ChainIdOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
5
|
+
import { ETHEREUM_HOSTS, l1ChainIdOption, nodeOption, parseOptionalInteger, pxeOption } from '../../utils/commands.js';
|
|
6
6
|
|
|
7
|
-
export function injectCommands(program: Command, log: LogFn
|
|
7
|
+
export function injectCommands(program: Command, log: LogFn) {
|
|
8
8
|
program
|
|
9
9
|
.command('setup-protocol-contracts')
|
|
10
10
|
.description('Bootstrap the blockchain by initializing all the protocol contracts')
|
|
11
11
|
.addOption(pxeOption)
|
|
12
|
+
.addOption(nodeOption)
|
|
12
13
|
.option('--testAccounts', 'Deploy funded test accounts.')
|
|
13
14
|
.option('--sponsoredFPC', 'Deploy a sponsored FPC.')
|
|
14
15
|
.option('--json', 'Output the contract addresses in JSON format')
|
|
15
16
|
.action(async options => {
|
|
16
17
|
const { setupL2Contracts } = await import('./setup_l2_contract.js');
|
|
17
|
-
await setupL2Contracts(
|
|
18
|
+
await setupL2Contracts(
|
|
19
|
+
options.rpcUrl,
|
|
20
|
+
options.nodeUrl,
|
|
21
|
+
options.testAccounts,
|
|
22
|
+
options.sponsoredFPC,
|
|
23
|
+
options.json,
|
|
24
|
+
log,
|
|
25
|
+
);
|
|
18
26
|
});
|
|
19
27
|
|
|
20
28
|
program
|
|
@@ -34,7 +42,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
34
42
|
'test test test test test test test test test test test junk',
|
|
35
43
|
)
|
|
36
44
|
.option('--block-number <number>', 'Block number to query next sequencer for', parseOptionalInteger)
|
|
37
|
-
.addOption(
|
|
45
|
+
.addOption(nodeOption)
|
|
38
46
|
.addOption(l1ChainIdOption)
|
|
39
47
|
.action(async (command, who, options) => {
|
|
40
48
|
const { sequencers } = await import('./sequencers.js');
|
|
@@ -42,12 +50,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
42
50
|
command: command,
|
|
43
51
|
who,
|
|
44
52
|
mnemonic: options.mnemonic,
|
|
45
|
-
|
|
53
|
+
nodeUrl: options.nodeUrl,
|
|
46
54
|
l1RpcUrls: options.l1RpcUrls,
|
|
47
55
|
chainId: options.l1ChainId,
|
|
48
56
|
blockNumber: options.blockNumber,
|
|
49
57
|
log,
|
|
50
|
-
debugLogger,
|
|
51
58
|
});
|
|
52
59
|
});
|
|
53
60
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fr,
|
|
1
|
+
import { Fr, createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
3
|
-
import type { LogFn
|
|
3
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
5
5
|
|
|
6
6
|
import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
|
|
@@ -11,15 +11,14 @@ export async function sequencers(opts: {
|
|
|
11
11
|
who?: string;
|
|
12
12
|
mnemonic?: string;
|
|
13
13
|
bn254SecretKey?: bigint;
|
|
14
|
-
|
|
14
|
+
nodeUrl: string;
|
|
15
15
|
l1RpcUrls: string[];
|
|
16
16
|
chainId: number;
|
|
17
17
|
blockNumber?: number;
|
|
18
18
|
log: LogFn;
|
|
19
|
-
debugLogger: Logger;
|
|
20
19
|
}) {
|
|
21
|
-
const { command, who: maybeWho, mnemonic, bn254SecretKey,
|
|
22
|
-
const client =
|
|
20
|
+
const { command, who: maybeWho, mnemonic, bn254SecretKey, nodeUrl, l1RpcUrls, chainId, log } = opts;
|
|
21
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
23
22
|
const { l1ContractAddresses } = await client.getNodeInfo();
|
|
24
23
|
|
|
25
24
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AccountManager,
|
|
4
|
+
type AztecAddress,
|
|
5
|
+
type WaitOpts,
|
|
6
|
+
createAztecNodeClient,
|
|
7
|
+
createPXEClient,
|
|
8
|
+
makeFetch,
|
|
9
|
+
} from '@aztec/aztec.js';
|
|
3
10
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
11
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
12
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -8,7 +15,8 @@ import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
|
8
15
|
import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
|
|
9
16
|
|
|
10
17
|
export async function setupL2Contracts(
|
|
11
|
-
|
|
18
|
+
pxeUrl: string,
|
|
19
|
+
nodeUrl: string,
|
|
12
20
|
testAccounts: boolean,
|
|
13
21
|
sponsoredFPC: boolean,
|
|
14
22
|
json: boolean,
|
|
@@ -20,8 +28,9 @@ export async function setupL2Contracts(
|
|
|
20
28
|
};
|
|
21
29
|
log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
|
|
22
30
|
log('setupL2Contracts: Creating PXE client...');
|
|
23
|
-
const pxe = createPXEClient(
|
|
24
|
-
const
|
|
31
|
+
const pxe = createPXEClient(pxeUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
|
|
32
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
33
|
+
const wallet = new TestWallet(pxe, node);
|
|
25
34
|
|
|
26
35
|
let deployedAccountManagers: AccountManager[] = [];
|
|
27
36
|
if (testAccounts) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js';
|
|
2
2
|
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
|
-
export async function advanceEpoch(l1RpcUrls: string[],
|
|
6
|
-
const
|
|
7
|
-
const rollupAddress = await
|
|
5
|
+
export async function advanceEpoch(l1RpcUrls: string[], nodeUrl: string, log: LogFn) {
|
|
6
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
7
|
+
const rollupAddress = await aztecNode.getNodeInfo().then(i => i.l1ContractAddresses.rollupAddress);
|
|
8
8
|
|
|
9
9
|
const cheat = RollupCheatCodes.create(l1RpcUrls, { rollupAddress });
|
|
10
10
|
|
|
@@ -22,7 +22,6 @@ export async function deployL1Contracts(
|
|
|
22
22
|
createVerificationJson: string | false,
|
|
23
23
|
initialValidators: EthAddress[],
|
|
24
24
|
realVerifier: boolean,
|
|
25
|
-
flushEntryQueue: boolean,
|
|
26
25
|
log: LogFn,
|
|
27
26
|
debugLogger: Logger,
|
|
28
27
|
) {
|
|
@@ -53,7 +52,6 @@ export async function deployL1Contracts(
|
|
|
53
52
|
config,
|
|
54
53
|
realVerifier,
|
|
55
54
|
createVerificationJson,
|
|
56
|
-
flushEntryQueue,
|
|
57
55
|
debugLogger,
|
|
58
56
|
);
|
|
59
57
|
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -49,7 +49,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
49
49
|
.option('--sponsored-fpc', 'Populate genesis state with a testing sponsored FPC contract')
|
|
50
50
|
.option('--accelerated-test-deployments', 'Fire and forget deployment transactions, use in testing only', false)
|
|
51
51
|
.option('--real-verifier', 'Deploy the real verifier', false)
|
|
52
|
-
.option('--flush-entry-queue', 'Whether to flush the entry queue after adding initial validators', false)
|
|
53
52
|
.option('--create-verification-json [path]', 'Create JSON file for etherscan contract verification', false)
|
|
54
53
|
.action(async options => {
|
|
55
54
|
const { deployL1Contracts } = await import('./deploy_l1_contracts.js');
|
|
@@ -70,7 +69,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
70
69
|
options.createVerificationJson,
|
|
71
70
|
initialValidators,
|
|
72
71
|
options.realVerifier,
|
|
73
|
-
options.flushEntryQueue,
|
|
74
72
|
log,
|
|
75
73
|
debugLogger,
|
|
76
74
|
);
|
package/src/cmds/pxe/index.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { Command } from 'commander';
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
logJson,
|
|
8
|
-
makePxeOption,
|
|
9
8
|
parseAztecAddress,
|
|
10
9
|
parseEthereumAddress,
|
|
11
10
|
parseFieldFromHexString,
|
|
@@ -45,15 +44,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
45
44
|
);
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
program
|
|
49
|
-
.command('get-current-base-fee')
|
|
50
|
-
.description('Gets the current base fee.')
|
|
51
|
-
.addOption(pxeOption)
|
|
52
|
-
.action(async options => {
|
|
53
|
-
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
54
|
-
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
47
|
program
|
|
58
48
|
.command('get-contract-data')
|
|
59
49
|
.description('Gets information about the Aztec contract deployed at the specified address.')
|
|
@@ -85,23 +75,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
85
75
|
await getAccount(address, options.rpcUrl, debugLogger, log);
|
|
86
76
|
});
|
|
87
77
|
|
|
88
|
-
program
|
|
89
|
-
.command('get-node-info')
|
|
90
|
-
.description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.')
|
|
91
|
-
.option('--node-url <string>', 'URL of the node.')
|
|
92
|
-
.option('--json', 'Emit output as json')
|
|
93
|
-
.addOption(makePxeOption(false))
|
|
94
|
-
.action(async options => {
|
|
95
|
-
const { getNodeInfo } = await import('./get_node_info.js');
|
|
96
|
-
let url: string;
|
|
97
|
-
if (options.nodeUrl) {
|
|
98
|
-
url = options.nodeUrl;
|
|
99
|
-
} else {
|
|
100
|
-
url = options.rpcUrl;
|
|
101
|
-
}
|
|
102
|
-
await getNodeInfo(url, !options.nodeUrl, debugLogger, options.json, log, logJson(log));
|
|
103
|
-
});
|
|
104
|
-
|
|
105
78
|
program
|
|
106
79
|
.command('get-pxe-info')
|
|
107
80
|
.description('Gets the information of a PXE at a URL.')
|
package/src/utils/aztec.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
2
2
|
import {
|
|
3
3
|
type ContractArtifact,
|
|
4
4
|
type FunctionAbi,
|
|
@@ -20,7 +20,6 @@ import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
|
20
20
|
|
|
21
21
|
import TOML from '@iarna/toml';
|
|
22
22
|
import { readFile } from 'fs/promises';
|
|
23
|
-
import { gtr, ltr, satisfies, valid } from 'semver';
|
|
24
23
|
|
|
25
24
|
import { encodeArgs } from './encoding.js';
|
|
26
25
|
|
|
@@ -59,7 +58,6 @@ export async function deployAztecContracts(
|
|
|
59
58
|
config: L1ContractsConfig,
|
|
60
59
|
realVerifier: boolean,
|
|
61
60
|
createVerificationJson: string | false,
|
|
62
|
-
flushEntryQueue: boolean,
|
|
63
61
|
debugLogger: Logger,
|
|
64
62
|
): Promise<DeployL1ContractsReturnType> {
|
|
65
63
|
const { createEthereumChain, deployL1Contracts } = await import('@aztec/ethereum');
|
|
@@ -90,7 +88,6 @@ export async function deployAztecContracts(
|
|
|
90
88
|
},
|
|
91
89
|
config,
|
|
92
90
|
createVerificationJson,
|
|
93
|
-
flushEntryQueue,
|
|
94
91
|
);
|
|
95
92
|
|
|
96
93
|
return result;
|
|
@@ -260,38 +257,3 @@ export function prettyPrintNargoToml(config: NoirPackageConfig): string {
|
|
|
260
257
|
|
|
261
258
|
return partialToml + '\n[dependencies]\n' + dependenciesToml.join('\n') + '\n';
|
|
262
259
|
}
|
|
263
|
-
|
|
264
|
-
/** Mismatch between server and client versions. */
|
|
265
|
-
class VersionMismatchError extends Error {}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Checks that Private eXecution Environment (PXE) version matches the expected one by this CLI. Throws if not.
|
|
269
|
-
* @param pxe - PXE client.
|
|
270
|
-
* @param expectedVersionRange - Expected version by CLI.
|
|
271
|
-
*/
|
|
272
|
-
export async function checkServerVersion(pxe: PXE, expectedVersionRange: string) {
|
|
273
|
-
const serverName = 'Aztec Node';
|
|
274
|
-
const { nodeVersion } = await pxe.getNodeInfo();
|
|
275
|
-
if (!nodeVersion) {
|
|
276
|
-
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
|
|
277
|
-
}
|
|
278
|
-
if (!nodeVersion || !valid(nodeVersion)) {
|
|
279
|
-
throw new VersionMismatchError(
|
|
280
|
-
`Missing or invalid version identifier for ${serverName} (${nodeVersion ?? 'empty'}).`,
|
|
281
|
-
);
|
|
282
|
-
} else if (!satisfies(nodeVersion, expectedVersionRange)) {
|
|
283
|
-
if (gtr(nodeVersion, expectedVersionRange)) {
|
|
284
|
-
throw new VersionMismatchError(
|
|
285
|
-
`${serverName} is running version ${nodeVersion} which is newer than the expected by this CLI (${expectedVersionRange}). Consider upgrading your CLI to a newer version.`,
|
|
286
|
-
);
|
|
287
|
-
} else if (ltr(nodeVersion, expectedVersionRange)) {
|
|
288
|
-
throw new VersionMismatchError(
|
|
289
|
-
`${serverName} is running version ${nodeVersion} which is older than the expected by this CLI (${expectedVersionRange}). Consider upgrading your ${serverName} to a newer version.`,
|
|
290
|
-
);
|
|
291
|
-
} else {
|
|
292
|
-
throw new VersionMismatchError(
|
|
293
|
-
`${serverName} is running version ${nodeVersion} which does not match the expected by this CLI (${expectedVersionRange}).`,
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_current_base_fee.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_current_base_fee.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAItF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
-
export async function getCurrentBaseFee(rpcUrl, debugLogger, log) {
|
|
4
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
5
|
-
const fees = await client.getCurrentBaseFees();
|
|
6
|
-
log(`Current fees: ${jsonStringify(fees)}`);
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
-
export declare function getNodeInfo(rpcUrl: string, pxeRequest: boolean, debugLogger: Logger, json: boolean, log: LogFn, logJson: (output: any) => void): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=get_node_info.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/pxe/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBAgE/B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createCompatibleClient } from '@aztec/aztec.js';
|
|
2
|
-
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
|
-
|
|
5
|
-
export async function getCurrentBaseFee(rpcUrl: string, debugLogger: Logger, log: LogFn) {
|
|
6
|
-
const client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
7
|
-
const fees = await client.getCurrentBaseFees();
|
|
8
|
-
log(`Current fees: ${jsonStringify(fees)}`);
|
|
9
|
-
}
|