Skip to content

Adds a factory function to create an initialised AsyncSubtensor object.#2516

Merged
thewhaleking merged 3 commits intostagingfrom
feat/thewhaleking/factory-fn-for-async-substrate
Dec 10, 2024
Merged

Adds a factory function to create an initialised AsyncSubtensor object.#2516
thewhaleking merged 3 commits intostagingfrom
feat/thewhaleking/factory-fn-for-async-substrate

Conversation

@thewhaleking
Copy link
Contributor

Factory function for creating an already-initialised AsyncSubtensor object. Meaning you can do

import bittensor as bt
subtensor = await bt.async_subtensor()
await subtensor.get_subnets(...

rather than the traditional

from bittensor.core.async_subtensor import AsyncSubtensor
subtensor = AsyncSubtensor()
async with subtensor:
    await subtensor.get_subnets(...

@thewhaleking thewhaleking requested review from a team and unconst December 5, 2024 17:41
@thewhaleking thewhaleking force-pushed the feat/thewhaleking/factory-fn-for-async-substrate branch from c4f6c47 to 6ce9b20 Compare December 6, 2024 11:21
@thewhaleking thewhaleking merged commit b3d027c into staging Dec 10, 2024
@thewhaleking thewhaleking deleted the feat/thewhaleking/factory-fn-for-async-substrate branch December 10, 2024 18:22
@ibraheem-abe ibraheem-abe mentioned this pull request Dec 13, 2024
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