Skip to content

Commit e900f03

Browse files
author
Watchmaker
authored
Removing from the "main" branch the doc to run subtensor locally
As per this Discord thread: https://discord.com/channels/799672011265015819/1260678915186495509 Docs issue: opentensor/developer-docs#221
1 parent a2b8d70 commit e900f03

File tree

1 file changed

+1
-204
lines changed

1 file changed

+1
-204
lines changed

docs/running-subtensor-locally.md

+1-204
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,3 @@
11
# Running subtensor node locally
22

3-
- [Method 1: Using Docker](#method-1-using-docker)
4-
- [Method 2: Using Source Code](#method-2-using-source-code)
5-
- [Running on Cloud](#running-on-cloud)
6-
7-
## Method 1: Using Docker
8-
9-
To run a subtensor node with Docker, follow the below steps.
10-
11-
If you are already running a subtensor node using Docker, then go directly to [Step 5 Prepare to Run](#step-5-prepare-to-run) to restart the Docker container. The below steps 1 through 4 are for first time users only.
12-
13-
### Step 1: Install git
14-
15-
Make sure you installed `git` on your machine. See [GitHub docs](https://docs.github.com/en/get-started).
16-
17-
### Step 2: Install Docker
18-
19-
Follow Docker's [official installation guides](https://docs.docker.com/engine/install/) and install Docker.
20-
21-
**Run Docker first**
22-
Before you proceed, make sure that Docker is running.
23-
24-
### Step 3: Clone the subtensor repo
25-
26-
Clone the subtensor repo:
27-
28-
```bash
29-
git clone https://github.com/opentensor/subtensor.git
30-
```
31-
32-
### Step 4: Go into subtensor directory
33-
34-
Then `cd` into the subtensor directory:
35-
36-
```bash
37-
cd subtensor
38-
```
39-
40-
### Step 5: Prepare to run
41-
42-
Execute the below three commands in this order:
43-
44-
Make sure you are on the `main` branch. If not, switch to it:
45-
46-
```bash
47-
git checkout main
48-
```
49-
50-
Pull the latest `main` branch contents:
51-
52-
```bash
53-
git pull
54-
```
55-
56-
Stop the currently running Docker containers:
57-
58-
```bash
59-
docker compose down --volumes
60-
```
61-
62-
### Run a lite node on mainchain
63-
64-
To run a lite node connected to the Bittensor mainchain, run the below command.
65-
66-
```bash
67-
sudo ./scripts/run/subtensor.sh -e docker --network mainnet --node-type lite
68-
```
69-
70-
### Run an archive node on mainchain
71-
72-
To run an archive node connected to the Bittensor mainchain, run the below command.
73-
74-
```bash
75-
sudo ./scripts/run/subtensor.sh -e docker --network mainnet --node-type archive
76-
```
77-
78-
### Run a lite node on testchain
79-
80-
To run a lite node connected to the Bittensor testchain, run the below command.
81-
82-
```bash
83-
sudo ./scripts/run/subtensor.sh -e docker --network testnet --node-type lite
84-
```
85-
86-
### Run an archive node on testchain
87-
88-
To run an archive node connected to the Bittensor testchain, run the below command.
89-
90-
```bash
91-
sudo ./scripts/run/subtensor.sh -e docker --network testnet --node-type archive
92-
```
93-
94-
---
95-
96-
## Method 2: Using Source Code
97-
98-
To install and run a subtensor node by compiling the source code, follow the below steps.
99-
100-
## Install basic packages
101-
102-
Install the basic requirements by running the below commands on a Linux terminal.
103-
104-
```bash title="On Linux"
105-
sudo apt-get update
106-
sudo apt install build-essential
107-
sudo apt-get install clang
108-
sudo apt-get install curl
109-
sudo apt-get install git
110-
sudo apt-get install make
111-
sudo apt install --assume-yes git clang curl libssl-dev protobuf-compiler
112-
sudo apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
113-
```
114-
115-
## Install Rust
116-
117-
Next, install Rust and update the environment by running the following commands:
118-
119-
```bash
120-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
121-
source ~/.cargo/env
122-
```
123-
124-
Next, install Rust toolchain:
125-
126-
```bash
127-
rustup default stable
128-
rustup update
129-
rustup target add wasm32-unknown-unknown
130-
rustup toolchain install nightly
131-
rustup target add --toolchain nightly wasm32-unknown-unknown
132-
```
133-
134-
## Compile subtensor code
135-
136-
Next, to compile the subtensor source code, follow the below steps:
137-
138-
Clone the subtensor repo:
139-
140-
```bash
141-
git clone https://github.com/opentensor/subtensor.git
142-
```
143-
144-
`cd` into the subtensor directory:
145-
146-
```bash
147-
cd subtensor
148-
```
149-
150-
Make sure you are on the `main` branch. If not, switch to it:
151-
152-
```bash
153-
git checkout main
154-
```
155-
156-
Remove previous chain state:
157-
158-
```bash
159-
rm -rf /tmp/blockchain
160-
```
161-
162-
Install subtensor by compiling with `cargo`:
163-
164-
```bash
165-
cargo build --profile production --features=runtime-benchmarks
166-
```
167-
168-
## Run the subtensor node
169-
170-
You can now run the public subtensor node either as a lite node or as an archive node. See below:
171-
172-
### Lite node on mainchain
173-
174-
To run a lite node connected to the mainchain, execute the below command (note the `--sync=warp` flag which runs the subtensor node in lite mode):
175-
176-
```bash title="With --sync=warp setting, for lite node"
177-
./target/production/node-subtensor --chain raw_spec.json --base-path /tmp/blockchain --sync=warp --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /ip4/13.58.175.193/tcp/30333/p2p/12D3KooWDe7g2JbNETiKypcKT1KsCEZJbTzEHCn8hpd4PHZ6pdz5 --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
178-
```
179-
180-
### Archive node on mainchain
181-
182-
To run an archive node connected to the mainchain, execute the below command (note the `--sync=full` which syncs the node to the full chain and `--pruning archive` flags, which disables the node's automatic pruning of older historical data):
183-
184-
```bash title="With --sync=full and --pruning archive setting, for archive node"
185-
./target/production/node-subtensor --chain raw_spec.json --base-path /tmp/blockchain --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /ip4/13.58.175.193/tcp/30333/p2p/12D3KooWDe7g2JbNETiKypcKT1KsCEZJbTzEHCn8hpd4PHZ6pdz5 --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
186-
```
187-
188-
### Lite node on testchain
189-
190-
To run a lite node connected to the testchain, execute the below command:
191-
192-
```bash title="With bootnodes set to testnet and --sync=warp setting, for lite node."
193-
./target/production/node-subtensor --chain raw_testspec.json --base-path /tmp/blockchain --sync=warp --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
194-
```
195-
196-
### Archive node on testchain
197-
198-
To run an archive node connected to the testchain, execute the below command:
199-
200-
```bash title="With bootnodes set to testnet and --sync=full and --pruning archive setting, for archive node"
201-
./target/production/node-subtensor --chain raw_testspec.json --base-path /tmp/blockchain --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
202-
```
203-
204-
## Running on cloud
205-
206-
We have not tested these installation scripts on any cloud service. In addition, if you are using Runpod cloud service, then note that this service is already [containerized](https://docs.runpod.io/pods/overview). Hence, the only option available to you is to compile from the source, as described in the above [Method 2: Using Source Code](#method-2-using-source-code) section. Note that these scripts have not been tested on Runpod.
3+
See the [**Subtensor Nodes** section in Bittensor Developer Documentation](https://docs.bittensor.com/subtensor-nodes).

0 commit comments

Comments
 (0)