Subspace node and farmer

This guide will cover installation and configuration of subspace node and its farmer for the most recent network (in the time of writing Gemini3e) using simple cli on Ubuntu x86.

Requirements:

  • basic linux/unix knowledge
  • VPS with at least 2 cores, 8 GB of memory and 20 GB of SSD/NVMe space
  • public IP address
  • Opened / forwarded port 30333

Installation:

make sure your system is up to date:

sudo apt-get update && sudo apt-get upgrade --yes && sudo reboot

Check nodes’ versions on project’s github and adjust command below according to the latest version:

cd
wget -O subspace-cli https://github.com/subspace/pulsar/releases/download/v0.6.2-alpha/pulsar-ubuntu-x86_64-skylake-v0.6.2-alpha && chmod +x subspace-cli

install useful utilities:

sudo apt-get install screen

Configuration:

Create wallet

You can either use official wallet or create wallet polkadot.js wallet here according to screenshots below

click on polkadot.js link in the highlighted message box, enable the extension and open it

click on “+” button and choose “Create a new account”

Save your mnemonic and continue to next step

Name your wallet, set password and continue

your wallet will appear

If your node is behind the firewall, forward port 30333 to your node

Once all the steps above are done, you can initiate the node’s configuration. Simply run the downloaded binary as:

cd
./subspace-cli init

This will initiate the configuration. As you already have wallet created you can proceed as follows:

Initial configuration is now done and your node is ready to start.

Start the node into screen session:

cd
screen -S subspace -dm ~/subspace-cli farm --verbose

To check the node, enter screen:

screen -r subspace

To exit screen press ctrl+a+d

Now you should be able to see your node in telemetry

Tweaks:

Configure the service so it always starts together with the node and restarts in case of failure:

echo "[Unit]
Description=Subspace Node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=/root/subspace-cli farm --verbose
Restart=on-failure
LimitNOFILE=1024000

[Install]
WantedBy=multi-user.target" > $HOME/subspaced.service

sudo mv $HOME/subspaced.service /etc/systemd/system/
sudo systemctl restart systemd-journald
sudo systemctl daemon-reload
sudo systemctl enable subspaced
sudo systemctl restart subspaced

Check logs:

journalctl -u subspaced -f -o cat

You should see output like this:

Restart node:

sudo systemctl restart subspaced

Delete node:

sudo systemctl stop subspaced 
sudo systemctl disable subspaced
sudo rm -rf ~/.local/share/subspace*
sudo rm -rf /etc/systemd/system/subspace*
sudo rm -rf /usr/local/bin/subspace*

For advanced cli, follow below:

cd
wget -O subspace-farmer https://github.com/subspace/subspace/releases/download/gemini-3f-2023-aug-22/subspace-farmer-ubuntu-x86_64-skylake-gemini-3f-2023-aug-22 && chmod +x subspace-farmer

wget -O subspace-node https://github.com/subspace/subspace/releases/download/gemini-3f-2023-aug-22/subspace-node-ubuntu-x86_64-skylake-gemini-3f-2023-aug-22 && chmod +x subspace-node


echo "[Unit]
Description=Subspace Node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=/root/subspace-node \
  --chain gemini-3f \
  --execution wasm \
  --blocks-pruning 256 \
  --state-pruning archive \
  --no-private-ipv4 \
  --validator \
  --name CryptoGuides

Restart=on-failure
LimitNOFILE=1024000

[Install]
WantedBy=multi-user.target" > $HOME/subspace-node.service

sudo mv $HOME/subspace-node.service /etc/systemd/system/
sudo systemctl restart systemd-journald
sudo systemctl daemon-reload
sudo systemctl enable subspace-node

journalctl -u subspace-node -f -o cat





echo "[Unit]
Description=Subspace Farmer
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=/root/subspace-farmer farm --reward-address 5GqE84nre3n6D6abUAJRyAUHhf3CvLE6wBGqLwzZRi5jAXba \
    path=/mnt/n0,size=1500GiB \
    path=/mnt/n2,size=1500GiB

Restart=on-failure
LimitNOFILE=1024000

[Install]
WantedBy=multi-user.target" > $HOME/subspace-farmer.service
sudo mv $HOME/subspace-farmer.service /etc/systemd/system/
sudo systemctl restart systemd-journald
sudo systemctl daemon-reload
sudo systemctl enable subspace-farmer

For more info, check official guide

Leave a Reply

Your email address will not be published. Required fields are marked *