From 7e2f316b43f84417bdbd56205e547a70caee8cd9 Mon Sep 17 00:00:00 2001 From: bradleytf <2593536+bradleytf@users.noreply.github.com> Date: Sat, 15 Jun 2024 10:10:12 -0600 Subject: [PATCH 1/2] add back BT_SUBTENSOR_CHAIN_ENDPOINT, moved to bittensor/__init__.py to reduce os imports --- bittensor/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bittensor/__init__.py b/bittensor/__init__.py index 7cb37ef0d0..52ef60c7f1 100644 --- a/bittensor/__init__.py +++ b/bittensor/__init__.py @@ -125,7 +125,10 @@ def debug(on: bool = True): # Needs to use wss:// __bellagene_entrypoint__ = "wss://parachain.opentensor.ai:443" -__local_entrypoint__ = "ws://127.0.0.1:9944" +if (BT_SUBTENSOR_CHAIN_ENDPOINT := os.getenv("BT_SUBTENSOR_CHAIN_ENDPOINT")) is not None: + __local_entrypoint__ = BT_SUBTENSOR_CHAIN_ENDPOINT +else: + __local_entrypoint__ = "ws://127.0.0.1:9944" __tao_symbol__: str = chr(0x03C4) From 09f29f7743ce388a301744d74442e6fd1a560ff6 Mon Sep 17 00:00:00 2001 From: bradleytf <2593536+bradleytf@users.noreply.github.com> Date: Sat, 15 Jun 2024 10:35:04 -0600 Subject: [PATCH 2/2] ruff format --- bittensor/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bittensor/__init__.py b/bittensor/__init__.py index 52ef60c7f1..fa196d7576 100644 --- a/bittensor/__init__.py +++ b/bittensor/__init__.py @@ -125,7 +125,9 @@ def debug(on: bool = True): # Needs to use wss:// __bellagene_entrypoint__ = "wss://parachain.opentensor.ai:443" -if (BT_SUBTENSOR_CHAIN_ENDPOINT := os.getenv("BT_SUBTENSOR_CHAIN_ENDPOINT")) is not None: +if ( + BT_SUBTENSOR_CHAIN_ENDPOINT := os.getenv("BT_SUBTENSOR_CHAIN_ENDPOINT") +) is not None: __local_entrypoint__ = BT_SUBTENSOR_CHAIN_ENDPOINT else: __local_entrypoint__ = "ws://127.0.0.1:9944"