Bittensor
Search…
Subtensor
Subtensor is our network blockchain, and keeps record of every transaction that occurs. 1 block is created and recorded every 12 seconds - or "blockstep" - at which time a new round of Tao is distributed.
By connecting to Nakamoto, you automatically gain access to Subtensor. Running a Subtensor instance locally, however, will ensure a faster and more consistent experience in the case that the network is compromised or slowed by high traffic. It is therefore recommended.

Running Subtensor

1. Prepare your system by updating outdated packages in your system, and installing the newest available ones. You can do this in two commands.
1
sudo apt-get update
Copied!
1
sudo apt-get upgrade
Copied!
2. Install an application package software to maintain Subtensor locally. Bittensor mining is very computationally complex, and a software like this will help allocate appropriate resources. We recommend using Docker. For more information, follow this link.
Run the following commands:
1
curl -fsSL https://get.docker.com -o get-docker.sh
Copied!
1
sudo sh get-docker.sh
Copied!
1
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Copied!
1
sudo chmod +x /usr/local/bin/docker-compose
Copied!
3. Install Subtensor
1
git clone https://github.com/opentensor/subtensor.git ~/.bittensor/subtensor
Copied!
4. Connect with the Subtensor directory
1
cd ~/.bittensor/subtensor
Copied!
5. Pull the latest Subtensor image
1
docker pull opentensorfdn/subtensor
Copied!
6. Run Subtensor inside of your application package software
1
sudo docker-compose up -d
Copied!
7. Check that Subtensor is fully synced
1
docker logs --since=1h node-subtensor 2>&1 | grep "best"
Copied!
Here is an example of a synced copy of Subtensor:
1
/node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50564.
2
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50568.
3
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50572.
4
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50576.
5
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50580.
6
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50584.
7
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50588.
8
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50592.
9
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50596.
10
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50600.
11
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50604.
12
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50608.
13
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50612.
14
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50616.
15
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50620.
16
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50624.
17
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50628.
18
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50632.
19
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50636.
20
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50640.
21
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50644.
22
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50648.
23
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50652.
24
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50656.
25
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50660.
26
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50664.
27
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50668.
28
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50672.
29
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50676.
30
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50680.
31
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50684.
32
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50688.
33
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50692.
34
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50696.
35
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50700.
36
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50704.
37
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50708.
38
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50712.
39
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50716.
40
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50720.
41
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50724.
42
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50728.
43
node-subtensor | 2022-04-27 01:32:22 Accepted a new tcp connection from 172.22.0.1:50732.
Copied!
In case your Subtensor goes down, here is the command to restart it:
1
cd ~/.bittensor/subtensor && \
2
/usr/local/bin/docker-compose down && \
3
docker system prune -a -f && \
4
git -C ~/.bittensor/subtensor pull origin master && \
5
docker pull opentensorfdn/subtensor && \
6
/usr/local/bin/docker-compose up -d
Copied!
Lastly, here are the steps to ensure both Bittensor and Subtensor are up to date.
Update Bittensor:
1
git -C ~/.bittensor/bittensor pull origin master
2
python3 -m pip install -e ~/.bittensor/bittensor
Copied!
Update Subtensor:
1
#Bring Subtensor down
2
sudo docker-compose down
3
#Connect to directory
4
cd ~/.bittensor/subtensor
5
#update Subtensor
6
sudo git pull
7
#Bring Subtensor back up
8
sudo docker-compose up -d
Copied!
References
Docker, Inc. (2022, May 9). Docker Overview. Docker Documentation. Retrieved May 9, 2022, from https://docs.docker.com/get-started/overview/
Canonical. (n.d.). Description. Ubuntu Manpage: Apt-get - APT package handling utility -- command-line interface. Retrieved May 13, 2022, from https://manpages.ubuntu.com/manpages/xenial/man8/apt-get.8.html
Copy link