Skip to content

Commit

Permalink
updates to dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
5u6r054 committed Jun 26, 2024
1 parent 5196f3f commit 4dfe434
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ services:
ports:
- "8093:8093"
depends_on:
validator:
condition: service_healthy
- subnet
networks:
- subtensor_network
environment:
Expand Down
24 changes: 24 additions & 0 deletions docker/miner/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ HOTKEY_PASSWORD=${HOTKEY_PASSWORD:-'default_hotkey_password'}
# Import the shared functions
source functions.sh

# Function to check if validator is ready
check_validator_ready() {
local max_attempts=180 # 15 minutes (180 * 5 seconds)
local attempt=0
while [ $attempt -lt $max_attempts ]; do
if curl -s http://validator_machine:8000/healthcheck | grep -q "OK"; then
return 0
fi
attempt=$((attempt+1))
echo "Validator not ready. Attempt $attempt of $max_attempts. Waiting 5 seconds..."
sleep 5
done
return 1
}

# Create and fund miner wallets
#
# Create a new coldkey with the specified password
Expand All @@ -31,6 +46,15 @@ while ! check_subnet_exists; do
done
echo "Subnet 1 has been created. Proceeding with registration."

# Wait for validator to be ready
echo "Waiting for validator to be ready..."
if check_validator_ready; then
echo "Validator is ready. Proceeding with miner registration."
else
echo "Validator did not become ready within the timeout period. Exiting."
exit 1
fi

# Attempt to register the validator and start it
if register_node miner; then
echo "Miner registration successful. Starting the miner..."
Expand Down

0 comments on commit 4dfe434

Please sign in to comment.