Chia Plot and Farming Setup with SystemD
- Intel NUC10i7FNH2
- Kingston KCP426SD8/32 (1x, 32GB, DDR4-RAM, SO-DIMM 260 pin)
- Kingston A400 (480GB, 2.5")
- Corsair Force MP510
👉 Tipp: Go for a 1TB SSD, so you will have enough space for the OS, Blockchain, Logs and Destination folder for Plotman. I made the mistake and went for a 512GB, which turned out to be a bottleneck.
Software
I'm using the following software for my installation. Detailed configuration below
- Official Chia Client from Chia Network (github.com)
- Plotman Plot Manager ericaltendorf/plotman: Chia plotting manager (github.com)
- ChiaDog martomi/chiadog: A watch dog... (github.com)
- Farmr: Dashboard joaquimguimaraes/farmr (github.com)
The interesting bits: Configuration
Chia Installation
👉 Tipp: Make sure you don't use sudo to install anything chia related, it will mess up your installation!
Depending on your home-partition, you might want to move the .chia-data folder to a different partition. I did that, and moved the whole .chia folder to my root partition under /var/local/chia.
mis@lx-nuc:~ $ sudo ln -s /var/local/chia /home/mis/.chia
Folder Structure
I'm using a top level folder /chia in the root partition where I mount all the devices, shares etc. I find this quiet convenient, having everything available under /chia (except chia, itself you might say...).
mis@lx-nuc01:/chia$ tree -d
.
├── dst
│ ├── external
│ └── internal
├── farm
│ ├── nas-share01
│ ├── nas-share02
│ ├── usb-wd01
│ └── usb-wd02
└── tmp
9 directories
Where as
- /dst: Is the destination folder where the chia plotter moves the plots as part of the last step and plotman picks them up to move them ton one of the farm buckets. I do have two dst-folders, one is on the root-filesystem (internal), where the other is a mounted external SSD drive (external)
- /farm: Here I have all the mount-points for the storage drives/shares that hold my plots. This is also referred as archive location in plotman. The beauty of having all under the same folder, is the ability to pass the root folder /chia/farm to plotman, and plotman will distribute finished plots automatically
- /tmp: This is my internal NVME drive, which is used as temporary directory when creating new plots
Mount Points
/dev/disk/by-uuid/... /chia/tmp auto discard,defaults,nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-id/... /chia/farm/usb-wd01 auto defaults,uid=1000,gid=1000,x-gvfs-show 0 0
/dev/disk/by-id/... /chia/farm/usb-wd02 auto defaults,uid=1000,gid=1000,x-gvfs-show 0 0
/dev/disk/by-id/... /chia/dst/external auto defaults,uid=1000,gid=1000,x-gvfs-show 0 0
//192.168.0.1/chia01 /chia/farm/nas-share01 cifs username=YOU,password=hello,vers=2.0,uid=1000,gid=1000,forceuid,forcegid 0 0
//192.168.0.1/chia02 /chia/farm/nas-share02 cifs username=YOU,password=hello,vers=2.0,uid=1000,gid=1000,forceuid,forcegid 0 0
Permissions
Network Shares
The important bit here is the vers=2.0, which avoided compatibility issues with my NAS, and again the user information, together with forceuid and forcegid to override information from NAS.
Plotman
Plotman is installed into the virtual environment of chia-blockchain. Find your own configuration options for plotting. As a reference, here is and except of the relevant parts of my ~/.config/plotman/plotman.yaml
logging:
plots: /var/log/chia/plotter
commands:
interactive:
autostart_plotting: False
autostart_archiving: False
directories
tmp:
- chia/tmp
dst:
- chia/dst/internal
- chia/dst/external
archiving:
target: local_rsync
env:
command: rsync
site_root: /chia/farm
scheduling
tmpdir_stagger_phase_major: 2
tmpdir_stagger_phase_minor: 1
tmpdir_stagger_phase_limit: 4
tmpdir_max_jobs: 9
global_max_jobs: 20
global_stagger_m: 86
Installing as service
Plotman is a great tool as bases entirely on logfiles and process information. This means, you can kill plotman process and the creation or archival of plots is not affected. If you start plotman again in interactive mode, or just get the status, it will always show the status based in processes and logfile content.- Create new Plots in tpm-folder(s): plotman plot
This command keeps starting creation of new plots if possible. Runs in a loop only stops when the process is killed - Archive plots from the dst-folder(s): plotman archive
This command looks for finished plots and distributes them into the farm. Runs in a loop as well and never stops
For plotman I created the following services
[Unit]
Description=Plotman Plotting Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=mis
ExecStart=/bin/sh -c ". /home/mis/chia-blockchain/activate && plotman plot"
[Install]
WantedBy=multi-user.target
[Unit]
Description=Plotman Archiver Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=mis
ExecStart=/bin/sh -c ". /home/mis/chia-blockchain/activate && plotman archive"
[Install]
WantedBy=multi-user.target
Both have to be activated so that they start when the system starts
mis@lx-nuc:~ $ sudo systemctl enable plotman-plotter.service
Created symlink
mis@lx-nuc:~ $ sudo systemctl enable plotman-archive.service
Created symlink ...
mis@lx-nuc:~ $ sudo systemctl start plotman-plotter
mis@lx-nuc:~ $ sudo systemctl start plotman-archive
mis@lx-nuc01:~$ sudo journalctl -u plotman-archive -f
-- Logs begin at Tue 2021-07-13 01:47:20 CEST. --
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
Jul 19 00:46:29 lx-nuc01 sh[2280047]: Sleeping 60s until next iteration...
ChiaDog
Chia Dog pretty much bases on the default installation from martomi/chiadog: A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7. (github.com). I'm using both Telegram and the keep alive monitor integration with Healthchecks.io. This pretty neat, as it will inform you on additional channels if your ChiaDog has not called a certain HealthChecks.io Url.
Installing as service
[Unit]
Description=ChiaDog Monitoring Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=mis
WorkingDirectory=/home/mis/chiadog
ExecStart=/bin/sh /home/mis/chiadog/start.sh
[Install]
WantedBy=multi-user.target
mis@lx-nuc:~ $ sudo systemctl enable chiadog
mis@lx-nuc:~ $ sudo systemctl start chiadog
farmr.net
Last but not least I was looking for a simple dashboard accessible via web-browser in addition to the telegram bot. I found farmr.net to do exactly what I wanted.
mis@lx-nuc01:~$ wget https://github.com/joaquimguimaraes/farmr/releases/download/v1.5.3.4/farmr-ubuntu-x86_64.deb
mis@lx-nuc:~ $ sudo dpkg -i farmr-ubuntu-x86_64.dev
[Unit]
Description=farmr.net client service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=mis
ExecStart=/usr/bin/farmr headless
[Install]
WantedBy=multi-user.target
mis@lx-nuc:~ $ sudo systemctl enable farmr
mis@lx-nuc:~ $ sudo systemctl start farmr
Jul 19 05:06:57 lx-nuc01 systemd[1]: Started farmr.net client service.
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: ============================================
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: Your id is XXXXXXXX-XXXX-XXXX-XXX-XXXXXXXXXXXX-xch, visit https://farmr.net to add it to your account.
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: Alternatively, you can also link it through farmrbot (a discord bot) by running the following command:
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: !chia link XXXXXXXX-XXXX-XXXX-XXX-XXXXXXXXXXXX-xch
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: to link this client to your discord user
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: You can interact with farmrbot in Swar's Chia Community
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: Open the following link to join the server: https://discord.gg/fghFbffYsC
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: ===========================================
Jul 19 05:07:01 lx-nuc01 farmr[2415445]: Running in headless mode
Missing 'headless' Exception
Select action: Unhandled exception:
type 'Null' is not a subtype of type 'FutureOr<String>'
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:46)
#1 Prompter.prompt.<anonymous closure>.<anonymous closure> (package:console/src/prompt.dart:222)
#2 new Future.<anonymous closure> (dart:async/future.dart:174)
#3 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18)
#4 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395)
#5 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184)
Comments
Post a Comment