Skip to content

Commit 3d32e0e

Browse files
committed
fix: network deployments
1 parent c3c04a4 commit 3d32e0e

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

spartan/aztec-network/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
out/
1+
out/
2+
tmp/

spartan/aztec-network/eth-devnet/create.sh

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,39 +103,46 @@ create_beacon_genesis() {
103103
echo " Execution genesis path: $execution_genesis_path"
104104

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

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

118+
# Copy mnemonics file to tmp and update it with provided mnemonic
119+
cp "$DIR_PATH/config/mnemonics.yaml" "$DIR_PATH/tmp/mnemonics.yaml"
120+
yq eval '.0.mnemonic = "'"$MNEMONIC"'"' -i "$DIR_PATH/tmp/mnemonics.yaml"
121+
118122
# Run the protolamba's eth2 testnet genesis container
119-
echo "$DIR_PATH/config:/app/config"
120-
echo "$DIR_PATH/out:/app/out"
121123

122124
docker run --rm \
123125
-v "$DIR_PATH/config:/app/config" \
126+
-v "$DIR_PATH/tmp:/app/tmp" \
124127
-v "$DIR_PATH/out:/app/out" \
125128
maddiaa/eth2-testnet-genesis deneb \
126-
--config="./out/config.yaml" \
129+
--config="./tmp/config.yaml" \
130+
--eth1-config="./tmp/genesis.json" \
127131
--preset-phase0=minimal \
128132
--preset-altair=minimal \
129133
--preset-bellatrix=minimal \
130134
--preset-capella=minimal \
131135
--preset-deneb=minimal \
132-
--eth1-config="./out/genesis.json" \
133136
--state-output="${beacon_genesis_path}/genesis.ssz" \
134137
--tranches-dir="$beacon_genesis_path" \
135-
--mnemonics="$beacon_mnemonics_path" \
138+
--mnemonics="./tmp/mnemonics.yaml" \
136139
--eth1-withdrawal-address="0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
137140
--eth1-match-genesis-time
138141

142+
143+
cp "$DIR_PATH/tmp/genesis.json" "$DIR_PATH/out/genesis.json"
144+
cp "$DIR_PATH/tmp/config.yaml" "$DIR_PATH/out/config.yaml"
145+
139146
if [[ $? -ne 0 ]]; then
140147
echo "Error: eth2-testnet-genesis failed."
141148
exit 1
@@ -162,12 +169,12 @@ beacon_config_path="$DIR_PATH/config/config.yaml"
162169
genesis_json_path="$DIR_PATH/config/genesis.json"
163170

164171
mkdir -p "$DIR_PATH/out"
172+
mkdir -p "$DIR_PATH/tmp"
165173

166-
create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/out/genesis.json"
167-
create_beacon_genesis "$DIR_PATH/out/genesis.json"
174+
create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/tmp/genesis.json"
175+
create_beacon_genesis "$DIR_PATH/tmp/genesis.json"
168176
create_deposit_contract_block
169177
write_ssz_file_base64
170178

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

0 commit comments

Comments
 (0)