-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsubmit_solution.sh
More file actions
executable file
·54 lines (44 loc) · 1.23 KB
/
submit_solution.sh
File metadata and controls
executable file
·54 lines (44 loc) · 1.23 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# submit_solution.sh - Example solution submission
# Check if .env file exists
if [ ! -f .env ]; then
echo "❌ Error: .env file not found!"
echo " Please create a .env file in the project root directory."
exit 1
fi
# Source .env file
source .env
# Check required environment variables
missing_vars=()
if [ -z "$WALLET_NAME" ]; then
missing_vars+=("WALLET_NAME")
fi
if [ -z "$MINER_HOTKEY" ]; then
missing_vars+=("MINER_HOTKEY")
fi
if [ -z "$CHALLENGE_API_URL" ]; then
missing_vars+=("CHALLENGE_API_URL")
fi
if [ -z "$FILE_TO_SUBMIT" ]; then
missing_vars+=("FILE_TO_SUBMIT")
fi
# Exit if any required variables are missing
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "❌ Error: Missing required environment variables in .env file:"
for var in "${missing_vars[@]}"; do
echo " - $var"
done
exit 1
fi
# Verify FILE_TO_SUBMIT exists
if [ ! -f "$FILE_TO_SUBMIT" ]; then
echo "❌ Error: Solution file not found: $FILE_TO_SUBMIT"
exit 1
fi
# All checks passed, proceed with submission
python python_scripts/miner_cli.py \
--wallet.name "$WALLET_NAME" \
--wallet.hotkey "$MINER_HOTKEY" \
--api_url "$CHALLENGE_API_URL" \
submit "$FILE_TO_SUBMIT" \
--check_status