August 31, 2022

Autonomys Farming on Ubuntu Advanced CLI

WebsiteForumDiscordGitHub

MINIMUM HARDWARE REQUIREMENTS

  • Ubuntu 22.04
  • 4+ dedicated CPU cores
  • 8GB+ RAM
  • 200GB+ SSD

INSTALLATION

If you have previously installed Autonomys, it will be enough for you to enter one command into the terminal, but if you want to refresh your memory or install for the first time, read the information.
curl -s https://raw.githubusercontent.com/yurally/subspace/main/subspace > subspace.sh && chmod +x subspace.sh && ./subspace.sh

INFORMATION

After entering the command into the terminal, you will see a menu in which you will be asked to specify the action. First we need to install and run node.
Accordingly, we need to press 1 on the keyboard and Enter

Next, enter the name of the node and press Enter

use latin and don't use spaces

Next, enter your wallet address on the Autonomys Network and press Enter

You can find out the address or create a new one at polkadot.js.org

Next, enter plot size in the format as shown in the screenshot and press Enter

What is plot size in simple words?
This is the size that you allocate on your device for farming. The larger the size you allocate, the more likely you are to receive rewards.

Next, you will go through the process of installing the necessary components and the node with the farmer, if everything went well, you will see the menu back

Perhaps at the installation stage the system will ask you to confirm the installation, you need to enter Y and press Enter

What to do next?

You can find yourself in telemetry and expect full sync

ADDITIONAL INFORMATION

How can I install updates?

The script will automatically install the new version. You just need to run the script and execute the second menu item.
curl -s https://raw.githubusercontent.com/yurally/subspace/main/subspace > subspace.sh && chmod +x subspace.sh && ./subspace.sh

Why do we need to restart the node and the farmer?

Sometimes it happens for one reason or another, we need to restart the services for this, item 3 is intended in the script menu.
You can restart the node and farmer without the script menu, use the command below
sudo systemctl restart subspacefarm subspace

What are node and farmer logs for?

Logs are a log that stores information about the program's operation. In our case, about the work of the node and the farmer. With the help of logs, we can determine whether everything is working correctly or not. Also, if we see errors in the logs, we can provide them to the developers and get an answer about the reason.
In the script menu, these are items 4 and 5, but you can also not use the script menu, but enter the commands below.

To display the last 100 node log entries, use the command

sudo journalctl -n 50 -f -u subspace -o cat

To display the last 100 farmer log entries, use the command

sudo journalctl -n 50 -f -u subspacefarm -o cat
If you want, for example, to display not 100, but your own number of records, simply change the number in the command to the one you need.

Why do we need wipe farmer and pure-chain?

Sometimes there are cases when a node gets into a fork and for correct operation it is necessary to make a wipe of the farmer and a pure-chain. Also, sometimes developers can announce an update, where there is a prerequisite wipe farmer and pure-chain.
You can not use the script menu, but do it manually using commands in the terminal.
farmer wipe $HOME/.local/share/subspace-farmer
subspace wipe $HOME/.local/share/subspace-node

What is log search for?

Sometimes you need to look for certain entries in the logs, for example, you want to look at the records of rewards, or you were asked by the developers to look in the logs for certain entries.
You can not use the script menu, but do it manually using commands in the terminal.

Search in node logs

Replace the word KEYWORD with the one you need
sudo journalctl -u subspace -o cat | grep "KEYWORD"

Search in farmer logs

Replace the word KEYWORD with the one you need
sudo journalctl -u subspacefarm -o cat | grep "KEYWORD"

How can I remove Autonomys?

Use the "Delete Node" option or you can delete it manually using the commands below.
systemctl stop subspace subspacefarm
systemctl disable subspace subspacefarm
rm /etc/systemd/system/subspace.service
rm /etc/systemd/system/subspacefarm.service
rm -r /usr/local/bin/subspace
rm -r /usr/local/bin/farmer
rm -r /root/.local/share/subspace-farmer
rm -r /root/.local/share/subspace-node

How to change port 30333, 30433, 30533 and 9944

This is an example, you can use your free ports
nano /etc/systemd/system/subspace.service

Adding node launch options

--listen-on /ip4/0.0.0.0/tcp/30222 \
--dsn-listen-on /ip4/0.0.0.0/udp/30522/quic-v1 \
--dsn-listen-on /ip4/127.0.0.1/tcp/30522 \
--rpc-listen-on 127.0.0.1:9966 \
nano /etc/systemd/system/subspacefarm.service

Adding a Farmer Startup Parameter

--node-rpc-url ws://127.0.0.1:9966
--listen-on /ip4/0.0.0.0/tcp/30221
sudo systemctl daemon-reload
sudo systemctl restart subspacefarm subspace

If you have questions that you have not found the answer to, you can always ask them in Discord and on the Forum.