Skip to content

Commit

Permalink
fix: network deployments (#11463)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 authored Jan 24, 2025
1 parent 85c33d8 commit 0804913
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
3 changes: 2 additions & 1 deletion spartan/aztec-network/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
out/
out/
tmp/
33 changes: 20 additions & 13 deletions spartan/aztec-network/eth-devnet/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,46 @@ create_beacon_genesis() {
echo " Execution genesis path: $execution_genesis_path"

# update the templates block time if it is provided
cp "$DIR_PATH/$beacon_config_path" "$DIR_PATH/out/config.yaml"
cp "$DIR_PATH/$beacon_config_path" "$DIR_PATH/tmp/config.yaml"
if [[ -n "${BLOCK_TIME:-}" ]]; then
yq eval ".SECONDS_PER_SLOT = ${BLOCK_TIME}" -i "$DIR_PATH/out/config.yaml"
yq eval ".SECONDS_PER_ETH1_BLOCK = ${BLOCK_TIME}" -i "$DIR_PATH/out/config.yaml"
yq eval ".SECONDS_PER_SLOT = ${BLOCK_TIME}" -i "$DIR_PATH/tmp/config.yaml"
yq eval ".SECONDS_PER_ETH1_BLOCK = ${BLOCK_TIME}" -i "$DIR_PATH/tmp/config.yaml"
fi

# Update the chain id if it is provided
if [[ -n "${CHAIN_ID:-}" ]]; then
yq eval ".DEPOSIT_CHAIN_ID = ${CHAIN_ID}" -i "$DIR_PATH/out/config.yaml"
yq eval ".DEPOSIT_NETWORK_ID = ${CHAIN_ID}" -i "$DIR_PATH/out/config.yaml"
yq eval ".DEPOSIT_CHAIN_ID = ${CHAIN_ID}" -i "$DIR_PATH/tmp/config.yaml"
yq eval ".DEPOSIT_NETWORK_ID = ${CHAIN_ID}" -i "$DIR_PATH/tmp/config.yaml"
fi

# Copy mnemonics file to tmp and update it with provided mnemonic
cp "$DIR_PATH/config/mnemonics.yaml" "$DIR_PATH/tmp/mnemonics.yaml"
yq eval '.0.mnemonic = "'"$MNEMONIC"'"' -i "$DIR_PATH/tmp/mnemonics.yaml"

# Run the protolamba's eth2 testnet genesis container
echo "$DIR_PATH/config:/app/config"
echo "$DIR_PATH/out:/app/out"

docker run --rm \
-v "$DIR_PATH/config:/app/config" \
-v "$DIR_PATH/tmp:/app/tmp" \
-v "$DIR_PATH/out:/app/out" \
maddiaa/eth2-testnet-genesis deneb \
--config="./out/config.yaml" \
--config="./tmp/config.yaml" \
--eth1-config="./tmp/genesis.json" \
--preset-phase0=minimal \
--preset-altair=minimal \
--preset-bellatrix=minimal \
--preset-capella=minimal \
--preset-deneb=minimal \
--eth1-config="./out/genesis.json" \
--state-output="${beacon_genesis_path}/genesis.ssz" \
--tranches-dir="$beacon_genesis_path" \
--mnemonics="$beacon_mnemonics_path" \
--mnemonics="./tmp/mnemonics.yaml" \
--eth1-withdrawal-address="0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--eth1-match-genesis-time


cp "$DIR_PATH/tmp/genesis.json" "$DIR_PATH/out/genesis.json"
cp "$DIR_PATH/tmp/config.yaml" "$DIR_PATH/out/config.yaml"

if [[ $? -ne 0 ]]; then
echo "Error: eth2-testnet-genesis failed."
exit 1
Expand All @@ -162,12 +169,12 @@ beacon_config_path="$DIR_PATH/config/config.yaml"
genesis_json_path="$DIR_PATH/config/genesis.json"

mkdir -p "$DIR_PATH/out"
mkdir -p "$DIR_PATH/tmp"

create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/out/genesis.json"
create_beacon_genesis "$DIR_PATH/out/genesis.json"
create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/tmp/genesis.json"
create_beacon_genesis "$DIR_PATH/tmp/genesis.json"
create_deposit_contract_block
write_ssz_file_base64

cp "$beacon_config_path" "$DIR_PATH/out/config.yaml"
cp "$DIR_PATH/config/jwt-secret.hex" "$DIR_PATH/out/jwt-secret.hex"
echo "Genesis files copied to ./out"

0 comments on commit 0804913

Please sign in to comment.