Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The default location of the config file is: `~/.bittensor/config.yml`. An exampl
network: local
use_cache: true
dashboard_path: null
disk_cache: false
disk_cache: true
rate_tolerance: null
safe_staking: true
wallet_hotkey: default
Expand Down
4 changes: 2 additions & 2 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def __init__(self):
"wallet_hotkey": None,
"network": None,
"use_cache": True,
"disk_cache": False,
"disk_cache": True,
"rate_tolerance": None,
"safe_staking": True,
"allow_partial_stake": False,
Expand Down Expand Up @@ -1431,7 +1431,7 @@ def initialize_chain(
"Verify this is intended.",
)
if not self.subtensor:
use_disk_cache = self.config.get("disk_cache", False)
use_disk_cache = self.config.get("disk_cache", True)
if network:
network_ = None
for item in network:
Expand Down
12 changes: 6 additions & 6 deletions bittensor_cli/src/bittensor/subtensor_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SubtensorInterface:
Thin layer for interacting with Substrate Interface. Mostly a collection of frequently-used calls.
"""

def __init__(self, network, use_disk_cache: bool = False):
def __init__(self, network, use_disk_cache: bool = True):
if network in Constants.network_map:
self.chain_endpoint = Constants.network_map[network]
self.network = network
Expand Down Expand Up @@ -114,7 +114,7 @@ def __init__(self, network, use_disk_cache: bool = False):
self.network = defaults.subtensor.network
substrate_class = (
DiskCachedAsyncSubstrateInterface
if (use_disk_cache or os.getenv("DISK_CACHE", "0") == "1")
if (use_disk_cache or os.getenv("DISK_CACHE", "1") == "1")
else AsyncSubstrateInterface
)
self.substrate = substrate_class(
Expand Down Expand Up @@ -443,11 +443,11 @@ async def get_total_stake_for_coldkey(

:return: {address: Balance objects}
"""
sub_stakes = await self.get_stake_for_coldkeys(
list(ss58_addresses), block_hash=block_hash
sub_stakes, dynamic_info = await asyncio.gather(
self.get_stake_for_coldkeys(list(ss58_addresses), block_hash=block_hash),
# Token pricing info
self.all_subnets(block_hash=block_hash),
)
# Token pricing info
dynamic_info = await self.all_subnets()

results = {}
for ss58, stake_info_list in sub_stakes.items():
Expand Down
6 changes: 4 additions & 2 deletions bittensor_cli/src/commands/wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ async def wallet_balance(
str(total_free_balance + total_staked_balance),
)
console.print(Padding(table, (0, 0, 0, 4)))
await subtensor.substrate.close()
if json_output:
output_balances = {
key: {
Expand Down Expand Up @@ -2188,7 +2187,10 @@ async def find_coldkey_swap_extrinsic(
):
console.print("Querying archive node for coldkey swap events...")
await subtensor.substrate.close()
subtensor = SubtensorInterface("archive")
subtensor.substrate.chain_endpoint = Constants.archive_entrypoint
subtensor.substrate.url = Constants.archive_entrypoint
subtensor.substrate.initialized = False
await subtensor.substrate.initialize()

block_hashes = await asyncio.gather(
*[
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
]
dependencies = [
"wheel",
"async-substrate-interface>=1.5.14",
"async-substrate-interface>=1.6.0",
"aiohttp~=3.13",
"backoff~=2.2.1",
"bittensor-drand>=1.2.0",
Expand Down