Skip to content

Commit

Permalink
Merge pull request #208 from Chia-Network/compressed-plot-harvesting
Browse files Browse the repository at this point in the history
Add environment variable config for compressed plot harvesting
  • Loading branch information
Starttoaster authored Aug 25, 2023
2 parents 2842d16 + 5ba7fbe commit 3613fef
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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"
Expand Down
19 changes: 19 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ 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](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
```

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
Expand Down

0 comments on commit 3613fef

Please sign in to comment.