diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index f79ac72558..50851218a4 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -155,7 +155,7 @@ def __init__( retry_forever: bool = False, _mock: bool = False, archive_endpoints: Optional[list[str]] = None, - websocket_shutdown_timer: float = 5.0, + websocket_shutdown_timer: Optional[float] = 5.0, ): """Initializes an AsyncSubtensor instance for blockchain interaction. @@ -172,7 +172,9 @@ def __init__( cases where you are requesting a block that is too old for your current (presumably lite) node. Defaults to ``None``. websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to - close the connection. Defaults to ``5.0``. + close the connection. Passing `None` will disable to automatic shutdown process + entirely. + Returns: None diff --git a/bittensor/core/subtensor_api/__init__.py b/bittensor/core/subtensor_api/__init__.py index 5ae0bf7134..9806110a34 100644 --- a/bittensor/core/subtensor_api/__init__.py +++ b/bittensor/core/subtensor_api/__init__.py @@ -32,7 +32,8 @@ class SubtensorApi: archive_endpoints: Similar to fallback_endpoints, but specifically only archive nodes. Will be used in cases where you are requesting a block that is too old for your current (presumably lite) node. Defaults to `None` websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to close - the connection. Only applicable to AsyncSubtensor. + the connection. Only applicable to AsyncSubtensor. If `None` is passed to this, the automatic shutdown + process is disabled. Example: # sync version @@ -80,7 +81,7 @@ def __init__( log_verbose: bool = False, mock: bool = False, archive_endpoints: Optional[list[str]] = None, - websocket_shutdown_timer: float = 5.0, + websocket_shutdown_timer: Optional[float] = 5.0, ): self.network = network self._fallback_endpoints = fallback_endpoints diff --git a/pyproject.toml b/pyproject.toml index 88c4f68616..7732b25eb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "uvicorn", "bittensor-drand>=1.0.0,<2.0.0", "bittensor-wallet>=4.0.0,<5.0", - "async-substrate-interface>=1.5.4" + "async-substrate-interface>=1.5.6" ] [project.optional-dependencies]