TFGrid 3.15 Release + Farmerbot

TFGrid 3.15 Release + Farmerbot

This message concerns all farmers running the farmerbot. You must complete the steps below to ensure a smooth update of your farmerbot during the 3.15 Grid update. Otherwise your nodes may lose uptime or be assigned violations.

There is no requirement that farmers using the Farmerbot perform any action on the day of launch, or on any specific day for that matter. All that’s required is to stop using the bot any time before the Grid update, and then to update and restart the bot any time after the Grid update is complete. The farmer can complete these steps at their convenience

Hi amazing farmers of the ThreeFold Grid,

We are planning to release TFGrid 3.15 on mainnet on November 13, 2024 starting at 10am CET. This release includes a mandatory update of the farmerbot. To perform this update the following steps are required:

  1. Stop the farmerbot and wake up all nodes before the Grid update is initiated
  2. Update the farmerbot binary file
  3. Start the bot after the Grid update has been completed, which we will announce

Note that you can stop the bot and wake up your nodes any time before the update is initiated, but that should be no later than the day before.

Below you will find detailed instructions to complete the update steps.

Stop the Farmerbot and Wake Up Nodes

Here are the steps to stop the farmerbot and wake up your nodes:

# First get a shell on the system running your farmerbot, probably with SSH

# Stop the bot
systemctl stop farmerbot

# Disable the bot so it doesn't run again if the system restarts
systemctl disable farmerbot

# Wake up all nodes. This example uses farm id 42. Replace it with your farm id
# Also enter the mnemonic seed phrase that controls your farm between the quotes
farmerbot start all -m "your seed phrase here..." --farm 42

# Alternatively, you can source the mnemonic from your .env file
# Replace the path with the real one on your system. You can use the find command to find it
find / -name '.env' 2> /dev/null
farmerbot start all -e /path/to/your/.env --farm 42

Update the Farmerbot

The simplest way to update the farmerbot binary is using the install script:

rm farmerbot-setup.sh
wget https://gist.githubusercontent.com/scottyeager/b4e4504f037841da165e7f759976a86c/raw/farmerbot-setup.sh
sudo bash farmerbot-setup.sh
# Enter "y" to update to the latest version
# For generating config files enter "n"
# For generating systemd unit file, enter "y" and overwrite the existing file

You can always check the installed farmerbot version like this:

farmerbot version

For Grid 3.15, farmerbot version 0.16.0 is required.

If you prefer to update the farmerbot manually, please refer to the manual.

Start the Bot Again

After the Grid update has been completed and announced via our Telegram channel, you can start the bot again:

# Reenable and start the bot immediately
sudo systemctl daemon-reload
sudo systemctl enable --now farmerbot

Timeline

  1. Start all nodes on Tuesday evening (2024-11-12)
  2. Disable farmerbot
  3. Wait for 3.15 release on Wednesday (2024-11-13)
  4. Update farmerbot to version 0.16.0 (if with the script, make sure the script is updated)
  5. Enable and start the farmerbot (enable --now)
  6. Observe whether all nodes have gone into standby mode

Questions?

If you have questions about the operation of the farmerbot, there is more information available in the manual.

As always, you can ask questions here under this forum post, via the TF Support, or farmers chat on Telegram.

Thanks!

3 Likes

Hi there,

The install script does not update the farmerbot to version 0.16.0.
It keeps saying that it’s up to date:

Installed Farmerbot is up to date (v0.15.10).
Skipping download and install

Looks like the script itself needs update as well…

Hi,

So indeed the script still installs the older version. That’s because it’s the newest version that’s compatible with the current 3.14 Grid.

I will update the script after the 3.15 update is complete. That will be the time to update the Farmerbot binary and start it up again.

2 Likes

Scott, can you post here to confirm when the 0.16.0 is posted above? Currently cannot tell if it has been updated or not. The farm is online and is at the ready when the 3.15 update is complete.

1 Like

Yes, I’ll post an update when it’s time to move to the new version. The team is planning to update the Grid tomorrow.

2 Likes

The Grid update has been completed. You can now update and restart the farmerbot. Please double check the instructions because I’ve just changed them and following the steps carefully will be essential.

1 Like

I just updated my farmerbot. Is this an error or is my farmerbot ok?

Hello there,

That notification is not necessarily an issue as you can identify from the subsequent lines the bot restarted again. You might also want to check your logs to be sure:

tail -n 50 farmerbot.log prints the last 50 lines. If there are no errors projected in the logs then it should be fine.

root@farmerbot:~/farmerbot# tail -n 50 farmerbot.log
-a, --auto-approve when set, interactive answer of the disclaimer is automated to approve
-c, --config string enter your config file that includes your farm, node and power configs. Allowed format is yml/yaml
–continue-power-on-error when set, the farmerbot will run even if there was an error powering on some of the nodes
-h, --help help for run

Global Flags:
-d, --debug by setting this flag the farmerbot will print debug logs too
-e, --env string enter your env file that includes your NETWORK and MNEMONIC_OR_SEED
-k, --key-type string key type for mnemonic (default “sr25519”)
-m, --mnemonic string the mnemonic of the account of the farmer
-n, --network string the grid network to use, available networks: dev, qa, test, and main (default “main”)
-s, --seed string the hex seed of the account of the farmer

8:19PM FTL error=“failed to add node with id 2257 with error: failed to get node 2257 statistics from rmb with error: relay info is not set for this twin”
8:19PM INF Welcome to farmerbot (v0.16.0), Farmerbot is starting up…
8:19PM DBG connecting url=wss://tfchain.grid.tf/ws
2024/11/13 20:19:41 Connecting to wss://tfchain.grid.tf/ws…
8:19PM DBG connecting url=wss://tfchain.grid.tf/ws
2024/11/13 20:19:42 Connecting to wss://tfchain.grid.tf/ws…
8:19PM DBG connecting url=wss://tfchain.grid.tf:443
2024/11/13 20:19:42 Connecting to wss://tfchain.grid.tf:443…
8:19PM INF starting peer session=farmerbot-rpc-158 twin=634
8:19PM DBG connecting url=wss://tfchain.grid.tf/ws
2024/11/13 20:19:42 Connecting to wss://tfchain.grid.tf/ws…
8:19PM DBG connecting url=wss://relay.grid.tf
8:19PM DBG Add node nodeID=4093
8:19PM WRN Updating power, Power target is off nodeID=4093
8:19PM WRN Node state is off, will skip rmb calls nodeID=4093
8:19PM DBG Add node nodeID=776
8:19PM DBG Add node nodeID=807
8:19PM DBG Add node nodeID=2257
Error: failed to add node with id 2257 with error: failed to get node 2257 statistics from rmb with error: relay info is not set for this twin
Usage:
farmerbot run [flags]

Flags:
-a, --auto-approve when set, interactive answer of the disclaimer is automated to approve
-c, --config string enter your config file that includes your farm, node and power configs. Allowed format is yml/yaml
–continue-power-on-error when set, the farmerbot will run even if there was an error powering on some of the nodes
-h, --help help for run

Global Flags:
-d, --debug by setting this flag the farmerbot will print debug logs too
-e, --env string enter your env file that includes your NETWORK and MNEMONIC_OR_SEED
-k, --key-type string key type for mnemonic (default “sr25519”)
-m, --mnemonic string the mnemonic of the account of the farmer
-n, --network string the grid network to use, available networks: dev, qa, test, and main (default “main”)
-s, --seed string the hex seed of the account of the farmer

8:19PM FTL error=“failed to add node with id 2257 with error: failed to get node 2257 statistics from rmb with error: relay info is not set for this twin”
root@farmerbot:~/farmerbot#

How can i delete my old logs. I have too much logs. It takes a couple of min to go through them.

I’d recommend to just use:

less -R farmerbot.log

Then you can type G (shift-g) to go to the end of the file. From there, use the arrow keys to scroll up and down or u and d to page up and down.

Can I delete the old logs?

Also I updated my farmerbot to 0.16.0
How do I know it is working? Additionally nano config.yaml doesn’t work for me.

You can delete the old logs, but it’s better to keep at least some history around. If you’re not running out of disk space, I’d recommend to do this:

cp farmerbot.log farmerbot.log.bak
truncate -s 0 farmerbot.log

That will keep the old logs around in a separate file and clear out the existing file in a way that’s safe even if a running program has the file open.

The best way to check that the bot is working is to look at the most recent entries in your log file.

If you can’t open the config file, I’d suggest to look inside your systemd unit file and check the paths:

cat /etc/systemd/system/farmerbot.service

You should see the full path to the config file and env file in the output.