Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions yarn-project/aztec/src/cli/chain_l2_config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import type { EnvVar } from '@aztec/foundation/config';

import path from 'path';

export type NetworkNames = 'testnet-ignition';

export type L2ChainConfig = {
Expand Down Expand Up @@ -47,7 +51,7 @@ export async function getL2ChainConfig(networkName: NetworkNames): Promise<L2Cha
return undefined;
}

function enrichVar(envVar: string, value: string) {
function enrichVar(envVar: EnvVar, value: string) {
// Don't override
if (process.env[envVar]) {
return;
Expand All @@ -64,11 +68,12 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
enrichVar('P2P_BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
}