diff --git a/cybertensor/chain_data.py b/cybertensor/chain_data.py index df9c58c..7105a80 100644 --- a/cybertensor/chain_data.py +++ b/cybertensor/chain_data.py @@ -578,6 +578,7 @@ class SubnetInfo: emission_value: float burn: Balance owner: str + metadata: str @classmethod def from_list_any(cls, list_any: List[Any]) -> Optional["SubnetInfo"]: @@ -613,6 +614,7 @@ def fix_decoded_values(cls, decoded: Dict) -> "SubnetInfo": emission_value=decoded["emission_values"], burn=Balance.from_boot(decoded["burn"]), owner=decoded["owner"], + metadata=decoded["metadata"], ) def to_parameter_dict(self) -> "torch.nn.ParameterDict": diff --git a/cybertensor/commands/delegates.py b/cybertensor/commands/delegates.py index 8c9d2d0..4087a61 100644 --- a/cybertensor/commands/delegates.py +++ b/cybertensor/commands/delegates.py @@ -207,7 +207,8 @@ def show_delegates( table.add_row( str(i), Text(delegate_name, style=f"link {delegate_url}"), - f"{delegate.hotkey:16.16}...", + f"{delegate.hotkey[:16]}...{delegate.hotkey[-8:]}", + # f"{delegate.hotkey}", str(len([nom for nom in delegate.nominators if nom[1].boot > 0])), f"{owner_stake!s:13.13}", f"{delegate.total_stake!s:13.13}", @@ -328,21 +329,15 @@ def check_config(config: "cybertensor.config"): # Get amount. if not config.get("amount") and not config.get("stake_all"): - if not Confirm.ask( - f"Stake all {cwtensor.giga_token_symbol} " - f"from account: [bold]'{config.wallet.get('name', defaults.wallet.name)}'[/bold]?" - ): - amount = Prompt.ask(f"Enter {cwtensor.giga_token_symbol} amount to stake") - try: - config.amount = float(amount) - except ValueError: - console.print( - f":cross_mark: [red]Invalid {cwtensor.giga_token_symbol} amount[/red] " - f"[bold white]{amount}[/bold white]" - ) - sys.exit() - else: - config.stake_all = True + amount = Prompt.ask(f"Enter {cwtensor.giga_token_symbol} amount to stake") + try: + config.amount = float(amount) + except ValueError: + console.print( + f":cross_mark: [red]Invalid {cwtensor.giga_token_symbol} amount[/red] " + f"[bold white]{amount}[/bold white]" + ) + sys.exit() class DelegateUnstakeCommand: @@ -450,21 +445,15 @@ def check_config(config: "cybertensor.config"): # Get amount. if not config.get("amount") and not config.get("unstake_all"): - if not Confirm.ask( - f"Unstake all {cwtensor.giga_token_symbol} " - f"to account: [bold]'{config.wallet.get('name', defaults.wallet.name)}'[/bold]?" - ): - amount = Prompt.ask(f"Enter {cwtensor.giga_token_symbol} amount to unstake") - try: - config.amount = float(amount) - except ValueError: - console.print( - f":cross_mark: [red]Invalid {cwtensor.giga_token_symbol} amount[/red] " - f"[bold white]{amount}[/bold white]" - ) - sys.exit() - else: - config.unstake_all = True + amount = Prompt.ask(f"Enter {cwtensor.giga_token_symbol} amount to unstake") + try: + config.amount = float(amount) + except ValueError: + console.print( + f":cross_mark: [red]Invalid {cwtensor.giga_token_symbol} amount[/red] " + f"[bold white]{amount}[/bold white]" + ) + sys.exit() class ListDelegatesCommand: @@ -671,9 +660,9 @@ class MyDelegatesCommand: --all flag can be specified to aggregate information across all wallets. Example usage: - >>> ctcli my_delegates - >>> ctcli my_delegates --all - >>> ctcli my_delegates --wallet.name my_wallet + >>> ctcli root my_delegates + >>> ctcli root my_delegates --all + >>> ctcli root my_delegates --wallet.name my_wallet Note: This function is typically called by the CLI parser and is not intended to be used @@ -795,7 +784,7 @@ def run(cli): table.add_row( wallet.name, Text(delegate_name, style=f"link {delegate_url}"), - f"{delegate[0].hotkey:16.16}...", + f"{delegate[0].hotkey[:16]}...{delegate[0].hotkey[-8:]}", f"{my_delegates[delegate[0].hotkey]!s:16.16}", f"{delegate[0].total_daily_return.gboot * (my_delegates[delegate[0].hotkey] / delegate[0].total_stake.gboot)!s:6.6}", str(len(delegate[0].nominators)), diff --git a/cybertensor/commands/metagraph.py b/cybertensor/commands/metagraph.py index a4583db..f56ad23 100644 --- a/cybertensor/commands/metagraph.py +++ b/cybertensor/commands/metagraph.py @@ -117,8 +117,8 @@ def run(cli): ep.ip + ":" + str(ep.port) if ep.is_serving else "[yellow]none[/yellow]", - ep.hotkey[:16], - ep.coldkey[:16] + f"{ep.hotkey[:14]}...{ep.hotkey[-6:]}", + f"{ep.coldkey[:14]}...{ep.coldkey[-6:]}" ] total_stake += metagraph.total_stake[uid] total_rank += metagraph.ranks[uid] diff --git a/cybertensor/commands/network.py b/cybertensor/commands/network.py index 733decc..ca93014 100644 --- a/cybertensor/commands/network.py +++ b/cybertensor/commands/network.py @@ -212,6 +212,7 @@ def run(cli): # TODO revisit # f"{delegate_info[subnet.owner_ss58].name if subnet.owner_ss58 in delegate_info else subnet.owner_ss58}", f"{delegate_info[subnet.owner].owner if subnet.owner in delegate_info else subnet.owner}", + f"{subnet.metadata}", ) ) table = Table( @@ -242,6 +243,7 @@ def run(cli): table.add_column("[overline white]BURN", style="white", justify="center") table.add_column("[overline white]POW", style="white", justify="center") table.add_column("[overline white]SUDO", style="white") + table.add_column("[overline white]METADATA", style="white") for row in rows: table.add_row(*row) cybertensor.__console__.print(table) diff --git a/cybertensor/commands/stake.py b/cybertensor/commands/stake.py index d6c9796..770f0fe 100644 --- a/cybertensor/commands/stake.py +++ b/cybertensor/commands/stake.py @@ -220,21 +220,15 @@ def check_config(cls, config: "cybertensor.config"): and not config.get("stake_all") and not config.get("max_stake") ): - if not Confirm.ask( - f"Stake all {cybertensor.__giga_boot_symbol__} " - f"from account: [bold]'{config.wallet.get('name', defaults.wallet.name)}'[/bold]?" - ): - amount = Prompt.ask(f"Enter {cybertensor.__giga_boot_symbol__} amount to stake") - try: - config.amount = float(amount) - except ValueError: - console.print( - f":cross_mark:[red]Invalid {cybertensor.__giga_boot_symbol__} amount[/red] " - f"[bold white]{amount}[/bold white]" - ) - sys.exit() - else: - config.stake_all = True + amount = Prompt.ask(f"Enter {cybertensor.__giga_boot_symbol__} amount to stake") + try: + config.amount = float(amount) + except ValueError: + console.print( + f":cross_mark:[red]Invalid {cybertensor.__giga_boot_symbol__} amount[/red] " + f"[bold white]{amount}[/bold white]" + ) + sys.exit() @classmethod def add_args(cls, parser: argparse.ArgumentParser): diff --git a/docs/basic-flow.md b/docs/basic-flow.md index 6839b31..7c2de0d 100644 --- a/docs/basic-flow.md +++ b/docs/basic-flow.md @@ -16,17 +16,20 @@ You can list all the local wallets stored directly with: ```bash ctcli wallet list ``` +You need to fund your wallet's addresses with tokens to perform operations on the network. Ask friends or team to send your some tokens. You can send tokens from your existing account to addresses of your wallets. +You need to fund both of your addresses (hot and cold) of your wallet. Fund your hotkey with some small amount to pay for gas and fund your coldkey with the rest of the tokens to pay for gas and general network operations. Get a detailed report of your wallet pairs (coldkey, hotkey). This report includes balance and staking information for both the coldkey and hotkey associated with the wallet. ```bash ctcli wallet inspect ``` + ### Root network register Make registration to the root network. Validators on the root network cast weights to subnets, voting to tokens distribution across subnets in the network. Total consensus weighted distribution to subnets calculated based on validators' stake and their assigned weights to subnets. The network continuously distributes tokens to subnets and these tokens are distributed to subnets operators and validators. All operators and validators of root network and subnets should continuously cast weights. Both root network and subnets have operators and validators. Validators are given a subset of the operators of the root network and subnets with a top-k stake. Only weights of validators are used for consensus algorithm calculation. Join the root network to participate in token distribution across subnets. Register to the root network to participate in the distribution process of tokens across subnets: ```bash -- ctcli root register +ctcli root register ``` ### Subnet network register @@ -84,12 +87,12 @@ Let's set the weight on the subnet network. This weight represents your subjecti Get a list of operators and weights assigned to each operator within the root network to each other: ```bash -ctcli subnet weights +ctcli subnet get_weights ``` Set weights to different operators within the subnet: ```bash -- ctcli subnet weights --uids 0,1,2,3 --weights 0.25,0.25,0.25,0.25 +ctcli subnet weights --uids 0,1,2,3 --weights 0.25,0.25,0.25,0.25 ``` ### Delegate stake