Containerize anything you can” is becoming a design pattern behind CI/CD. I’m going to show how to run a Chia harvester node on my Synology NAS for the following reasons:

  • I have spare space sitting there doing nothing anyway
  • A harvester node doesn’t consume much compute power so it’s a perfect fit for my NAS (which doesn’t have a powerful CPU)

Below are steps for doing this in Docker on my Synology:

Step 1. Prepare folders on Synology

  • A. plots folder: /volume1/docker/chia/plots.
    • This is where your plots are sitting on Synology
  • B. Chia home folder: /volume1/docker/chia/.chia.
    • This folder holds configuration files required by Chia, the most important files are the harvester’s private key files generated by the container initialization process.
  • C. CA files folder from the farmer node.
    • The Chia docker image will need to generate its own key files based on the farmer node’s key files(i.e. public key & private key files). According to docker-entrypoint.sh (managed by Chia’s official docker image on Github), when the Docker container is initialized, it will use the farmer’s key files to generate the harvester node’s key files. Folder on Synology(i.e. /volume1/docker/chia/ca_farmer) contains a copy of all files from the farmer’s CA folder( home/.chia/mainnet/config/ssl/ca) for the initialization. This folder is mapped to a temporary folder (/root/.chia/ca_tmp) in the container and is passed to the container via parameter “ca=/root/.chia/ca_tmp“. ca_tmp doesn’t need to be created beforehand(it’s just a non-existing folder I used for demo purpose), its whole purpose is to help the container refer to files on Synology file system(i.e. /volume1/docker/chia/ca_farmer). This part was not documented anywhere on the official Chia site and caused big confusion for me at the beginning.

Step 2. Create a new stack in Portainer

version: "3.6"
services:
  chia:
    container_name: chia
    restart: unless-stopped
    image: ghcr.io/chia-network/chia:latest
    ports:
      - 8444:8444
      
    environment:
      # Farmer Only
      # - service=farmer-only
      # Harvester Only
      - service=harvester
      - farmer_address=192.168.1.50  #Change to your full node's IP
      - farmer_port=8447
      - ca=/root/.chia/ca_tmp
      - keys=copy
      # Harvester Only END
      # If you would like to add keys manually via mnemonic file
      # - keys=/path/in/container
      # OR
      # Disable key generation on start
      # - keys=
      - TZ="Australia/Sydney"
      # Enable UPnP
      - upnp=false
      # Enable log file generation
      # - log_to_file=true
    volumes:
      - /volume1/docker/chia/plots:/plots
      - /volume1/docker/chia/.chia:/root/.chia
      - /volume1/docker/chia/ca_farmer:/root/.chia/ca_tmp

Of course, if you want to maximize your space for plots, you should configure your NAS to non-redundant mode(i.e. no RAID)

Chia harvester in Docker on Synology NAS
Tagged on:                 

Leave a Reply

Your email address will not be published. Required fields are marked *

53 − 45 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.