Skip to content

Commit

Permalink
feat(spartan): add extra accounts (#11300)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 authored Jan 17, 2025
1 parent 085f782 commit 7782836
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 17 additions & 3 deletions spartan/aztec-network/templates/reth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,23 @@ spec:
const genesis = JSON.parse(fs.readFileSync('/genesis-template/genesis.json', 'utf8'));
genesis.alloc[wallet.address] = {
balance: '0x3635c9adc5dea00000' // 1000 ETH in wei
};
// Generate wallets for each index
const numValidators = {{ .Values.validator.replicas }};
const numExtraAccounts = {{ .Values.ethereum.extraAccounts }};
const totalAccounts = numValidators + numExtraAccounts;
for (let i = 0; i < totalAccounts; i++) {
// Derive wallet for the current index
const childWallet = wallet.deriveChild(i);
// Add the wallet's address and balance to the genesis allocation
genesis.alloc[childWallet.address] = {
balance: '0x3635c9adc5dea00000', // 1000 ETH in wei
};
console.log(`Added wallet ${i}: ${childWallet.address}`);
}
// We rely on the deterministic deployment proxy to deploy the contracts
// It comes preloaded on anvil (https://book.getfoundry.sh/tutorials/create2-tutorial)
Expand Down
1 change: 1 addition & 0 deletions spartan/aztec-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ ethereum:
replicas: 1
chainId: 1337
blockTime: 12sec
extraAccounts: 10
# 1 billion gas limit
# helps ensure we can deploy public contracts
gasLimit: "1000000000"
Expand Down

0 comments on commit 7782836

Please sign in to comment.