From 45f68e10e722a0f56a018e188ad17f46733c16f6 Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Fri, 25 Aug 2023 11:43:35 -0700 Subject: [PATCH 1/4] Add environment variable config for compressed plot harvesting --- docker-entrypoint.sh | 23 +++++++++++++++++++++-- readme.md | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 2335f27..08d7ad1 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -47,9 +47,9 @@ for p in ${plots_dir//:/ }; do done if [[ ${recursive_plot_scan} == 'true' ]]; then - sed -i 's/recursive_plot_scan: false/recursive_plot_scan: true/g' "$CHIA_ROOT/config/config.yaml" + yq -i '.harvester.recursive_plot_scan = true' "$CHIA_ROOT/config/config.yaml" else - sed -i 's/recursive_plot_scan: true/recursive_plot_scan: false/g' "$CHIA_ROOT/config/config.yaml" + yq -i '.harvester.recursive_plot_scan = false' "$CHIA_ROOT/config/config.yaml" fi chia configure --upnp "${upnp}" @@ -104,6 +104,25 @@ else sed -i 's/log_stdout: true/log_stdout: false/g' "$CHIA_ROOT/config/config.yaml" fi +# Compressed plot harvesting settings. +if [[ -n "$parallel_decompressor_count" && "$parallel_decompressor_count" != 0 ]]; then + yq -i '.harvester.parallel_decompressor_count = env(parallel_decompressor_count)' "$CHIA_ROOT/config/config.yaml" +else + yq -i '.harvester.parallel_decompressor_count = 0' "$CHIA_ROOT/config/config.yaml" +fi + +if [[ -n "$decompressor_thread_count" && "$decompressor_thread_count" != 0 ]]; then + yq -i '.harvester.decompressor_thread_count = env(decompressor_thread_count)' "$CHIA_ROOT/config/config.yaml" +else + yq -i '.harvester.decompressor_thread_count = 0' "$CHIA_ROOT/config/config.yaml" +fi + +if [[ -n "$use_gpu_harvesting" && "$use_gpu_harvesting" == 'true' ]]; then + yq -i '.harvester.use_gpu_harvesting = True' "$CHIA_ROOT/config/config.yaml" +else + yq -i '.harvester.use_gpu_harvesting = False' "$CHIA_ROOT/config/config.yaml" +fi + # Map deprecated legacy startup options. if [[ ${farmer} == "true" ]]; then service="farmer-only" diff --git a/readme.md b/readme.md index 98c78f4..e2f32a1 100644 --- a/readme.md +++ b/readme.md @@ -104,6 +104,24 @@ Or, you can simply mount `/plots` path to your host machine. Set the environment variable `recursive_plot_scan` to `true` to enable the recursive plot scan configuration option. +### Compressed Plots + +There are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled. + +See the official documentation for a description on what each of these settings do: https://docs.chia.net/farming-compressed-plots/#cli + +Compressed plot farming can be enabled by setting the following: +```bash +-e parallel_decompressor_count=1 +-e decompressor_thread_count=1 +``` + +And to use an nvidia GPU for plot decompression, set: + +```bash +-e use_gpu_harvesting="true" +``` + ### Log level To set the log level to one of CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET ```bash From f666d6435759fd585745cde0815e74b0df27eef2 Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Fri, 25 Aug 2023 11:55:17 -0700 Subject: [PATCH 2/4] Bare URLs in markdown not appreciated by linter --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e2f32a1..dc15187 100644 --- a/readme.md +++ b/readme.md @@ -108,7 +108,7 @@ Set the environment variable `recursive_plot_scan` to `true` to enable the recur There are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled. -See the official documentation for a description on what each of these settings do: https://docs.chia.net/farming-compressed-plots/#cli +See the [official documentation](https://docs.chia.net/farming-compressed-plots/#cli)) for a description on what each of these settings do. Compressed plot farming can be enabled by setting the following: ```bash From 8fdcde83f80a318fb29dcc7f4f040339a7e26573 Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Fri, 25 Aug 2023 11:58:33 -0700 Subject: [PATCH 3/4] Pasta fix --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index dc15187..7fd3f97 100644 --- a/readme.md +++ b/readme.md @@ -108,7 +108,7 @@ Set the environment variable `recursive_plot_scan` to `true` to enable the recur There are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled. -See the [official documentation](https://docs.chia.net/farming-compressed-plots/#cli)) for a description on what each of these settings do. +See the [official documentation](https://docs.chia.net/farming-compressed-plots/#cli) for a description on what each of these settings do. Compressed plot farming can be enabled by setting the following: ```bash From 5ba7fbe2eb148dd0a3e21df24d22479fc098960e Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Fri, 25 Aug 2023 12:06:09 -0700 Subject: [PATCH 4/4] More linter suggestions because the linter trickles them in --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 7fd3f97..be2d6c4 100644 --- a/readme.md +++ b/readme.md @@ -106,11 +106,12 @@ Set the environment variable `recursive_plot_scan` to `true` to enable the recur ### Compressed Plots -There are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled. +There are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled. See the [official documentation](https://docs.chia.net/farming-compressed-plots/#cli) for a description on what each of these settings do. Compressed plot farming can be enabled by setting the following: + ```bash -e parallel_decompressor_count=1 -e decompressor_thread_count=1