Add back BT_SUBTENSOR_CHAIN_ENDPOINT env variable #2034
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add back referencing the BT_SUBTENSOR_CHAIN_ENDPOINT environment variable
Requirements for Adding, Changing, or Removing a Feature
Description of the Change
Add back the BT_SUBTENSOR_CHAIN_ENDPOINT reference, but moved to the
bittensor.__init__
, to align withos import
location and general direction of variable setting.This currently is set to if network is local, it will check first for the environment variable being present and using that, then fall back to the standard local network.
Enabling this will simplify using alternate networks that aren't opentensor's instance but don't necessitate local.
i.e. users can export their environment variable and all utilization of the bittensor network will default the alternate network.
Alternate Designs
Explored adding back to the original subtensor.py, but recent updates seems to prefer the network being defined in the bittensor object itself.
Also explored having an override on the finney network so there's no need to specify the network as local to use defined network.
But future switch to local with this enabled will make it easier for users to still access btcli even if they can't run a local subtensor.
Also considered potentially adding "remote" network type as another option and that leveraging environment variable or being set.
Open to updates and alignment with strategic direction,
Possible Drawbacks
subtensor.local
to be set at launch, could lead to most use still falling back to opentensor instanceVerification Process
Updated code, and ran standard commands using
btcli
without local flag set, and then again with local flag set.Imported bittensor into python project and checked object definitions to confirm accurate variable setting.
No impacts to use.
Release Notes