Skip to content

Commit

Permalink
Merge pull request #1854 from opentensor/fix/roman/archive-4hr-block
Browse files Browse the repository at this point in the history
Small fix with receiving delegates based on a 4-hour archive block
  • Loading branch information
roman-opentensor committed May 8, 2024
2 parents 9950272 + add75e6 commit 1b4d4f5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bittensor/commands/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,10 @@ def run(cli: "bittensor.cli"):
List all delegates on the network.
"""
try:
cli.config.subtensor.network = "archive"
cli.config.subtensor.chain_endpoint = (
"wss://archive.chain.opentensor.ai:443"
)
subtensor: "bittensor.subtensor" = bittensor.subtensor(
config=cli.config, log_verbose=False
)
Expand All @@ -636,8 +640,6 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
r"""
List all delegates on the network.
"""
cli.config.subtensor.network = "archive"
cli.config.subtensor.chain_endpoint = "wss://archive.chain.opentensor.ai:443"
with bittensor.__console__.status(":satellite: Loading delegates..."):
delegates: list[bittensor.DelegateInfoLite] = subtensor.get_delegates_lite()

Expand Down Expand Up @@ -703,6 +705,10 @@ def run(cli: "bittensor.cli"):
List all delegates on the network.
"""
try:
cli.config.subtensor.network = "archive"
cli.config.subtensor.chain_endpoint = (
"wss://archive.chain.opentensor.ai:443"
)
subtensor: "bittensor.subtensor" = bittensor.subtensor(
config=cli.config, log_verbose=False
)
Expand All @@ -717,8 +723,6 @@ def _run(cli: "bittensor.cli", subtensor: "bittensor.subtensor"):
r"""
List all delegates on the network.
"""
cli.config.subtensor.network = "archive"
cli.config.subtensor.chain_endpoint = "wss://archive.chain.opentensor.ai:443"
with bittensor.__console__.status(":satellite: Loading delegates..."):
delegates: list[bittensor.DelegateInfo] = subtensor.get_delegates()

Expand Down

0 comments on commit 1b4d4f5

Please sign in to comment.