@@ -103,39 +103,46 @@ create_beacon_genesis() {
103
103
echo " Execution genesis path: $execution_genesis_path "
104
104
105
105
# 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"
107
107
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"
110
110
fi
111
111
112
112
# Update the chain id if it is provided
113
113
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"
116
116
fi
117
117
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
+
118
122
# Run the protolamba's eth2 testnet genesis container
119
- echo " $DIR_PATH /config:/app/config"
120
- echo " $DIR_PATH /out:/app/out"
121
123
122
124
docker run --rm \
123
125
-v " $DIR_PATH /config:/app/config" \
126
+ -v " $DIR_PATH /tmp:/app/tmp" \
124
127
-v " $DIR_PATH /out:/app/out" \
125
128
maddiaa/eth2-testnet-genesis deneb \
126
- --config=" ./out/config.yaml" \
129
+ --config=" ./tmp/config.yaml" \
130
+ --eth1-config=" ./tmp/genesis.json" \
127
131
--preset-phase0=minimal \
128
132
--preset-altair=minimal \
129
133
--preset-bellatrix=minimal \
130
134
--preset-capella=minimal \
131
135
--preset-deneb=minimal \
132
- --eth1-config=" ./out/genesis.json" \
133
136
--state-output=" ${beacon_genesis_path} /genesis.ssz" \
134
137
--tranches-dir=" $beacon_genesis_path " \
135
- --mnemonics=" $beacon_mnemonics_path " \
138
+ --mnemonics=" ./tmp/mnemonics.yaml " \
136
139
--eth1-withdrawal-address=" 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
137
140
--eth1-match-genesis-time
138
141
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
+
139
146
if [[ $? -ne 0 ]]; then
140
147
echo " Error: eth2-testnet-genesis failed."
141
148
exit 1
@@ -162,12 +169,12 @@ beacon_config_path="$DIR_PATH/config/config.yaml"
162
169
genesis_json_path=" $DIR_PATH /config/genesis.json"
163
170
164
171
mkdir -p " $DIR_PATH /out"
172
+ mkdir -p " $DIR_PATH /tmp"
165
173
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"
168
176
create_deposit_contract_block
169
177
write_ssz_file_base64
170
178
171
- cp " $beacon_config_path " " $DIR_PATH /out/config.yaml"
172
179
cp " $DIR_PATH /config/jwt-secret.hex" " $DIR_PATH /out/jwt-secret.hex"
173
180
echo " Genesis files copied to ./out"
0 commit comments