diff --git a/btqs/btqs_cli.py b/btqs/btqs_cli.py index a2ba7940d..90b47f2e9 100644 --- a/btqs/btqs_cli.py +++ b/btqs/btqs_cli.py @@ -89,6 +89,7 @@ def __init__(self): self.fast_blocks = True self.workspace_path = None self.subtensor_branch = None + self.skip_rust = None self.steps = [ { "title": "Start Local Subtensor", @@ -100,6 +101,7 @@ def __init__(self): branch=self.subtensor_branch, fast_blocks=self.fast_blocks, verbose=self.verbose, + skip_rust=self.skip_rust, ), }, { @@ -142,6 +144,9 @@ def start_chain( verbose: bool = typer.Option( False, "--verbose", "-v", help="Enable verbose output" ), + skip_rust: bool = typer.Option( + False, "--skip-rust", help="Skip Rust installation" + ), ): """ Starts the local Subtensor chain. @@ -187,6 +192,7 @@ def start_chain( branch, fast_blocks=fast_blocks, verbose=verbose, + skip_rust=skip_rust, ) def stop_chain(self): @@ -237,6 +243,9 @@ def run_all( verbose: bool = typer.Option( False, "--verbose", "-v", help="Enable verbose output" ), + skip_rust: bool = typer.Option( + False, "--skip-rust", help="Skip Rust installation" + ), ): """ Runs all commands in sequence to set up and start the local chain, subnet, and neurons. @@ -245,6 +254,7 @@ def run_all( self.workspace_path = workspace_path self.fast_blocks = fast_blocks self.verbose = verbose + self.skip_rust = skip_rust console.clear() print_info("Welcome to the Bittensor Quick Start Tutorial", emoji="🚀") diff --git a/btqs/commands/chain.py b/btqs/commands/chain.py index 0d7225d4c..68db90b62 100644 --- a/btqs/commands/chain.py +++ b/btqs/commands/chain.py @@ -1,3 +1,4 @@ +import sys import os import subprocess import time @@ -209,7 +210,7 @@ async def sudo_set_tempo( return await response.is_success -def start(config_data, workspace_path, branch, fast_blocks=True, verbose=False): +def start(config_data, workspace_path, branch, fast_blocks=True, verbose=False, skip_rust=False): os.makedirs(workspace_path, exist_ok=True) subtensor_path = os.path.join(workspace_path, "subtensor") @@ -250,11 +251,17 @@ def start(config_data, workspace_path, branch, fast_blocks=True, verbose=False): else: print_info("Fast blocks are Off", emoji="🐌 ") - venv_subtensor_path = os.path.join(workspace_path, "venv_subtensor") - venv_python = create_virtualenv(venv_subtensor_path) - install_subtensor_dependencies(verbose) - - config_data["venv_subtensor"] = venv_python + if skip_rust: + venv_python = sys.executable + print_info("Skipping Rust installation", emoji="🦘 ") + config_data["venv_subtensor"] = "None" + venv_subtensor_path = "None" + else: + venv_subtensor_path = os.path.join(workspace_path, "venv_subtensor") + venv_python = create_virtualenv(venv_subtensor_path) + install_subtensor_dependencies(verbose) + print_info("Virtual environment created and dependencies installed.", emoji="🐍 ") + config_data["venv_subtensor"] = venv_python # Running localnet.sh using the virtual environment's Python localnet_path = os.path.join(subtensor_path, "scripts", "localnet.sh") diff --git a/btqs/commands/subnet.py b/btqs/commands/subnet.py index 16d73a6f6..9de3ca862 100644 --- a/btqs/commands/subnet.py +++ b/btqs/commands/subnet.py @@ -149,12 +149,16 @@ def add_weights(config_data): hotkey=owner_data.get("hotkey"), ) print_info( - "Validator is now setting weights of subnet 1 on the root network.\n Please wait... (Timeout: 60 seconds)", + "Validator is now setting weights of subnet 1 on the root network.\n Please wait... (Timeout: ~ 120 seconds)", emoji="🏋️ ", ) - max_retries = 30 + max_retries = 60 attempt = 0 - retry_patterns = ["ancient birth block", "Transaction has a bad signature"] + retry_patterns = [ + "ancient birth block", + "Transaction has a bad signature", + "SettingWeightsTooFast", + ] while attempt < max_retries: try: