Skip to content

SDK (AsyncSubtensor) Part 1#2374

Merged
basfroman merged 28 commits intostagingfrom
feat/roman/async-subtensor-stage-one
Nov 4, 2024
Merged

SDK (AsyncSubtensor) Part 1#2374
basfroman merged 28 commits intostagingfrom
feat/roman/async-subtensor-stage-one

Conversation

@basfroman
Copy link
Collaborator

Included changes:

  • bittensor.core.async_subtensor.AsyncSubtensor class
  • updates settings, utils, etc
  • added bittensor.utils.delegates_details.DelegatesDetails
  • updated bittensor/core/chain_data
  • added bittensor/core/extrinsics/async_registration
  • added bittensor/core/extrinsics/async_root
  • added bittensor/core/extrinsics/async_transfer

All extrinsics added to AsyncSubtensor as methods

@basfroman basfroman requested a review from a team October 29, 2024 03:36
@basfroman basfroman marked this pull request as ready for review October 29, 2024 03:36
Copy link
Contributor

@thewhaleking thewhaleking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few initial change requests and questions. Most of the questions are more high-level so I want to make sure we're all on the same page first.

Comment on lines +516 to +519
with console.status(
f":satellite: Checking Account on [bold]subnet:{netuid}[/bold]...",
spinner="aesthetic",
) as status:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this stuff in the SDK?

Comment on lines +585 to +587
err_console.print(
f":white_heavy_check_mark: [green]Already registered on netuid:{netuid}[/green]"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these be do with btlogging?

Comment on lines +56 to +83
bt_err_console = Console(stderr=True)
bt_verbose_console = Console(quiet=True)


def print_console(message: str, colour: str, title: str, console: Console):
console.print(
f"[bold {colour}][{title}]:[/bold {colour}] [{colour}]{message}[/{colour}]\n"
)


def print_verbose(message: str, status=None):
"""Print verbose messages while temporarily pausing the status spinner."""
if status:
status.stop()
print_console(message, "green", "Verbose", bt_verbose_console)
status.start()
else:
print_console(message, "green", "Verbose", bt_verbose_console)


def print_error(message: str, status=None):
"""Print error messages while temporarily pausing the status spinner."""
if status:
status.stop()
print_console(message, "red", "Error", bt_err_console)
status.start()
else:
print_console(message, "red", "Error", bt_err_console)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense in an SDK?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some thought, I applied all the comments.

NOTE: Do not update the branch until the testnet is updated from devnet

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge after #2377 is merged

basfroman and others added 2 commits October 29, 2024 14:46
Co-authored-by: Benjamin Himes <37844818+thewhaleking@users.noreply.github.com>
@basfroman basfroman requested a review from a team November 1, 2024 09:07
Copy link
Contributor

@thewhaleking thewhaleking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending merge conflict

Roman added 5 commits November 4, 2024 09:24
…ubtensor-stage-one

# Conflicts:
#	bittensor/core/extrinsics/prometheus.py
…ubtensor-stage-one

# Conflicts:
#	bittensor/core/extrinsics/set_weights.py
#	bittensor/core/extrinsics/transfer.py
#	requirements/prod.txt
@basfroman basfroman merged commit 835dfdb into staging Nov 4, 2024
@basfroman basfroman deleted the feat/roman/async-subtensor-stage-one branch November 4, 2024 18:32
@basfroman basfroman mentioned this pull request Nov 5, 2024
@ibraheem-abe ibraheem-abe mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants