Skip to content

Commit a950150

Browse files
committed
updating the fixes for the scripts
1 parent d9dffff commit a950150

4 files changed

+25
-10
lines changed

scripts/onboarding_round_6.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -953,16 +953,21 @@ grafana_options(){
953953
start_supra_container(){
954954
ip_address=$(grep 'ip_address' operator_config.toml | awk -F'=' '{print $2}' | tr -d ' "')
955955
echo "Starting supra container"
956-
docker start supra_$ip_address
957-
exit 1
956+
if ! docker start supra_$ip_address; then
957+
echo "Failed starting the Validator node container"
958+
exit 1
959+
else
960+
rm "$SCRIPT_EXECUTION_LOCATION/genesis_blob.zip"
961+
rm -rf "$SCRIPT_EXECUTION_LOCATION/genesis_blob"
962+
echo "Started the Validator Node container."
963+
fi
958964
}
959965

960966
stop_supra_container(){
961967
ip_address=$(grep 'ip_address' operator_config.toml | awk -F'=' '{print $2}' | tr -d ' "')
962968
echo "Stopping supra container"
963969
if ! docker stop supra_$ip_address; then
964970
echo "Failed to stop supra container. Exiting..."
965-
exit 1
966971
fi
967972
}
968973

@@ -992,6 +997,9 @@ unzip $SCRIPT_EXECUTION_LOCATION/latest_snapshot.zip -d $SCRIPT_EXECUTION_LOCATI
992997

993998
# Copy snapshot into smr_database
994999
cp $SCRIPT_EXECUTION_LOCATION/snapshot/snapshot_*/store/* $SCRIPT_EXECUTION_LOCATION/smr_storage/
1000+
wget -O $SCRIPT_EXECUTION_LOCATION/genesis_blob.zip https://testnet-snapshot.supra.com/configs/genesis_blob.zip
1001+
unzip $SCRIPT_EXECUTION_LOCATION/genesis_blob.zip -d $SCRIPT_EXECUTION_LOCATION/
1002+
cp $SCRIPT_EXECUTION_LOCATION/genesis_blob/genesis.blob $SCRIPT_EXECUTION_LOCATION/
9951003
}
9961004

9971005
phase3_fresh_start() {

scripts/rpc_onboarding_round_6.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ EOF
316316
wget -O $SCRIPT_EXECUTION_LOCATION/ca_certificate.pem https://testnet-snapshot.supra.com/certs/ca_certificate.pem
317317
wget -O $SCRIPT_EXECUTION_LOCATION/client_supra_certificate.pem https://testnet-snapshot.supra.com/certs/client_supra_certificate.pem
318318
wget -O $SCRIPT_EXECUTION_LOCATION/client_supra_key.pem https://testnet-snapshot.supra.com/certs/client_supra_key.pem
319-
wget -O $SCRIPT_EXECUTION_LOCATION/genesis.blob https://testnet-snapshot.supra.com/configs/genesis.blob
319+
wget -O $SCRIPT_EXECUTION_LOCATION/genesis_blob.zip https://testnet-snapshot.supra.com/configs/genesis_blob.zip
320320
wget -O $SCRIPT_EXECUTION_LOCATION/supra_committees.json https://testnet-snapshot.supra.com/configs/supra_committees.json
321-
321+
322322
docker cp supra_rpc_configs/genesis.blob supra_rpc_$IP_ADDRESS:/supra/
323323
}
324324

@@ -341,6 +341,9 @@ download_snapshot() {
341341
# Copy snapshot into smr_database
342342
cp $SCRIPT_EXECUTION_LOCATION/snapshot/snapshot_*/store/* $SCRIPT_EXECUTION_LOCATION/rpc_store/
343343
cp $SCRIPT_EXECUTION_LOCATION/snapshot/snapshot_*/archive/* $SCRIPT_EXECUTION_LOCATION/rpc_archive/
344+
wget -O $SCRIPT_EXECUTION_LOCATION/genesis_blob.zip https://testnet-snapshot.supra.com/configs/genesis_blob.zip
345+
unzip $SCRIPT_EXECUTION_LOCATION/genesis_blob.zip -d $SCRIPT_EXECUTION_LOCATION/
346+
cp $SCRIPT_EXECUTION_LOCATION/genesis_blob/genesis.blob $SCRIPT_EXECUTION_LOCATION/
344347
}
345348

346349
start_rpc_node(){
@@ -358,7 +361,15 @@ EOF
358361
start_supra_container(){
359362
IP_ADDRESS=$(extract_ip "operator_rpc_config.toml")
360363
echo "Starting supra rpc container"
361-
docker start supra_rpc_$IP_ADDRESS
364+
if ! docker start supra_rpc_$IP_ADDRESS; then
365+
echo "Failed to start the container."
366+
else
367+
docker cp "$SCRIPT_EXECUTION_LOCATION/config.toml" supra_rpc_$ip_address:/supra/
368+
rm "$SCRIPT_EXECUTION_LOCATION/genesis_blob.zip"
369+
rm -rf "$SCRIPT_EXECUTION_LOCATION/genesis_blob"
370+
echo "Started the RPC Node container."
371+
fi
372+
362373
}
363374

364375
stop_supra_container(){

scripts/update_version_round_6_2.sh

-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,5 @@ fi
6161
echo "New Docker image created"
6262

6363
rm -rf $SCRIPT_EXECUTION_LOCATION/genesis.blob
64-
wget -o "$SCRIPT_EXECUTION_LOCATION/genesis.blob" https://testnet-snapshot.supra.com/configs/genesis.blob
6564
wget -O "$(pwd)/onboarding_round_6.sh" https://raw.githubusercontent.com/Entropy-Foundation/supra-nodeops-data/refs/heads/master/scripts/onboarding_round_6.sh
6665
chmod +x "$(pwd)/onboarding_round_6.sh"

scripts/update_version_round_6_rpc.sh

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ if ! docker run --name "supra_rpc_$ip_address" \
5656
fi
5757
echo "New Docker image created"
5858
rm -rf $SCRIPT_EXECUTION_LOCATION/genesis.blob
59-
# wget -o "$SCRIPT_EXECUTION_LOCATION/genesis.blob" https://testnet-snapshot.supra.com/configs/genesis.blob
60-
61-
docker cp "$SCRIPT_EXECUTION_LOCATION/config.toml" supra_rpc_$ip_address:/supra/
6259

6360
wget -O "$(pwd)/rpc_onboarding_round_6.sh" https://raw.githubusercontent.com/Entropy-Foundation/supra-nodeops-data/refs/heads/master/scripts/rpc_onboarding_round_6.sh
6461
chmod +x "$(pwd)/rpc_onboarding_round_6.sh"

0 commit comments

Comments
 (0)