Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back BT_SUBTENSOR_CHAIN_ENDPOINT env variable #2034

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

bradleytf
Copy link
Contributor

@bradleytf bradleytf commented Jun 15, 2024

Add back referencing the BT_SUBTENSOR_CHAIN_ENDPOINT environment variable

Requirements for Adding, Changing, or Removing a Feature

  • Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • The pull request must contribute a change that has been endorsed by the maintainer team. See details in the template below.
  • The pull request must update the test suite to exercise the updated functionality.
  • After you create the pull request, all status checks must be pass before a maintainer reviews your contribution.

Description of the Change

Add back the BT_SUBTENSOR_CHAIN_ENDPOINT reference, but moved to the bittensor.__init__, to align with os 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

  • Requires subtensor.local to be set at launch, could lead to most use still falling back to opentensor instance
  • Not super verbose on which network you're using, in case users may not remember having set the variable

Verification 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

  • Add back BT_SUBTENSOR_CHAIN_ENDPOINT environment variable read when launching local network

@bradleytf bradleytf changed the base branch from master to staging June 15, 2024 16:30
@gus-opentensor gus-opentensor merged commit 183b736 into opentensor:staging Jun 25, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants