Skip to main content

BTCLI Live Coding Playground

SUBMIT A PRSUBMIT AN ISSUElast edit: Apr 11, 2025

This page gives the user a chance to try out some BTCLI functionality right in the browser.

The BTCLI Live Coding Playground is an ephemeral environment run in a container, meaning nothing stays in between requests, so you'll have to load in you wallet each time. For this reason, you must only use test wallets in the playground. Any coldkey used in the playground should be considered compromised.

The BTCLI Live Coding Playground is also experimental and a bit flakey, so if you see error responses, try again, but if they persist, the service may be down.

For a more satisfying experience, install btcli locally and try managing stake with BTCLI

danger

This is not a secure code execution environment. This page is for practice/education/entertainment purposes only.

Do not enter the seed phrase for a wallet with real (main "finney" network) TAO into this or any insecure applicaiton!

See:

Import wallets and check balances.

I've created two wallets for this tutorial and put some testnet TAO into them. Run the code below to import them into bittensor-codex(the code execution service), and list them to see their public keys.

Import both wallets and list their keys

run it!
btcli wallet regen-coldkey \
--mnemonic "add aerobic there stool organ switch about diagram arctic vague replace seminar" \
--wallet.name 'playground-test1' \
--no-use-password --wallet.path ~/.bittensor/wallets

btcli wallet regen-coldkey \
--mnemonic "nominee sort fringe gauge tank sure core memory abandon lamp alter flash" \
--wallet.name 'playground-test2' \
--no-use-password --wallet.path ~/.bittensor/wallets

btcli wallet list --wallet.path ~/.bittensor/wallets

Check balance for playground-test1

run it!
btcli wallet regen-coldkey \
--mnemonic "add aerobic there stool organ switch about diagram arctic vague replace seminar" \
--wallet.name 'playground-test1' \
--no-use-password --wallet.path ~/.bittensor/wallets

btcli wallet balance \
--wallet.name 'playground-test1' \
--wallet.path ~/.bittensor/wallets \
--network test

Check balance for playground-test2

run it!

btcli wallet regen-coldkey \
--mnemonic "nominee sort fringe gauge tank sure core memory abandon lamp alter flash" \
--wallet.name 'playground-test2' \
--no-use-password --wallet.path ~/.bittensor/wallets

btcli wallet balance \
--wallet.name 'playground-test2' \
--wallet.path ~/.bittensor/wallets \
--network test

Transfer

Transfer some Tao from playground-test1 to playground-test2. We can get the --destination address from the wallet list command above.

Note: Just because the transaction fails to display in the browser below does not mean it failed on-chain. Check playground-test2's balance using the above command.

run it!
btcli wallet regen-coldkey \
--mnemonic "add aerobic there stool organ switch about diagram arctic vague replace seminar" \
--wallet.name 'playground-test1' \
--no-use-password --wallet.path ~/.bittensor/wallets

btcli wallet transfer \
--amount 0.1 \
--wallet.name 'playground-test1' \
--network test \
--destination "5ESAWH9HDB9PZvs1q5j3aWF3x1wo88kwaqNcJEabGKsHMvX6" \
--no-prompt \
--wallet.path ~/.bittensor/wallets
Challenges
  1. Check your balance to make sure the transfer executed successfully on chain.

  2. Switch the values to transfer TAO back from playground-test2 to playground-test1.

  3. Transfer some testnet TAO to a wallet you manage on another device. Just please don't take all of it.

  4. If you have some extra testnet TAO, transfer some to the playground-test wallets to refill them.

    Note: Testnet TAO has no monetary value.

Subnets

Subnet list

run it!

btcli subnet list

Subnet show

run it!
btcli subnet show --netuid 3

List a wallet's stakes

See Staking/Delegation Overview.

run it!
btcli wallet regen-coldkey \
--mnemonic "add aerobic there stool organ switch about diagram arctic vague replace seminar" \
--wallet.name 'playground-test1' \
--no-use-password --wallet.path ~/.bittensor/wallets

btcli stake list --network test --wallet.name playground-test1 --wallet-path ~/.bittensor/wallets --no-prompt

Challenge

Try staking and unstaking from the playground-test wallets!