Chia - guydavis/machinaris GitHub Wiki
Machinaris bundles the latest official Chia™ binaries in the Docker image, installed on Ubuntu 22.04 Jammy, following their install guide. So, once Machinaris is running you can farm and plot straight away!
UPGRADE NOTICE: With the release of Chia 2.0.0, if you upgrading from an older release of Machinaris, you may want to enable GPU-farming of compressed plots by following their directions. In particuar, you must update your config.yaml (Settings | Farming page in the Machinaris WebUI).
2023-09-23: Changing 'Settings | Pools' for the Chia blockchain does not work. Reportedly due to a regression in Chia's own CLI to no longer honor the -y
parameter to skip prompts. No ETA on when CNI's dev/qa will correct this regression on their part...
Farming
Machinaris Page
The Machinaris home page will show two charts for Chia farming status:
- Challenges from Harvesters - This chart displays the result of parsing the mainnet/log/debug.log file of the blockchain and presents how quickly each harvester is responding to blockchain challenges from the fullnode. Ideally you would like to see under 5 seconds. Anything over 30 seconds means you are not successfully responding fast enough to possibly win a block reward. That would indicate you need to tune your farm. NOTE: There is about a 2 minute (+/- 30 seconds) window from current time for Machinaris to collect these recent challenges and present them.
- Partial Proofs for Pools - This chart displays the result of parsing the mainnet/log/debug.log file of the blockchain and presents partial proofs submitted to your selected Pool. You should see a consistent stream of these each hour. A gap indicates you are not successfully pooling and your farm requires correction and/or restart.
Plot Type
On a new install of Machinaris, Plotman will plot solo plots. If you want to ever pool using those plots, it is strongly recommend that you plot portable plots (aka NFT plots). This requires a few extra steps so is not the default, but it is strongly recommended you do this for flexibility around pooling in the future!
Validation
To ensure you are farming successfully, see the Challenges being updated on the Summary page, multiple times a minute. As well, if pooling, you should see Partial Proofs being sent to your pool as proof of space.
Check
On the Farming page, each plot will be eventually Checked ('c' column) and Analyzed ('a' column) after initial creation. The Checked column can be sorted and/or filtered by entering values 'GOOD' (check-mark circle icon) or 'BAD' (exclamation point triangle icon) into the search box. NOTE: The "Question Mark icon" in the Checked column for a plot does NOT automatically mean the plot is BAD. It simply means the plot has not yet been checked. If you click on the the "Question Mark" icon in a plot's row, a check will be started with results seen (after page refresh) in a few minutes.
NOTE: Plots flagged as invalid will be checked again in a few days. Just be patient. However, if you wish to reset the state of ALL plots checked, requiring another full automated checking pass, please delete the entire cache (both checks and analyze):
docker exec -it machinaris bash
cd /root/.chia/plotman
rm -rf status.json checks analyze
NOTE: If your farmer hardware is insufficient to execute chia plots check
, then you can disable this automated checking by setting this environment variable on container launch, of the Machinaris controller (Chia fullnode):
environment:
- plots_check_analyze_skip=true
...
This will prevent a check of a few plots, every few minutes, from being run in the background on all farmers/harvesters.
Finally, while normal operation of a Chia Harvester does not require the mnemonic key be present on the system, if you do wish to see valid output from chia plots check
on a harvester, you do need to place your mnemonic key at ~/.machinaris/mnemonic.txt
on the host OS. This is completely optional and only for the purpose of chia plots check
on harvesters.
Analyze
If the plot was made with Machinaris, then Plotman will have an Analyze result showing the time spent during plotting for it. The absence of a stop-watch icon indicates the plot has either not been analyzed yet (too new) or, more likely, that the plot was created outside Machinaris by some other plotting software. Such external plots are fine, they will be farmed, you just won't see the Plotman Analyze result showing plotting speed for them.
Config
Visit the Settings | Farming page to view and edit the Chia configuration file via the Machinaris WebUI as shown here:
There are many settings in this file. Here are some of the more important ones:
- log_filename: log/debug.log => Where log output, must be this file for log monitoring. Full in-container path is:
/root/.chia/mainnet/log/debug.log
- log_stdout: False => Ensures Chia log output goes to the debug.log file, rather than stdout in Docker container. This is required for log monitoring!
- log_level: INFO => INFO or lower is required for log monitoring. Setting this to WARN or higher will break both alerts and challenge display.
Replotting
As these blockchains evolve, you may wish to delete "old" plot files slowly to make room for newly plotted ones. From the Farming page, click the top-right Settings button. Here you can set the criteria used to determine which plots to delete from the Chia, Chives, or MMX blockchains. Only a few plots will be removed, allowing just enough room for a new plot to be added to a drive. Once Machinaris sees the drive has been nearly filled, Machinaris will then delete another "old" plot meeting the criteria. Combined with plotting continuely adding new plots, this is a set-it and forget-it approach to replotting.
Use cases include replacing uncompressed plots, smaller k-size plots, or even old solo (aka "OG") plots.
Directory Exclusions
Generally, if you are running a Chia farm on dedicated hardware, you are allocating all free disk space to plots. However, in the case you wish to split the usage of a particular disk, to perhaps leave free space for storing Linux ISOs, then you can exclude particular plot directories on particular workers from the replotting deletion action. For this special case, please create the following config file on the Machinaris controller system at this path in-container: /root/.chia/machinaris/config/replotting_exceptions.json
{
"aragorn": [
"/plots1", "/plots2"
],
"merry": [
"/plots31"
]
}
The above JSON file tells Machinaris to ignore directories '/plots1' and '/plots2' on worker named 'aragorn' (see Workers page). Replotting will then still check the next directory in sequence (probably '/plots3') to ensure it has enough space for a new plot. If '/plots3' is full and "old" plots meeting deletion criteria are found, then a couple of them will be deleted to free space for the plotter.
Plotting
Machinaris can use the official Chia™ binaries for plotting, by setting 'plotting: -> type: chia' on the Settings | Plotting page. This official plotter works best when run in parallel, via the Plotman plotting manager. This old Chia plotter is not the default as it is slow and pointless compared to plotting with either Madmax or Bladebit, both bundled within Machinaris.
Config
# Learn more about Plotman at https://github.com/ericaltendorf/plotman
# https://github.com/ericaltendorf/plotman/wiki/Configuration#versions
version: [2]
logging:
# DO NOT CHANGE THIS IN-CONTAINER PATH USED BY MACHINARIS!
plots: /root/.chia/plotman/logs
user_interface:
use_stty_size: False
commands:
interactive:
autostart_plotting: False
autostart_archiving: False
# Where to plot and log.
directories:
# One or more directories to use as tmp dirs for plotting. The
# scheduler will use all of them and distribute jobs among them.
# It assumes that IO is independent for each one (i.e., that each
# one is on a different physical device).
#
# If multiple directories share a common prefix, reports will
# abbreviate and show just the uniquely identifying suffix.
# REMEMBER ALL PATHS ARE IN-CONTAINER, THEY MAP TO HOST PATHS
tmp:
- /plotting
# Optional: tmp2 directory. If specified, will be passed to
# the chia and madmax plotters as the '-2' param.
# tmp2: /plotting2
# One or more directories; the scheduler will use all of them.
# These again are presumed to be on independent physical devices,
# so writes (plot jobs) and reads (archivals) can be scheduled
# to minimize IO contention.
# REMEMBER ALL PATHS ARE IN-CONTAINER, THEY MAP TO HOST PATHS
dst:
- /plots
# See: https://github.com/guydavis/machinaris/wiki/Plotman#archiving
#archiving:
#target: rsyncd
#env:
#site_root: /mnt/disks
#user: root
#host: aragorn
#rsync_port: 12000
#site: disks
# Plotting scheduling parameters
scheduling:
# Run a job on a particular temp dir only if the number of existing jobs
# before tmpdir_stagger_phase_major tmpdir_stagger_phase_minor
# is less than tmpdir_stagger_phase_limit.
# Phase major corresponds to the plot phase, phase minor corresponds to
# the table or table pair in sequence, phase limit corresponds to
# the number of plots allowed before [phase major, phase minor]
tmpdir_stagger_phase_major: 2
tmpdir_stagger_phase_minor: 1
# Optional: default is 1
tmpdir_stagger_phase_limit: 1
# Don't run more than this many jobs at a time on a single temp dir.
# Increase for staggered plotting by chia, leave at 1 for madmax sequential plotting
tmpdir_max_jobs: 1
# Don't run more than this many jobs at a time in total.
# Increase for staggered plotting by chia, leave at 1 for madmax sequential plotting
global_max_jobs: 1
# Don't run any jobs (across all temp dirs) more often than this, in minutes.
global_stagger_m: 30
# How often the daemon wakes to consider starting a new plot job, in seconds.
polling_time_s: 20
# Optional: Allows overriding some characteristics of certain tmp
# directories. This contains a map of tmp directory names to
# attributes. If a tmp directory and attribute is not listed here,
# it uses the default attribute setting from the main configuration.
#
# Currently support override parameters:
# - tmpdir_max_jobs
#tmp_overrides:
# In this example, /plotting3 is larger than the other tmp
# dirs and it can hold more plots than the default.
#/plotting3:
# tmpdir_max_jobs: 5
# Configure the plotter. See: https://github.com/guydavis/machinaris/wiki/Plotman#plotting
plotting:
# See Keys page, for 'Farmer public key' value
farmer_pk: REPLACE_WITH_THE_REAL_VALUE
# ONLY FOR OLD SOLO PLOTS, COMMENT OUT IF PORTABLE PLOTTING!!!
pool_pk: REPLACE_WITH_THE_REAL_VALUE
# See 'Settings | Pools' page, for 'P2 singleton address' value, UNCOMMENT IF PORTABLE PLOTTING!!!
#pool_contract_address: REPLACE_WITH_THE_REAL_VALUE
# If you enable 'chia', plot in *parallel* with higher tmpdir_max_jobs and global_max_jobs
# If you enable 'madmax', plot in *sequence* with very low tmpdir_max_jobs and global_max_jobs
type: chia
chia:
# The stock plotter; see https://github.com/guydavis/machinaris/wiki/Chia#plotting
k: 32 # k-size of plot, leave at 32 most of the time
e: False # Disable bitfield back sorting (default is True)
n_threads: 2 # Threads per job
n_buckets: 128 # Number of buckets to split data into
job_buffer: 3389 # Per job memory
Harvesting
To launch Machinaris on another computer with plots, which will connect to your Machinaris fullnode, please see the Workers page.
Troubleshooting
To troubleshoot harvesting issues such as slow/low pool partial submissions:
- On the index page, watch for abnormally long challenge response times (5+ secs) on the "Chia - Challenges from Harvesters"
- On the index page, watch that you are submitting pool partials regularly in the "Chia - Partial Proofs for Pools" chart.
If above charts indicate problems, then you can delve deeper, looking for stale submissions. Try this on the Chia fullnode system:
docker exec -it machinaris bash
cd /root/.chia/mainnet/log
grep -i "The partial is too late" debug.log
Ideally you have no, or very few, of these late submission log entries. If you have many, then its possible one or more of your harvester systems is simply responding too slowly to challenges. See #1 above.
GPU Support
As of mid-2023, Chia 2.0.0 brought GPU-support for harvesting of compressed plots. However, existing users will not find it works without performing a config.yaml reset as CNI didn't provide a clean upgrade path.
Once you have a working config.yaml, you need to start tuning many settings as GPUs greatly complicate farming Chia. For example, the default value for Parallel Decompressor Count is 1. This means that on a harvester with more than one CPU, only one of the CPUs will be used for decompressing plots. This setting is fine for most machines, and is the recommended value for GPU harvesting. However, feel free to increase it if you want to use CPU decompression and you want to dedicate multiple CPUs to compressed harvesting.
Database Upgrade
Chia fullnodes now offer a newer blockchain database format named v2
, which replaces the older v1
format. The newer format takes less space on disk, so is recommended. To upgrade, first ensure you have at least double the current drive space available as is being used by the ~/.machinaris/
folder. Then open a shell into the Machinaris container with docker exec -it machinaris bash
or equivalent. Then:
chia db upgrade
chia start farmer -r
The upgrade command will run for an hour or more. When it successfully completes, restart the farming services on your fullnode with the second command. Once you verify that everything is running fine with a chia farm summary
, you can delete the old v1 database files found in ~/.machinaris/mainnet/db/
folder.