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

Added mechanism to sum all delegated tao #1547

Merged
merged 2 commits into from
Oct 17, 2023
Merged
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
3 changes: 3 additions & 0 deletions bittensor/commands/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def run(cli):
table.add_column("[overline white]VPERMIT", justify="right", no_wrap=True)
table.add_column("[overline white]24h/k\u03C4", style="green", justify="center")
table.add_column("[overline white]Desc", style="rgb(50,163,219)")
total_delegated = 0

for wallet in tqdm(wallets):
if not wallet.coldkeypub_file.exists_on_device():
Expand All @@ -544,6 +545,7 @@ def run(cli):
my_delegates[delegate[0].hotkey_ss58] = staked

delegates.sort(key=lambda delegate: delegate[0].total_stake, reverse=True)
total_delegated += sum(my_delegates.values())

registered_delegate_info: Optional[
DelegatesDetails
Expand Down Expand Up @@ -602,6 +604,7 @@ def run(cli):
)

bittensor.__console__.print(table)
bittensor.__console__.print("Total delegated Tao: {}".format(total_delegated))

@staticmethod
def add_args(parser: argparse.ArgumentParser):
Expand Down