Skip to main content

Bittensor

Bittensor Module: Build Your Own Cabal​

In this tutorial, we will explore how to use the bittensor module to build your own Cabal, which involves mining, configuring, and interacting with the Bittensor network.

Table of Contents​


Config​

The configuration specifies default variables like the blockchain chain, netuid, available neurons for mining, and more.

import commune as c
bt = c.m('bittensor')

c.print(bt.config) # Config is in Munch format

Checking Wallets​

You can check the status of different wallet keys: total, registered, and unregistered.

c.print({
'total_keys': bt.keys(),
'registered': bt.reged(),
'unregistered': bt.unreged()
})

Mining​

Mining involves participating in the Bittensor network as a neuron to contribute and earn rewards.

c.print('The default netuid is', bt.default_netuid)

# Mine with an unregistered neuron
unreged = bt.unreged()
c.print('Mining with', unreged[0])
bt.mine(unreged[0])

Talking to the Network​

Interact with the Bittensor network by communicating with registered neurons through talking.

# Talk to the network by sampling one of your registered keys
bt.talk('What is the province of Canada?', n=10, timeout=5)

This concludes our tutorial on building your own Cabal using the bittensor module. You've learned how to configure, mine, and interact with the Bittensor network, contributing to the decentralized AI ecosystem. Feel free to experiment with various configurations and actions to further explore the capabilities of Bittensor.


Feel free to use and adapt this markdown document for your tutorial needs. Ensure that you adjust any details as required and include relevant code snippets or explanations for each step to ensure clarity and comprehensiveness.