Skip to content

Setup Torus

Installation

To install the torus-cli python package using pip, run:

Terminal window
pip install torus-cli

Alternatively, to add torus-cli to your poetry project, use:

Terminal window
poetry add torus-cli

Features

torus-cli offers a variety of features for token management and module interaction:

  • Commands for managing keys, tokens, and modules
  • Key management including creation and listing
  • Token operations such as transferring and staking
  • Module management for registration and updates
  • Client-server interactions for module management
  • Participation in governance processes

CLI Usage

The torus-cli CLI is structured as follows:

Terminal window
tor [OPTIONS] COMMAND [ARGS]

Top-Level Subcommands

  • balance: Manage token balances and staking.
  • key: Handle key creation and management.
  • module: Manage information and operations related to modules.
  • network: Interact with network operations like block and proposal management.
  • subnet: Manage subnet information and updates.
  • misc: Access miscellaneous information such as APR and circulating supply.
Terminal window
tor subcommand [OPTIONS] COMMAND [ARGS]...

Examples

Retrieving Balance

Terminal window
# Show staked, free and total balance.
tor balance show 5FgfC2DY4yreEWEughz46RZYQ8oBhHVqD9fVq6gV89E6z4Ea

Creating a Key

Terminal window
tor key create key_name

Retrieving Key Info

Terminal window
tor key show key_name
# Add the `--show-private` flag to show sensitive fields like private key.
tor key show key_name --show-private

Listing Keys

Terminal window
# Lists the names and addresses of keys stored on disk.
tor key list

List Keys With Balances

Terminal window
# Lists keys stored on disk with their balance (free, staked and total).
tor key balances

Retrieving Module Information

Terminal window
# Note that the module has to be registered on the network.
tor module info vali::calc [--balance]

Retrieving Global Parameters

Terminal window
tor network params

Retrieving Subnet Parameters

Terminal window
tor subnet list

Retrieving Circulating Supply

Terminal window
# Gets all tokens then were ever emitted minus burned tokens.
tor misc circulating-supply

Completions

You can enable completions for your shell by running:

Terminal window
# On bash
tor --install-completion bash
# On zsh
tor --install-completion zsh

Contributing

Bug reports and pull requests and other forms of contribution are welcomed and encouraged! :)

To report a bug or request a feature, please open an issue on GitHub.

If you have any questions, feel free to ask on the torus-cli Discord channel or post on our GitHub discussions page.

To contribute to the codebase, using Poetry you can install the development dependencies with:

Terminal window
poetry install --with dev

it can require some environment-specific binaries to be installed

Torus compatibility

Yes, torus-cli is compatible with the Torus library/CLI. However, there are important considerations to note. torus-cli verifies the integrity of your keys, which means that mixing certain types of keys is not permissible. Specifically, if you possess node keys or other similar types that are not designed to receive tokens, you will need to relocate them outside of the key directory.