Bittensor CLI
Command line interface (CLI) for Bittensor. Uses the values in the configuration file. These values can be overriden by passing them explicitly in the command line.
Allowed networks
In any btcli
command, the --network
flag accepts the following values: finney
, test
, local
, and subvortex
. If no value is specified, the default network is finney
.
Usage:
$ btcli [OPTIONS] COMMAND [ARGS]
Options:
--version
--install-completion
: Install completion for the current shell.--show-completion
: Show completion for the current shell, to copy it or customize the installation.--help
: Show this message and exit.
Commands:
config
: Config commands, aliases:c
,conf
.root
: Root commands, alias:r
.stake
: Stake commands, alias:st
.subnet
: Subnet commands, alias:s
,subnets
.sudo
: Sudo commands, alias:su
.wallet
: Wallet commands, aliases:w
,wallets
.weights
: Weights commands, aliases:wt
,weight
.
Config
btcli config
Example config file
You can set the commonly used values, such as your hotkey and coldkey names, the default chain URL or the network name you use, and more, in config.yml
. You can override these values by explicitly passing them in the command line for any btcli
command.
The default location of the config file is: ~/.bittensor/config.yml
. An example of a config.yml
is shown below:
chain: ws://127.0.0.1:9945
network: local
no_cache: False
wallet_hotkey: hotkey-user1
wallet_name: coldkey-user1
wallet_path: ~/.bittensor/wallets
metagraph_cols:
ACTIVE: true
AXON: true
COLDKEY: true
CONSENSUS: true
DIVIDENDS: true
EMISSION: true
HOTKEY: true
INCENTIVE: true
RANK: true
STAKE: true
TRUST: true
UID: true
UPDATED: true
VAL: true
VTRUST: true
If both chain
and network
config values are present in the config.yml
, then chain
has the higher precedence. The the btcli
command uses the chain
value.
Usage:
$ btcli config [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
clear
: Setting the flags in this command will clear those items from your config file.get
: Prints the current config file in a table. The default location of your config file is~/.bittensor/config.yml
.metagraph
: Interactive module to update the config for which columns to display in the metagraph output.set
: Sets the values in the config file.
btcli config clear
Setting the flags in this command will clear those items from your config file.
Examples
- To clear the chain and network:
btcli config clear --chain --network
- To clear your config entirely:
btcli config clear --all
Options:
--wallet-name, --name, --wallet_name, --wallet.name
-p, --wallet-path, --wallet_path, --wallet.path
-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey
--network, --subtensor.network
--chain, --subtensor.chain_endpoint
--no-cache, --no_cache
--all
--help
: Show this message and exit.
btcli config get
Prints the current config file in a table
Usage:
$ btcli config get [OPTIONS]
Options:
--help
: Show this message and exit.
btcli config metagraph
Interactive module to update the config for which columns to display in the metagraph output.
Usage:
$ btcli config metagraph [OPTIONS]
Options:
--reset
: Restore the config for metagraph columns to its default setting (all enabled).--help
: Show this message and exit.
btcli config set
Sets values in config file
Usage:
$ btcli config set [OPTIONS]
Options:
--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet.-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--cache, --cache / --no-cache, --no_cache
: Disable caching of certain commands. This will disable the--reuse-last
andhtml
flags on commands such assubnets metagraph
,stake show
andsubnets list
. [default: no-cache].--help
: Show this message and exit.
If both chain
and network
config values are present in the config.yml
, then chain
has the higher precedence. The the btcli
command uses the chain
value.
Root
btcli root
Usage:
$ btcli root [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
boost
: Boost the weights for a specific subnet within the root network on the Bittensor network.delegate-stake
ordelegate_stake
: Stakes TAO to a specified delegate.get-weights
orget_weights
: Retrieve the weights set for the root network.list
: Display the members of the root network.list-delegates
orlist_delegates
: Displays a table of Bittensor network delegates.my-delegates
ormy_delegates
: Displays a table of delegated stakes from a user's wallet(s) to various delegates.nominate
: Facilitates a wallet to become a delegate.proposals
: View active proposals for the senate.register
: Register a neuron by recycling some TAO.senate
: View the members of Bittensor's governance protocol, known as the Senate.senate-vote
orsenate_vote
: Cast a vote on an active proposal in the Senate.set-take
orset_take
: Allows users to change their delegate take.set-weights
orset_weights
: Set the weights for the root network on the...slash
: Decrease the weights for a specific subnet.undelegate-stake
orundelegate_stake
: Allows users to withdraw their staked TAO.
btcli root boost
Boost the weights for a specific subnet within the root network on the Bittensor network. The command allows boosting the weights for different subnets within the root network.
Example
btcli root boost --netuid 1 --increase 0.01
Usage:
$ btcli root boost [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet.-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.--netuid INTEGER
: The netuid (network unique identifier) of the subnet within the root network, (e.g. 1).-a, --amount, --increase FLOAT
: Amount (float) to boost, (e.g. 0.01). Any amount provided will be added to the subnet's existing weight.--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt].--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root delegate-stake
Stakes TAO to a specified delegate on the Bittensor network.
This action allocates the user's TAO to support a delegate, potentially earning staking rewards in return.
The command interacts with the user to determine the delegate and the amount of TAO to be staked. If the
--all
flag is used, it delegates the entire available balance.
The user must specify the delegate's SS58 address and the amount of TAO to stake. The function sends a
transaction to the subtensor network to delegate the specified amount to the chosen delegate. These values are
prompted if not provided. You can list all delegates with btcli root list-delegates
.
Examples
btcli delegate-stake --delegate_ss58key <SS58_ADDRESS> --amount <AMOUNT>
btcli delegate-stake --delegate_ss58key <SS58_ADDRESS> --all
This command modifies the blockchain state and may incur transaction fees. It requires user confirmation and interaction, and is designed to be used within the Bittensor CLI environment. The user should ensure the delegate's address and the amount to be staked are correct before executing the command.
Usage:
$ btcli root delegate-stake [OPTIONS]
Options:
--delegate-ss58key TEXT
: TheSS58
address of the delegate to stake to.--amount FLOAT
: The amount of TAO to stake. Do no specify if using--all
.-a, --all
: If specified, the command stakes all available TAO. Do not specify if using--amount
.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet.-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt].--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root get-weights
Retrieve the weights set for the root network on the Bittensor network. This command provides visibility into how network responsibilities and rewards are distributed among various subnets.
The command outputs a table listing the weights assigned to each subnet within the root network. This information is crucial for understanding the current influence and reward distribution among the subnets.
Example
btcli root get-weights
This command is essential for users interested in the governance and operational dynamics of the Bittensor network. It offers transparency into how network rewards and responsibilities are allocated across different subnets.
Usage:
$ btcli root get-weights [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--limit-min-col, --min INTEGER
: Limit left display of the table to this column.--limit-max-col, --max INTEGER
: Limit right display of the table to this column.--reuse-last
: Reuse the metagraph data you last retrieved. Only use this if you have already retrieved metagraphdata--html
: Display the table as HTML in the browser, rather than in the Terminal.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root list
Display the members of the root network (Netuid = 0) on the Bittensor network.
This command provides an overview of the neurons that constitute the network's foundational layer.
Upon execution, the command fetches and lists the neurons in the root network, showing their unique identifiers (UIDs), names, addresses, stakes, and whether they are part of the senate (network governance body).
Example
btcli root list
This command is useful for users interested in understanding the composition and governance structure of the Bittensor network's root layer. It provides insights into which neurons hold significant influence and responsibility within the network.
Usage:
$ btcli root list [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root list-delegates
Displays a table of Bittensor network delegates, providing a comprehensive overview of delegate statistics and information.
This table helps users make informed decisions on which delegates to allocate their TAO stake.
The table columns include:
-
INDEX: The delegate's index in the sorted list.
-
DELEGATE: The name of the delegate.
-
SS58: The delegate's unique SS58 address (truncated for display).
-
NOMINATORS: The count of nominators backing the delegate.
-
OWNER STAKE(τ): The amount of delegate's own stake (not the TAO delegated from any nominators).
-
TOTAL STAKE(τ): The delegate's cumulative stake, including self-staked and nominators' stakes.
-
CHANGE/(4h): The percentage change in the delegate's stake over the last four hours.
-
SUBNETS: The subnets to which the delegate is registered.
-
VPERMIT: Indicates the subnets for which the delegate has validator permits.
-
NOMINATOR/(24h)/kτ: The earnings per 1000 τ staked by nominators in the last 24 hours.
-
DELEGATE/(24h): The total earnings of the delegate in the last 24 hours.
-
DESCRIPTION: A brief description of the delegate's purpose and operations.
Sorting is done based on the TOTAL STAKE
column in descending order. Changes in stake are highlighted:
increases in green and decreases in red. Entries with no previous data are marked with NA
. Each delegate's
name is a hyperlink to their respective URL, if available.
Examples
btcli root list-delegates
btcli root list-delegates --wallet-name <my_wallet>
btcli root list-delegates --subtensor.network finney # can also be `test` or `local`
This function is part of the Bittensor CLI tools and is intended for use within a console application. It prints directly to the console and does not return any value.
Usage:
$ btcli root list-delegates [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root my-delegates
Retrieves and displays a table of delegated stakes from a user's wallet(s) to various delegates.
The command provides detailed insights into the user's staking activities and the performance of their chosen delegates.
The table output includes the following columns:
-
Wallet: The name of the user's wallet.
-
OWNER: The name of the delegate's owner.
-
SS58: The truncated SS58 address of the delegate.
-
Delegation: The amount of TAO staked by the user to the delegate.
-
τ/24h: The earnings from the delegate to the user over the past 24 hours.
-
NOMS: The number of nominators for the delegate.
-
OWNER STAKE(τ): The stake amount owned by the delegate.
-
TOTAL STAKE(τ): The total stake amount held by the delegate.
-
SUBNETS: The list of subnets the delegate is a part of.
-
VPERMIT: Validator permits held by the delegate for various subnets.
-
24h/kτ: Earnings per 1000 TAO staked over the last 24 hours.
-
Desc: A description of the delegate.
The command also sums and prints the total amount of TAO delegated across all wallets.
The command can be run as part of the Bittensor CLI suite of tools and requires no parameters if a single wallet
is used. If multiple wallets are present, the --all
flag can be specified to aggregate information across
all wallets.
Examples
btcli root my-delegates
btcli root my-delegates --all
btcli root my-delegates --wallet-name <my_wallet>
This function is typically called by the CLI parser and is not intended to be used directly in user code.
Usage:
$ btcli root my-delegates [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet-a, --all-wallets, --all
: If specified, the command aggregates information across all wallets.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root nominate
Facilitates a wallet to become a delegate on the Bittensor network.
This command handles the nomination process, including wallet unlocking and verification of the hotkey's current delegate status.
The command performs several checks:
-
Verifies that the hotkey is not already a delegate to prevent redundant nominations.
-
Tries to nominate the wallet and reports success or failure.
Upon success, the wallet's hotkey is registered as a delegate on the network.
To run the command, the user must have a configured wallet with both hotkey and coldkey. If the wallet is not already nominated, this command will initiate the process.
Examples
btcli root nominate
btcli root nominate --wallet-name <my_wallet> --wallet-hotkey <my_hotkey>
This function is intended to be used as a CLI command. It prints the outcome directly to the console and does not return any value. It should not be called programmatically in user code due to its interactive nature and side effects on the network state.
Usage:
$ btcli root nominate [OPTIONS]
Options:
--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root proposals
View active proposals for the senate within Bittensor's governance protocol.
This command displays the details of ongoing proposals, including votes, thresholds, and proposal data.
The command lists all active proposals, showing their hash, voting threshold, number of ayes and nays, detailed votes by address, end block number, and call data associated with each proposal.
Example
btcli root proposals
This command is essential for users who are actively participating in or monitoring the governance of the Bittensor network. It provides a detailed view of the proposals being considered, along with the community's response to each.
Usage:
$ btcli root proposals [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root register
Register a neuron on the Bittensor network by recycling some TAO (the network's native token).
This command is used to add a new neuron to a specified subnet within the network, contributing to the decentralization and robustness of Bittensor.
Before registering, the command checks if the specified subnet exists and whether the user's balance is sufficient to cover the registration cost.
The registration cost is determined by the current recycle amount for the specified subnet. If the balance is insufficient or the subnet does not exist, the command will exit with an appropriate error message.
If the preconditions are met, and the user confirms the transaction (if no_prompt
is not set), the command
proceeds to register the neuron by recycling the required amount of TAO.
The command structure includes:
-
Verification of subnet existence.
-
Checking the user's balance against the current recycle amount for the subnet.
-
User confirmation prompt for proceeding with registration.
-
Execution of the registration process.
Columns Displayed in the confirmation prompt:
-
Balance: The current balance of the user's wallet in TAO.
-
Cost to Register: The required amount of TAO needed to register on the specified subnet.
Example
btcli subnets register --netuid 1
This command is critical for users who wish to contribute a new neuron to the network. It requires careful consideration of the subnet selection and an understanding of the registration costs. Users should ensure their wallet is sufficiently funded before attempting to register a neuron.
Usage:
$ btcli root register [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root senate
View the members of Bittensor's governance protocol, known as the Senate.
This command lists the delegates involved in the decision-making process of the Bittensor network.
The command retrieves and displays a list of Senate members, showing their names and wallet addresses. This information is crucial for understanding who holds governance roles within the network.
Example
btcli root senate
This command is particularly useful for users interested in the governance structure and participants of the Bittensor network. It provides transparency into the network's decision-making body.
Usage:
$ btcli root senate [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root senate-vote
Cast a vote on an active proposal in Bittensor's governance protocol.
This command is used by Senate members to vote on various proposals that shape the network's future.
The user needs to specify the hash of the proposal they want to vote on. The command then allows the Senate member to cast a 'Yes' or 'No' vote, contributing to the decision-making process.
Example
btcli root senate-vote --proposal <proposal_hash>
This command is crucial for Senate members to exercise their voting rights on key proposals. It plays a vital role in the governance and evolution of the Bittensor network.
Usage:
$ btcli root senate-vote [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--proposal, --proposal-hash TEXT
: The hash of the proposal to vote on.--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root set-take
Allows users to change their delegate take.
The command performs several checks:
- Hotkey is already a delegate.
- New take value is within 9%-18% range
To run the command, the user must have a configured wallet with both hotkey and coldkey. Also, the hotkey should already be a delegate.
Example
btcli root set-take --wallet-name <my_wallet> --wallet-hotkey <my_hotkey>
This function can be used to update the takes individually for every subnet. Default take
value is 0.18 (18%).
Usage:
$ btcli root set-take [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--take FLOAT
: The new take value.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root set-weights
Set the weights for the oot network on the Bittensor network.
This command is used by network senators to influence the distribution of network rewards and responsibilities.
The command allows setting weights for different subnets within the root network. Users need to specify the netuids (network unique identifiers) and corresponding weights they wish to assign.
Example
btcli root set-weights -w 0.3,0.3,0.4 -n 1,2,3 --chain ws://127.0.0.1:9945
This command is particularly important for network senators and requires a comprehensive understanding of the network's dynamics. It is a powerful tool that directly impacts the network's operational mechanics and reward distribution.
Usage:
$ btcli root set-weights [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet-n, --netuids INTEGER
: Set the netuid(s) to filter by. Separate multiple netuids with a comma, for example:-n 0,1,2
. [default: None]-w, --weights FLOAT
: Weights for the specified UIDs, e.g.-w 0.2,0.4,0.1 ...
Must correspond to the order of the UIDs. [default: None]`--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root slash
Decrease the weights for a specific subnet within the root network on the Bittensor network.
The command allows slashing (decreasing) the weights for different subnets within the root network.
Example
btcli root slash --netuid 1 --decrease 0.01
Output:
Enter netuid (e.g. 1): 1
Enter decrease amount (e.g. 0.01): 0.2
Slashing weight for subnet: 1 by amount: 0.2
Usage:
$ btcli root slash [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--netuid INTEGER
: The netuid (network unique identifier) of the subnet within the root network, (e.g. 1)-a, --amount, --decrease FLOAT
: Amount (float) to boost, (e.g. 0.01)--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli root undelegate-stake
Allows users to withdraw their staked TAO from a delegate on the Bittensor network.
This process is known as "undelegating" and it reverses the delegation process, freeing up the staked tokens.
The command prompts the user for the amount of TAO to undelegate and the SS58
address of the delegate from
which to undelegate. If the --all
flag is used, it will attempt to undelegate the entire staked amount from
the specified delegate.
The user must provide the delegate's SS58 address and the amount of TAO to undelegate. The function will then send a transaction to the Bittensor network to process the undelegation.
Examples
btcli undelegate --delegate_ss58key <SS58_ADDRESS> --amount <AMOUNT>
btcli undelegate --delegate_ss58key <SS58_ADDRESS> --all
This command can result in a change to the blockchain state and may incur transaction fees. It is interactive and requires confirmation from the user before proceeding. It should be used with care as undelegating can affect the delegate's total stake and potentially the user's staking rewards.
Usage:
$ btcli root undelegate-stake [OPTIONS]
Options:
--delegate-ss58key TEXT
: TheSS58
address of the delegate to undelegate from.--amount FLOAT
: The amount of TAO to unstake. Do no specify if using--all
-a, --all
: If specified, the command undelegates all staked TAO from the delegate. Do not specify if using--amount
--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
Stake
btcli stake
Usage:
$ btcli stake [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
add
: Stake TAO tokens to one or more hotkeys from a user's coldkey on the Bittensor network.child
: Child Hotkey commands, alias:children
.remove
: Unstake TAO tokens from one or more hotkeys and transfer them back to the user's coldkey.show
: List all stake accounts associated with a user's wallet on the Bittensor network.
btcli stake add
Stake TAO tokens to one or more hotkeys from a user's coldkey on the Bittensor network.
This command is used to allocate tokens to different hotkeys, securing their position and influence on the network.
Users can specify the amount to stake, the hotkeys to stake to (either by name or SS58
address), and whether
to stake to all hotkeys. The command checks for sufficient balance and hotkey registration before proceeding
with the staking process.
The command prompts for confirmation before executing the staking operation.
Example
btcli stake add --amount 100 --wallet-name <my_wallet> --wallet-hotkey <my_hotkey>
This command is critical for users who wish to distribute their stakes among different neurons (hotkeys) on the network. It allows for a strategic allocation of tokens to enhance network participation and influence.
Usage:
$ btcli stake add [OPTIONS]
Options:
-a, --all-tokens, --all
: When set, stakes all available tokens from the coldkey.--amount FLOAT
: The amount of TAO tokens to stake [default: 0.0].-m, --max-stake FLOAT
: Sets the maximum amount of TAO to have staked in each hotkey. [default: 0.0].--hotkey-ss58-address TEXT
: The SS58 address of the hotkey to stake to.-in, --include-hotkeys, --hotkey-ss58-address TEXT
: Specifies hotkeys by name or ss58 address to stake to. For example, `-in hk1,hk2``.-ex, --exclude-hotkeys, --hotkey-ss58-address TEXT
: Specifies hotkeys by name or ss58 address to not to stake to (use this option only with--all-hotkeys
) i.e.--all-hotkeys -ex hk3,hk4
--all-hotkeys / --no-all-hotkeys
: When set, stakes to all hotkeys associated with the wallet. Do not use if specifying hotkeys in--include-hotkeys
. [default: no-all-hotkeys].--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt].--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli stake child
Usage:
$ btcli stake child [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
get
: Get all child hotkeys on a specified...revoke
: Remove all children hotkeys on a specified...set
: Add children hotkeys on a specified subnet...take
: Get and set your childkey take on a...
btcli stake child get
Get all child hotkeys on a specified subnet on the Bittensor network.
This command is used to view delegated authority to different hotkeys on the subnet.
Users can specify the subnet and see the children and the proportion that is given to them.
The command compiles a table showing:
- ChildHotkey: The hotkey associated with the child.
- ParentHotKey: The hotkey associated with the parent.
- Proportion: The proportion that is assigned to them.
- Expiration: The expiration of the hotkey.
Examples
btcli stake child get --netuid 1
btcli stake child get --all-netuids
This command is for users who wish to see child hotkeys among different neurons (hotkeys) on the network.
Usage:
$ btcli stake child get [OPTIONS]
Options:
--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--netuid INTEGER
: The netuid (network unique identifier) of the subnet within the root network, (e.g. 1)--all-netuids, --all, --allnetuids
: When set, gets children from all subnets on the bittensor network.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli stake child revoke
Remove all children hotkeys on a specified subnet on the Bittensor network.
This command is used to remove delegated authority from all child hotkeys, removing their position and influence on the subnet.
Users need to specify the parent hotkey and the subnet ID (netuid). The user needs to have sufficient authority to make this call.
The command prompts for confirmation before executing the revoke_children operation.
Example
btcli stake child revoke --hotkey <parent_hotkey> --netuid 1
This command is critical for users who wish to remove children hotkeys on the network. It allows for a complete removal of delegated authority to enhance network participation and influence.
Usage:
$ btcli stake child revoke [OPTIONS]
Options:
--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--netuid INTEGER
: The netuid (network unique identifier) of the subnet within the root network, (e.g. 1)--all-netuids, --all, --allnetuids
: When this flag is used it sets children on all subnets on the bittensor network.--wait-for-inclusion / --no-wait-for-inclusion
: If set, waits until the transaction is included in a block. [default: wait-for-inclusion]--wait-for-finalization / --no-wait-for-finalization
: If set, waits until the transaction is finalized on the blockchain. [default: wait-for-finalization]--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli stake child set
Add children hotkeys on a specified subnet on the Bittensor network.
This command is used to delegate authority to different hotkeys, securing their position and influence on the subnet.
Users can specify the amount or 'proportion' to delegate to child hotkeys (SS58
address),
the user needs to have sufficient authority to make this call, and the sum of proportions cannot be greater
than 1.
The command prompts for confirmation before executing the set_children operation.
Example
btcli stake child set --children <child_ss58> --children <child_ss58> --hotkey <parent_hotkey> --netuid 1 --prop 0.3 --prop 0.3
This command is critical for users who wish to delegate children hotkeys among different neurons (hotkeys) on the network. It allows for a strategic allocation of authority to enhance network participation and influence.
Usage:
$ btcli stake child set [OPTIONS]
Options:
-c, --children TEXT
: Enter children hotkeys (ss58).--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--netuid INTEGER
: The netuid (network unique identifier) of the subnet within the root network, (e.g. 1).--all-netuids, --all, --allnetuids
: When this flag is used it sets children on all subnets on the bittensor network.-p, --proportions, --prop FLOAT
: Enter proportions for children as (sum less than 1).--wait-for-inclusion / --no-wait-for-inclusion
: If set, waits until the transaction is included in a block. [default: wait-for-inclusion].--wait-for-finalization / --no-wait-for-finalization
: If set, waits until the transaction is finalized on the blockchain. [default: wait-for-finalization].--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli stake child take
Get and set your childkey take on a specified subnet on the Bittensor network.
This command is used to set the take on your child hotkeys with limits between 0 - 18%.
Users need to specify their child hotkey and the subnet ID (netuid).
The command prompts for confirmation before setting the childkey take.
Examples
btcli stake child take --hotkey <child_hotkey> --netuid 1
btcli stake child take --hotkey <child_hotkey> --take 0.12 --netuid 1
This command is critical for users who wish to modify their child hotkey take on the network.
Usage:
$ btcli stake child take [OPTIONS]
Options:
--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--netuid INTEGER
: The netuid (network unique identifier) of the subnet within the root network, (e.g. 1).--all-netuids, --all, --allnetuids
: When this flag is used it sets children on all subnets on the bittensor network.-t, --take FLOAT
: Enter take for your child hotkey.--wait-for-inclusion / --no-wait-for-inclusion
: If set, waits until the transaction is included in a block. [default: wait-for-inclusion].--wait-for-finalization / --no-wait-for-finalization
: If set, waits until the transaction is finalized on the blockchain. [default: wait-for-finalization].--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt].--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli stake remove
Unstake TAO tokens from one or more hotkeys and transfer them back to the user's coldkey.
This command is used to withdraw tokens previously staked to different hotkeys.
Users can specify the amount to unstake, the hotkeys to unstake from (either by name or SS58
address), and
whether to unstake from all hotkeys. The command checks for sufficient stake and prompts for confirmation before
proceeding with the unstaking process.
The command prompts for confirmation before executing the unstaking operation.
Example
btcli stake remove --amount 100 -in hk1,hk2
This command is important for users who wish to reallocate their stakes or withdraw them from the network. It allows for flexible management of token stakes across different neurons (hotkeys) on the network.
Usage:
$ btcli stake remove [OPTIONS]
Options:
--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet--unstake-all, --all
: When set, unstakes all staked tokens from the specified hotkeys.-a, --amount FLOAT
: The amount of TAO tokens to unstake. [default: 0.0]--hotkey-ss58-address TEXT
: The SS58 address of the hotkey to unstake from.--max-stake, --max FLOAT
: Sets the maximum amount of TAO to remain staked in each hotkey. [default: 0.0]-in, --include-hotkeys, --hotkey-ss58-address TEXT
: Specifies hotkeys by name or ss58 address to stake to. For example, `-in hk1,hk2``.-ex, --exclude-hotkeys, --hotkey-ss58-address TEXT
: Specifies hotkeys by name or ss58 address to not to stake to (use this option only with--all-hotkeys
) i.e.--all-hotkeys -ex hk3,hk4
--all-hotkeys / --no-all-hotkeys
: When set, unstakes from all hotkeys associated with the wallet. Do not use if specifying hotkeys in--include-hotkeys
. [default: no-all-hotkeys]--prompt / --no-prompt
: Enable or disable interactive prompts. [default: prompt].--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.
btcli stake show
List all stake accounts associated with a user's wallet on the Bittensor network.
This command provides a comprehensive view of the stakes associated with both hotkeys and delegates linked to the user's coldkey.
The command lists all stake accounts for a specified wallet or all wallets in the user's configuration directory. It displays the coldkey, balance, account details (hotkey/delegate name), stake amount, and the rate of return.
The command compiles a table showing:
-
Coldkey: The coldkey associated with the wallet.
-
Balance: The balance of the coldkey.
-
Account: The name of the hotkey or delegate.
-
Stake: The amount of TAO staked to the hotkey or delegate.
-
Rate: The rate of return on the stake, typically shown in TAO per day.
Example
btcli stake show --all
This command is essential for users who wish to monitor their stake distribution and returns across various accounts on the Bittensor network. It provides a clear and detailed overview of the user's staking activities.
Usage:
$ btcli stake show [OPTIONS]
Options:
-a, --all, --all-wallets
: When set, the command checks all coldkey wallets instead of just the specified wallet.--network, --subtensor.network TEXT
: The subtensor network to connect to. Default: finney.--chain, --subtensor.chain_endpoint TEXT
: The subtensor chain endpoint to connect to.--wallet-name, --name, --wallet_name, --wallet.name TEXT
: Name of wallet-H, --hotkey, --wallet_hotkey, --wallet-hotkey, --wallet.hotkey TEXT
: Hotkey of wallet.-p, --wallet-path, --wallet_path, --wallet.path TEXT
: Filepath of root of wallets.--reuse-last
: Reuse the metagraph data you last retrieved. Only use this if you have already retrieved metagraphdata.--html
: Display the table as HTML in the browser, rather than in the Terminal.--quiet
: Do not output to the console besides critical information.--verbose
: Enable verbose output.--help
: Show this message and exit.