Skip to main content
SUBMIT A PRSUBMIT AN ISSUElast edit: Nov 27, 2024

Install BTCLI

Before you can start developing, you must install btcli and then create Bittensor wallet.

Supported Python versions

Developer reference

For a full developer reference, see the Bittensor CLI section.

Install on macOS and Linux

You can install btcli on your local machine directly from source. Make sure you verify your installation after you install.

Install from source

For Ubuntu-Linux users

If you are using Ubuntu-Linux, the script will prompt for sudo access to install all required apt-get packages.

Create and activate a virtual environment
  1. Create and activate a virtual environment.
python3 -m venv btcli_venv
source btcli_venv/bin/activate
  1. Clone the Bittensor CLI repo.
git clone https://github.com/opentensor/btcli.git
  1. cd into btcli directory.
cd btcli
  1. Install
pip3 install .

Install on Windows

To install and run Bittensor SDK on Windows you must install WSL 2 (Windows Subsystem for Linux) on Windows and select Ubuntu Linux distribution.

After you installed the above, follow the same installation steps described above in Install on macOS and Linux.

Limited support on Windows

While wallet transactions like delegating, transfer, registering, staking can be performed on a Windows machine using WSL 2, the mining and validating operations are not recommended and are not supported on Windows machines.

Verify the installation

btcli --version

which will give you the below output:

BTCLI version: <version number>

You will see the version number you installed in place of <version number>.

Configuration

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.

Example config file

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
alert

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.

For more help:

btcli config --help