Advanced CLI
Pulsar (previously Simple CLI or Subspace CLI) is the recommended way to farm on the Subspace Network. Follow the guide below to get started or check out the project README on GitHub.
I. Pre-requisites
A. System Requirements
Make sure you have a stable network connection. During the plotting phase of farming, it can be network intensive.
This may impact your network usage so please check your network connection if you have a hard data limit.
Hardware | Specs |
---|---|
CPU | 4 Core+ |
RAM | 8GB+ |
SWAP | 4GB |
Storage | 100GB SSD |
A swap is only necessary if you have a low amount of RAM.
It is advised not to use the Subspace farmer and node on CoW file systems for any OS (ReFS, BTRFS, ZFS, bcachefs, HAMMER and some more).
If BTRFS is used with Subspace, the directory/whole file system must be CoW disabled with the following command prior to starting Subspace, because it only applies to newly created files.
Command to Disable CoW on BTRFS
sudo chattr +C path/to/data/dir
Alternatively, non-CoW file systems like ext4 or XFS can be used instead.
Using redundancy (RAID1/5/6, RAIDZ and others) on a filesystem with plot makes no sense, as the farmer uses checksums to verify the integrity of the plot, and is able to recover corrupted blocks if necessary in most cases. See scrub
command below.
Creating a filesystem with a chunk (sunit) size of 32KB can prevent data fragmentation and improve performance, since the farmer operates on ~32KB chunks.
XFS
sudo mkfs.xfs -d su=32k,sw=1 /path/to/dev
Then use largeio
and swalloc
mount options.
ext4
sudo mkfs.ext4 -E stride=8,stripe-width=8 /path/to/dev
You can change these settings for an existing file system:
sudo tune2fs -E stride=8,stripe-width=8 /path/to/dev
B. Crypto Wallet
Before running anything you need to have a wallet where you'll receive testnet coins. There are currently two wallets we suggest using, SubWallet being the preferred route.
Install one of the two wallets above into your browser and create a new account there. The address of your account will be necessary at the last step.
For help refer to our forum post How to setup Subwallet & a Polkadot.js Wallet
- make sure to follow the Bonus section of the bottom of the post above.
C. Required ports
Currently, a few ports need to be exposed for node to work properly.
If you have a server with no firewall, there is nothing to be done, but otherwise make sure to open the following TCP ports for incoming connections.
30333
30433
30533
On the desktop side if you have a router in front of your computer, you'll need to forward TCP ports to the machine on which your node is running (how this is done varies from router to router, but there is always a feature like this, refer to How to Forward Ports for a more in-depth tutorial). If you're connected directly without any router, then again nothing needs to be done in such case.
II. Installation
You can always find these executables in the Releases section on our GitHub
We will be downloading two files for your respective operating system.
Subspace-Node
- This is the executable that actually makes the connection with the Subspace NetworkSubspace-Farmer
- This is the executable that will actually farm for rewards on your allocated storage plot.
- Those using Docker will not have to download anything, just configure the
docker-compose.yaml
- 🐋 Docker
- 🖼️ Windows
- 🍎macOS
- 🐧Ubuntu
- ⚙ Service (Linux)
Input your parameters in the provided form and click
Generate
. Don't forget to specify your reward address instead of a default one!Docker Compose File Generator
docker-compose.yamlCopy the generated
docker-compose.yaml
file.Create the
subspace
directory and thedocker-compose.yaml
file in it. Paste the output from the generator into the file.Now go to directory with
docker-compose.yaml
and typedocker compose up -d
to start everythingYou can read logs with
docker compose logs --tail=1000 -f
, for the rest read Docker Compose CLI reference.
Expand for Version 2 - For older processors since ~2009 and some old VMs
Expand for Version skylake - For newer processors since ~2015
If you face an error where the node outputs nothing and no error code is given it is likely you just need to install the latest Visual C++ Redistributable package here
Operating systems, such as Windows, allocate memory for both visible tasks and behind-the-scenes processes. While this memory can be readily freed when necessary, Windows occasionally may not display these allocations accurately due to certain system nuances. High RAM consumption should not be a cause for concern.
- Open
Powershell
(we do not recommend using Command Prompt as its syntax is slightly different) - In the terminal we will change to the Downloads directory using this command
cd Downloads
- We will then start the node using the following command
You may get a popup asking for firewall permission, make sure to click
Allow
# Replace `INSERT_YOUR_ID` with a nickname you choose
# Copy all of the lines below, they are all part of the same command
.\subspace-node-windows-x86_64-skylake-gemini-3f-2023-oct-06.exe `
--chain gemini-3f `
--execution wasm `
--blocks-pruning 256 `
--state-pruning archive `
--validator `
--name "INSERT_YOUR_ID"
You should see something similar in the terminal:
2022-02-03 10:52:23 Subspace
2022-02-03 10:52:23 ✌️ version 0.1.0-35cf6f5-x86_64-windows
2022-02-03 10:52:23 ❤️ by Subspace Labs <https://subspace.network>, 2021-2022
2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 1
2022-02-03 10:52:23 🏷 Node name: YOUR_FANCY_NAME
2022-02-03 10:52:23 👤 Role: AUTHORITY
2022-02-03 10:52:23 💾 Database: RocksDb at C:\Users\X\AppData\Local\subspace-node-windows-x86_64-snapshot-2022-jan-05.exe\data\chains\subspace_test\db\full
2022-02-03 10:52:23 ⛓ Native runtime: subspace-100 (subspace-1.tx1.au1)
2022-02-03 10:52:23 🔨 Initializing Genesis block/state (state: 0x22a5…17ea, header-hash: 0x6ada…0d38)
2022-02-03 10:52:24 ⏱ Loaded block-time = 1s from block 0x6ada0792ea62bf3501abc87d92e1ce0e78ddefba66f02973de54144d12ed0d38
2022-02-03 10:52:24 Starting archiving from genesis
2022-02-03 10:52:24 Archiving already produced blocks 0..=0
2022-02-03 10:52:24 🏷 Local node identity is: 12D3KooWBgKtea7MVvraeNyxdPF935pToq1x9VjR1rDeNH1qecXu
2022-02-03 10:52:24 🧑🌾 Starting Subspace Authorship worker
2022-02-03 10:52:24 📦 Highest known block at #0
2022-02-03 10:52:24 〽️ Prometheus exporter started at 127.0.0.1:9615
2022-02-03 10:52:24 Listening for new connections on 0.0.0.0:9944.
2022-02-03 10:52:26 🔍 Discovered new external address for our node: /ip4/176.233.17.199/tcp/30333/p2p/12D3KooWBgKtea7MVvraeNyxdPF935pToq1x9VjR1rDeNH1qecXu
2022-02-03 10:52:29 ⚙️ Syncing, target=#215883 (2 peers), best: #55 (0xafc7…bccf), finalized #0 (0x6ada…0d38), ⬇ 850.1kiB/s ⬆ 1.5kiB/sAfter running this command, Windows may ask you for permissions related to firewall, select
allow
in this case.We will then open another terminal, change to the downloads directory, then start the farmer node with the following command:
# Replace `PATH_TO_FARM` with location where you want you store plot files
# Replace `WALLET_ADDRESS` below with your account address from Polkadot.js wallet
# Replace `PLOT_SIZE` with plot size in gigabytes or terabytes, for example 100G or 2T (but leave at least 60G of disk space for node and some for OS)
.\subspace-farmer-windows-x86_64-skylake-gemini-3f-2023-oct-06.exe farm --reward-address WALLET_ADDRESS path=PATH_TO_FARM,size=PLOT_SIZEYou should see something similar in the terminal:
2022-06-02T00:02:04.552120Z INFO subspace_farmer::commands::farm: Connecting to node at ws://127.0.0.1:9944
2022-06-02T00:02:04.557220Z INFO jsonrpsee_client_transport::ws: Connection established to target: Target { sockaddrs: [], host: "127.0.0.1", host_header: "127.0.0.1:9944", _mode: Plain, path_and_query: "/" }
2022-06-02T00:02:04.575669Z INFO subspace_farmer::commands::farm: Opening object mapping
2022-06-02T00:02:04.617553Z INFO subspace_farmer::multi_farming: Opening plot
2022-06-02T00:02:04.645422Z INFO subspace_farmer::multi_farming: Opening commitments
2022-06-02T00:02:04.666925Z INFO subspace_farmer::farming: Subscribing to slot info notifications
2022-06-02T00:02:04.688218Z INFO subspace_farmer::archiving: Subscribing to archived segments
2022-06-02T00:02:04.689129Z INFO subspace_farmer::commands::farm: WS RPC server listening on 127.0.0.1:9955
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=0
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=1
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=2
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=3
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=4
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=5You are now Farming! Just wait for your node to fully sync, and for your farmer to fully plot.
Mac CLI Executable (Intel)
Mac CLI Executable (Apple M Series)
The minimum support macOS version is version 12+
- Open your favorite terminal, and change to the Downloads directory using
cd Downloads
- Make the farmer & node executable:
chmod +x subspace-farmer-macos-aarch64-gemini-3f-2023-oct-06
chmod +x subspace-node-macos-aarch64-gemini-3f-2023-oct-06
We will then start the node using the following command
Note, when attempting to run this command you may be prompted: Click on
cancel
instead of moving it to trash. To allow execution, go toSystem Preferences -> Security & Privacy -> General
, and click onallow
. After this, simply repeat the step you prompted for (step 4 or 6). This time, click theOpen
button when prompted.# Replace `INSERT_YOUR_ID` with a nickname you choose
# Copy all of the lines below, they are all part of the same command
./subspace-node-macos-aarch64-gemini-3f-2023-oct-06 \
--chain gemini-3f \
--execution wasm \
--blocks-pruning 256 \
--state-pruning archive \
--validator \
--name "INSERT_YOUR_ID"You should see something similar in the terminal:
2022-02-03 10:52:23 Subspace
2022-02-03 10:52:23 ✌️ version 0.1.0-35cf6f5-x86_64-macos
2022-02-03 10:52:23 ❤️ by Subspace Labs <https://subspace.network>, 2021-2022
2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 1
2022-02-03 10:52:23 🏷 Node name: YOUR_FANCY_NAME
2022-02-03 10:52:23 👤 Role: AUTHORITY
2022-02-03 10:52:23 💾 Database: RocksDb at /Users/X/Library/Application Support/subspace-node-x86_64-macos-11-snapshot-2022-jan-05/chains/subspace_test/db/full
2022-02-03 10:52:23 ⛓ Native runtime: subspace-100 (subspace-1.tx1.au1)
2022-02-03 10:52:23 🔨 Initializing Genesis block/state (state: 0x22a5…17ea, header-hash: 0x6ada…0d38)
2022-02-03 10:52:24 ⏱ Loaded block-time = 1s from block 0x6ada0792ea62bf3501abc87d92e1ce0e78ddefba66f02973de54144d12ed0d38
2022-02-03 10:52:24 Starting archiving from genesis
2022-02-03 10:52:24 Archiving already produced blocks 0..=0
2022-02-03 10:52:24 🏷 Local node identity is: 12D3KooWBgKtea7MVvraeNyxdPF935pToq1x9VjR1rDeNH1qecXu
2022-02-03 10:52:24 🧑🌾 Starting Subspace Authorship worker
2022-02-03 10:52:24 📦 Highest known block at #0
2022-02-03 10:52:24 〽️ Prometheus exporter started at 127.0.0.1:9615
2022-02-03 10:52:24 Listening for new connections on 0.0.0.0:9944.
2022-02-03 10:52:26 🔍 Discovered new external address for our node: /ip4/176.233.17.199/tcp/30333/p2p/12D3KooWBgKtea7MVvraeNyxdPF935pToq1x9VjR1rDeNH1qecXu
2022-02-03 10:52:29 ⚙️ Syncing, target=#215883 (2 peers), best: #55 (0xafc7…bccf), finalized #0 (0x6ada…0d38), ⬇ 850.1kiB/s ⬆ 1.5kiB/sWe will then open another terminal, change to the downloads directory, then start the farmer node with the following command:
# Replace `PATH_TO_FARM` with location where you want you store plot files
# Replace `WALLET_ADDRESS` below with your account address from Polkadot.js wallet
# Replace `PLOT_SIZE` with plot size in gigabytes or terabytes, for example 100G or 2T (but leave at least 60G of disk space for node and some for OS)
./subspace-farmer-macos-aarch64-gemini-3f-2023-oct-06 farm --reward-address WALLET_ADDRESS path=PATH_TO_FARM,size=PLOT_SIZEIt may prompt again in here. Refer to the note on step 4.
You should see something similar in the terminal:
2022-06-02T00:02:04.552120Z INFO subspace_farmer::commands::farm: Connecting to node at ws://127.0.0.1:9944
2022-06-02T00:02:04.557220Z INFO jsonrpsee_client_transport::ws: Connection established to target: Target { sockaddrs: [], host: "127.0.0.1", host_header: "127.0.0.1:9944", _mode: Plain, path_and_query: "/" }
2022-06-02T00:02:04.575669Z INFO subspace_farmer::commands::farm: Opening object mapping
2022-06-02T00:02:04.617553Z INFO subspace_farmer::multi_farming: Opening plot
2022-06-02T00:02:04.645422Z INFO subspace_farmer::multi_farming: Opening commitments
2022-06-02T00:02:04.666925Z INFO subspace_farmer::farming: Subscribing to slot info notifications
2022-06-02T00:02:04.688218Z INFO subspace_farmer::archiving: Subscribing to archived segments
2022-06-02T00:02:04.689129Z INFO subspace_farmer::commands::farm: WS RPC server listening on 127.0.0.1:9955
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=0
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=1
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=2
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=3
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=4
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=5You are now Farming! Just wait for your node to fully sync, and for your farmer to fully plot.
x86_64 Ubuntu Executables
Version 2 - for older processors since ~2009 and some old VMs
Version skylake - For newer processors since ~2015
Aarch64/64-bit Raspberry Pi Executables
The Linux system has a hard file descriptor limit of 100k. If this is exceeded, an error will be thrown. For reference, Substrate by default has a 10k hard file descriptor limit.
The limit can generally be found on the path /proc/sys/fs/file-max. It is recommended to change the limit to 100k if it is not already. Here is an example tutorial.
Required dependencies
There are two packages that are typically already installed, but might be missing on your machine.
If you see this error:
error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory
Make sure to install libgomp1
library with sudo apt-get install libgomp1
.
- Open your favorite terminal, and change to the Downloads directory using
cd Downloads
- Make the farmer & node executable
chmod +x subspace-farmer-ubuntu-x86_64-skylake-gemini-3f-2023-oct-06
chmod +x subspace-node-ubuntu-x86_64-skylake-gemini-3f-2023-oct-06
We will then start the node using the following command
# Replace `INSERT_YOUR_ID` with a nickname you choose
# Copy all of the lines below, they are all part of the same command
./subspace-node-ubuntu-x86_64-skylake-gemini-3f-2023-oct-06 \
--chain gemini-3f \
--execution wasm \
--blocks-pruning 256 \
--state-pruning archive \
--validator \
--name "INSERT_YOUR_ID"You should see something similar in the terminal:
2022-02-03 10:52:23 Subspace
2022-02-03 10:52:23 ✌️ version 0.1.0-35cf6f5-x86_64-ubuntu
2022-02-03 10:52:23 ❤️ by Subspace Labs <https://subspace.network>, 2021-2022
2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 1
2022-02-03 10:52:23 🏷 Node name: YOUR_FANCY_NAME
2022-02-03 10:52:23 👤 Role: AUTHORITY
2022-02-03 10:52:23 💾 Database: RocksDb at /home/X/.local/share/subspace-node-x86_64-ubuntu-20.04-snapshot-2022-jan-05/chains/subspace_test/db/full
2022-02-03 10:52:23 ⛓ Native runtime: subspace-100 (subspace-1.tx1.au1)
2022-02-03 10:52:23 🔨 Initializing Genesis block/state (state: 0x22a5…17ea, header-hash: 0x6ada…0d38)
2022-02-03 10:52:24 ⏱ Loaded block-time = 1s from block 0x6ada0792ea62bf3501abc87d92e1ce0e78ddefba66f02973de54144d12ed0d38
2022-02-03 10:52:24 Starting archiving from genesis
2022-02-03 10:52:24 Archiving already produced blocks 0..=0
2022-02-03 10:52:24 🏷 Local node identity is: 12D3KooWBgKtea7MVvraeNyxdPF935pToq1x9VjR1rDeNH1qecXu
2022-02-03 10:52:24 🧑🌾 Starting Subspace Authorship worker
2022-02-03 10:52:24 📦 Highest known block at #0
2022-02-03 10:52:24 〽️ Prometheus exporter started at 127.0.0.1:9615
2022-02-03 10:52:24 Listening for new connections on 0.0.0.0:9944.
2022-02-03 10:52:26 🔍 Discovered new external address for our node: /ip4/176.233.17.199/tcp/30333/p2p/12D3KooWBgKtea7MVvraeNyxdPF935pToq1x9VjR1rDeNH1qecXu
2022-02-03 10:52:29 ⚙️ Syncing, target=#215883 (2 peers), best: #55 (0xafc7…bccf), finalized #0 (0x6ada…0d38), ⬇ 850.1kiB/s ⬆ 1.5kiB/sWe will then open another terminal, change to the downloads directory, then start the farmer node with the following command:
# Replace `PATH_TO_FARM` with location where you want you store plot files
# Replace `WALLET_ADDRESS` below with your account address from Polkadot.js wallet
# Replace `PLOT_SIZE` with plot size in gigabytes or terabytes, for example 100G or 2T (but leave at least 60G of disk space for node and some for OS)
./subspace-farmer-ubuntu-x86_64-skylake-gemini-3f-2023-oct-06 farm --reward-address WALLET_ADDRESS path=PATH_TO_FARM,size=PLOT_SIZEYou should see something similar in the terminal:
2022-06-02T00:02:04.552120Z INFO subspace_farmer::commands::farm: Connecting to node at ws://127.0.0.1:9944
2022-06-02T00:02:04.557220Z INFO jsonrpsee_client_transport::ws: Connection established to target: Target sockaddrs: , host: "127.0.0.1", host_header: "127.0.0.1:9944", _mode: Plain, path_and_query: "/"
2022-06-02T00:02:04.575669Z INFO subspace_farmer::commands::farm: Opening object mapping
2022-06-02T00:02:04.617553Z INFO subspace_farmer::multi_farming: Opening plot
2022-06-02T00:02:04.645422Z INFO subspace_farmer::multi_farming: Opening commitments
2022-06-02T00:02:04.666925Z INFO subspace_farmer::farming: Subscribing to slot info notifications
2022-06-02T00:02:04.688218Z INFO subspace_farmer::archiving: Subscribing to archived segments
2022-06-02T00:02:04.689129Z INFO subspace_farmer::commands::farm: WS RPC server listening on 127.0.0.1:9955
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=0
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=1
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=2
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=3
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=4
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=5You are now Farming! Just wait for your node to fully sync, and for your farmer to fully plot.
Running a node as a root user carries significant risks for the system. It is recommended to create a separate user for this purpose.
- 🫚 Root
- 👤 Regular User
mkdir -p /root/.local/bin
Download the Executable Files, using the appropriate commands:
x86_64 Ubuntu Executables
Version 2 - for older processors since ~2009 and some old VMs
wget -O /root/.local/bin/subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-node-ubuntu-x86_64-v2-gemini-3f-2023-sep-25
wget -O /root/.local/bin/subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-farmer-ubuntu-x86_64-v2-gemini-3f-2023-sep-25
Version skylake - For newer processors since ~2015
wget -O /root/.local/bin/subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-node-ubuntu-x86_64-skylake-gemini-3f-2023-sep-25
wget -O /root/.local/bin/subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-farmer-ubuntu-x86_64-skylake-gemini-3f-2023-sep-25
Aarch64/64-bit Raspberry Pi Executables
wget -O /root/.local/bin/subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-node-ubuntu-aarch64-gemini-3f-2023-sep-25
wget -O /root/.local/bin/subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-farmer-ubuntu-aarch64-gemini-3f-2023-sep-25
By default, these commands download the executable files to the /root/.local/bin
directory.
You can change the directory by modifying the respective string.
You can use the same commands to update the node.
Make the Files Executable:
chmod +x /root/.local/bin/subspace-node
chmod +x /root/.local/bin/subspace-farmer
Create a Directory for Node and Farmer Data:
mkdir -p /root/.local/share
sudo useradd -m -p ! -s /sbin/nologin -c "" subspace
You can also use an existing user, but having a separate user enhances the security of your server.
Switch to the Newly Created User:
sudo su subspace -s /bin/bash
Create a Directory for Executable Files:
mkdir -p ~/.local/bin
Download the Executable Files, using the appropriate commands:
x86_64 Ubuntu Executables
Version 2 - for older processors since ~2009 and some old VMs
wget -O /root/.local/bin/subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-node-ubuntu-x86_64-v2-gemini-3f-2023-sep-25
wget -O /root/.local/bin/subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-farmer-ubuntu-x86_64-v2-gemini-3f-2023-sep-25
Version skylake - For newer processors since ~2015
wget -O /root/.local/bin/subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-node-ubuntu-x86_64-skylake-gemini-3f-2023-sep-25
wget -O /root/.local/bin/subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-farmer-ubuntu-x86_64-skylake-gemini-3f-2023-sep-25
Aarch64/64-bit Raspberry Pi Executables
wget -O /root/.local/bin/subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-node-ubuntu-aarch64-gemini-3f-2023-sep-25
wget -O /root/.local/bin/subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-sep-25/subspace-farmer-ubuntu-aarch64-gemini-3f-2023-sep-25
By default, these commands download the executable files to the ~/.local/bin
directory.
You can change the directory by modifying the respective string.
You can use the same commands to update the node.
Make the Files Executable:
chmod +x ~/.local/bin/subspace-node
chmod +x ~/.local/bin/subspace-farmer
Create a Directory for Node and Farmer Data:
mkdir -p ~/.local/share
Exit from the User:
exit
Generate Contents for the Service Files, replacing the relevant fields. Remember to change the username if setting up the node from a regular user:
Systemd Service File Generator
Open the Node Service File and Paste the Corresponding Generated Content:
EDITOR=nano sudo -e /etc/systemd/system/subspace-node.service
Open the Farmer Service File and Paste the Corresponding Generated Content:
EDITOR=nano sudo -e /etc/systemd/system/subspace-farmer.service
Enable and Start the Node and Farmer:
sudo systemctl enable --now subspace-{node,farmer}
Useful Commands
Start Node:
sudo systemctl start subspace-node
Start Farmer:
sudo systemctl start subspace-farmer
Stop Node:
sudo systemctl stop subspace-node
Stop Farmer:
sudo systemctl stop subspace-farmer
Enable Node (for automatic startup on system boot):
sudo systemctl enable subspace-node
Enable Farmer (for automatic startup on system boot):
sudo systemctl enable subspace-farmer
Disable Node (to prevent automatic startup on system boot):
sudo systemctl disable subspace-node
Disable Node (to prevent automatic startup on system boot):
sudo systemctl disable subspace-farmer
Check Node Service Status:
sudo systemctl status subspace-node
Check Farmer Service Status:
sudo systemctl status subspace-farmer
View Node Logs:
sudo journalctl -f -o cat -u subspace-node
View Farmer Logs:
sudo journalctl -f -o cat -u subspace-farmer
Count Farmer Rewards Received in the Last Hour:
sudo journalctl -o cat -u subspace-farmer --since="1 hour ago" | grep -i "Successfully signed reward hash" | wc -l
Upgrade
To upgrade a node and farmer, first, stop running services:
sudo systemctl stop subspace-{node,farmer}
After using the commands from the beginning of the manual, download the executable files of the new release. And if you installed under a regular user, you will need to switch to that user beforehand.
Now you can start the services:
sudo systemctl start subspace-{node,farmer}
III. Post Node & Farmer Install Care
Now that your Node & Farmer have been started you will wait for the node to sync and the farmer to complete the initial plotting. While this is occurring you can check out some of the helpful resources below.
Using a Custom Path
You can set a custom path for your node & farmer to use if you want to use an external hard drive, or set a custom path from the default. You can set the node and farmer to different directories if you would like.
- 1.🚩 Node
Set Node Custom Path.
To set your node to use a custom path all you will need to do is add the --base-path
parameter.
# start node and store data in `NODE_DATA_PATH` instead of default location
./NODE_FILE_NAME --base-path NODE_DATA_PATH --chain gemini-3f ...`
Switching to a new snapshot from older/different versions of Subspace
Unless specifically mentioned by the Development team you should NOT have to wipe & purge your configuration on new releases.
In general you should be able to download the latest release, and re-start the Node & Farmer with the same commands as you started to prior version with no errors.
There are some cases where version updates will cause issue with your Node & Farmer and you may have to wipe & purge your node, typically when errors occur. If you have any issues you can always check our Forums and hop in our Discord Server to ask for help.
Wipe & Purge
If you were running a node previously, and want to switch to a new snapshot, please perform these steps and then follow the guideline again:
# Replace `FARMER_FILE_NAME` with the name of the node file you downloaded from releases
./FARMER_FILE_NAME wipe PATH_TO_FARM
# Replace `NODE_FILE_NAME` with the name of the node file you downloaded from releases
./NODE_FILE_NAME purge-chain --chain gemini-3f
Does not matter if the node/farmer executable is the previous one or from the new snapshot, both will work :)
The reason we require this is, with every snapshot change, the network might get partitioned, and you may be on a different genesis than the current one.
In plain English, these commands are like a reset
button for snapshot changes.
Now follow installation guide.
Docker Wipe & Purge
In case of Docker setup run docker compose down -v
(and manually delete custom directories if you have specified them).
Now follow installation guide.
Help
There are extra commands and parameters you can use on farmer or node, use the --help
after any other command to display additional options.
# Replace `FARMER_FILE_NAME` with the name of the node file you downloaded from releases
./FARMER_FILE_NAME farm --help
IV. Advanced
Helpful commands examples
./FARMER_FILE_NAME info PATH_TO_FARM
: show information about the farm atPATH_TO_FARM
./FARMER_FILE_NAME scrub PATH_TO_FARM
: Scrub the farm to find and fix farm atPATH_TO_FARM
corruption./FARMER_FILE_NAME wipe PATH_TO_FARM
: erases everything related to farmer if data were stored inPATH_TO_FARM
./NODE_FILE_NAME --base-path NODE_DATA_PATH --chain gemini-3f ...
: start node and store data inNODE_DATA_PATH
instead of default location./NODE_FILE_NAME purge-chain --base-path NODE_DATA_PATH --chain gemini-3f
: erases data related to the node if data were stored inNODE_DATA_PATH
Support for multiple disks
Farm path and size you have seen above can be specified more than once to engage multiple disks. It is recommended to specify multiple disks explicitly rather than using RAID for better hardware utilization and efficiency.
Example:
./FARMER_FILE_NAME farm --reward-address WALLET_ADDRESS \
path=/media/ssd1,size=100GiB \
path=/media/ssd2,size=10T \
path=/media/ssd3,size=10T
Build from source (Linux)
If you're running unsupported Linux distribution or CPU architecture, you may try to build binaries yourself from source.
NOTE: This is primarily targeted at tech-savvy users and not recommended unless you know what you're doing. Please try to find answer to your question online before reaching out to maintainers.
You'll have to have Rust toolchain installed as well as LLVM, Clang and CMake in addition to usual developer tooling (Ubuntu example):
sudo apt-get install llvm clang cmake
The build with LLVM + Clang 16 ends with UnknownOpcode(192)
error due to breaking changes concerning WASM in LLVM 16. You can read more about this issue here. At this point, the solution is to use LLVM + Clang 15 and add the -Z build-std
flag to the cargo build
command.
Now clone the source and build snapshot snapshot-2023-aug-18
(replace occurrences with the snapshot you want to build):
git clone https://github.com/subspace/subspace.git
cd subspace
git checkout snapshot-2023-aug-18
cargo build \
--profile production \
--bin subspace-node \
--bin subspace-farmer
You'll find two binaries under target/production
directory once it succeeds, after which refer to instructions above on how to use them.
V. Having Trouble?
If you are having some issues with running the node or the farmer for the subspace network, feel free to join our Discord or even better you can take a look at our Forums and review and existing questions or post a new one if needed!
- Forums
- Discord
Enable Rust Backtrace
When running the Subspace Network Farmer & Node, sometimes you may encounter an error message that includes a line similar to the following:
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
This error message means that Rust (the programming language that Subspace Network Farmer & Node is written in) has encountered a problem and has provided a diagnostic backtrace that can help diagnose the issue. However, by default, the backtrace is not displayed. To see the backtrace, you need to enable the RUST_BACKTRACE
environment variable.
In this section, we will show you how to enable the RUST_BACKTRACE
environment variable on Linux, macOS, and Windows (PowerShell).
- 🖼️ Windows
- 🍎macOS
- 🐧Ubuntu
- ⚙ Service (Linux)
Enabling RUST_BACKTRACE on Windows (PowerShell)
To enable the RUST_BACKTRACE
environment variable on Windows using PowerShell, follow these steps:
Open a PowerShell window.
Type the following command:
$Env:RUST_BACKTRACE=1
Press Enter.
After exporting the environment variable, run the Subspace Network Farmer & Node as usual, and any errors encountered will display the backtrace.
Enabling RUST_BACKTRACE on macOS
To enable the RUST_BACKTRACE
environment variable on macOS, follow these steps:
Open a terminal window.
Type the following command:
export RUST_BACKTRACE=1
Press Enter.
After exporting the environment variable, run the Subspace Network Farmer & Node as usual, and any errors encountered will display the backtrace.
Enabling RUST_BACKTRACE on Linux
To enable the RUST_BACKTRACE
environment variable on Linux, follow these steps:
Open a terminal window.
Type the following command:
export RUST_BACKTRACE=1
Press Enter.
After exporting the environment variable, run the Subspace Network Farmer & Node as usual, and any errors encountered will display the backtrace.
Enabling RUST_BACKTRACE on Linux Service
To enable the RUST_BACKTRACE
environment variable on Linux Service, follow these steps:
Open a terminal window.
If you want to enable it for the node, then run the following command:
sudo systemctl edit subspace-node
If you want to enable it for the farmer, then run the following command:
sudo systemctl edit subspace-farmer
Between the warning comments, add two lines to the file:
[Service]
Environment=RUST_BACKTRACE=1Reload systemd daemon:
sudo systemctl daemon-reload
Restart services:
sudo systemctl restart subspace-{node,farmer}
If you want to disable RUST_BACKTRACE
, just follow the same steps above,
but in step 3 instead of adding, remove those 2 lines.