-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathentrypoint.sh
30 lines (24 loc) · 1.02 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -uex
echo "(THRESHOLD, NUMBER_OF_MEMBERS, DEGREE) = (${THRESHOLD}, ${NUMBER_OF_MEMBERS}, ${DEGREE})"
params_dir="kzg_params"
degree_output_file="$params_dir/params${DEGREE}"
# Check if the file already exists
if [ -f "$degree_output_file" ]; then
echo "File $degree_output_file already exists. Skipping download."
else
# If the file does not exist, proceed with the download
echo "File $degree_output_file does not exist. Downloading..."
# Use curl with error handling
if curl -f -o "$degree_output_file" "https://axiom-crypto.s3.amazonaws.com/challenge_0085/kzg_bn254_${DEGREE}.srs"; then
echo "Download completed."
else
echo "Download failed." >&2
exit 1
fi
fi
RUST_LOG=info THRESHOLD=$THRESHOLD NUMBER_OF_MEMBERS=$NUMBER_OF_MEMBERS DEGREE=$DEGREE /usr/local/bin/client setup --skip
# Touch a health check file to indicate readiness
touch "$params_dir/health_check_${THRESHOLD}_${NUMBER_OF_MEMBERS}_${DEGREE}"
# Execute the main command or default to shell
exec "$@"