Chia Blockchain

News site specializing in Chia and related technologies

Get the most out of your setup – Automation

people working together to maximize output

If you are running your plotter/farmer on Linux than this guide is not necessary for you as the main focus here is to help Windows users. I stuck on Windows because the machine I use for chia is my primary desktop – although nowadays its sole purpose is to plot and farm. My farmer will be based on Linux though (Raspberry Pi4) so at the end once I fill up my disks, I will move everything there and just let it farm. As always there are many options, I decided to go with Swar and chiabot.

Setting up Swar chia-plot-manager

Swar is a cross-platform chia plot manager. It’s not a plotter it’s just a manager to kick off plotting based on some settings with the aim to maximize the number of plots you do per day.

Main features

  • Stagger your plots so that your computer resources can avoid high peaks
  • Allow for a list of destination directories
  • Utilize temporary space to its maximum potential by starting a new plot early
  • Run a maximum number of plots concurrently to avoid bottlenecks or limit resource hogging
  • More in-depth active plot screen

Installation

1. First of all download and install the Python interpreter to Windows: https://www.python.org/downloads/windows/
and git for Windows as well: https://www.python.org/downloads/windows/.

Once you installed Python you need to add the install directory to the PATH environment variable so you can access run from anywhere:

  • Right-clicking This PC and going to Properties.
  • Clicking on the Advanced system settings in the menu on the left.
  • Clicking on the Environment Variables button o​n the bottom right.
  • In the System variables section, selecting the Path variable and clicking on Edit. The next screen will show all the directories that are currently a part of the PATH variable.
  • Clicking on New and entering Python’s install and the scripts directory ($user = your user):
    c:\Users\$user\AppData\Local\Programs\Python\Python39; c:\Users\$user\AppData\Local\Programs\Python\Python39\Scripts\

2. Either run Git CMD or Git Bash (open Start menu and just start typing git…)

Once the Git console is open enter the directory where you want to git clone swar. For example:

cd c:\users\$your_user\chia_tools\swar
git clone https://github.com/swar/Swar-Chia-Plot-Manager.git

3. Install the required dependencies – libraries needed for swar:

pip install -r requirements.txt

Copy config.yaml.default and name it as config.yaml in the same directory.

  1. Edit and set up the config.yaml to your own personal settings. There is more help on this below.
    • You will need to add the chia_location as well! This should point to your chia executable.
  2. Run the Manager: python manager.py start
    • This will start a process in the background that will manage plots based on your inputted settings.
  3. Run the View: python manager.py view. This will loop through a view screen with details about active plots.

Configuring swar

The configuration of this library is unique to every end-user. The config.yaml file is where the configuration lives. This plot manager works based on the idea of jobs. Each job will have its own settings that you can configure and customize. No two drives are unique so this will provide flexibility for your own constraints and requirements. Open up config.yaml with you favorite editor and start the configuration based on the below guide.

chia location

This is a single variable that should contain the location of your chia executable file. This is the blockchain executable.

C:\Users\<USERNAME>\AppData\Local\chia-blockchain\app-1.1.6\resources\app.asar.unpacked\daemon\chia.exe

manager

These are the config settings that will only be used by the plot manager.

  • check_interval – The number of seconds to wait before checking to see if a new job should start.
  • log_level – Keep this on ERROR to only record when there are errors. Change this to INFO in order to see more detailed logging. Warning: INFO will write a lot of information.

log

  • folder_path – This is the folder where your log files for plots will be saved.

view

These are the settings that will be used by the view.

  • check_interval – The number of seconds to wait before updating the view.
  • datetime_format – The datetime format that you want displayed in the view. See here for formatting: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
  • include_seconds_for_phase – This dictates whether seconds are included in the phase times.
  • include_drive_info – This dictates whether the drive information will be showed.
  • include_cpu – This dictates whether the CPU information will be showed.
  • include_ram – This dictates whether the RAM information will be showed.
  • include_plot_stats – This dictates whether the plot stats will be showed.

progress

  • phase_line_end – These are the settings that will be used to dictate when a phase ends in the progress bar. It is supposed to reflect the line at which the phase will end so the progress calculations can use that information with the existing log file to calculate a progress percent.
  • phase_weight – These are the weight to assign to each phase in the progress calculations. Typically, Phase 1 and 3 are the longest phases so they will hold more weight than the others.

global

  • max_concurrent – The maximum number of plots that your system can run. The manager will not kick off more than this number of plots total over time.
  • max_for_phase_1 – The maximum number of plots that your system can run in phase 1.
  • minimum_minutes_between_jobs – The minimum number of minutes before starting a new plotting job, this prevents multiple jobs from starting at the exact same time. This will alleviate congestion on destination drive. Set to 0 to disable.

job

Each job must have unique temporary directories. These are the settings that will be used by each job. Please note you can have multiple jobs and each job should be in YAML format in order for it to be interpreted correctly. Almost all the values here will be passed into the chia executable file.

Check for more details on the chia CLI here: https://github.com/Chia-Network/chia-blockchain/wiki/CLI-Commands-Reference

  • name – This is the name that you want to give to the job.
  • max_plots – This is the maximum number of jobs to make in one run of the manager. Any restarts to manager will reset this variable. It is only here to help with short term plotting.
  • [OPTIONAL]farmer_public_key – Your farmer public key. If none is provided, it will not pass in this variable to the chia executable which results in your default keys being used. This is only needed if you have chia set up on a machine that does not have your credentials.
  • [OPTIONAL]pool_public_key – Your pool public key. Same information as the above.
  • temporary_directory – Can be a single value or a list of values. This is where the plotting will take place. If you provide a list, it will cycle through each drive one by one. These directories must be unique from one another.
  • [OPTIONAL]temporary2_directory – Can be a single value or a list of values. This is an optional parameter to use in case you want to use the temporary2 directory functionality of Chia plotting.
  • destination_directory – Can be a single value or a list of values. This is the final directory where the plot will be transferred once it is completed. If you provide a list, it will cycle through each drive one by one.
  • size – This refers to the k size of the plot. You would type in something like 32, 33, 34, 35… in here.
  • bitfield – This refers to whether you want to use bitfield or not in your plotting. Typically, you want to keep this as true.
  • threads – This is the number of threads that will be assigned to the plotter. Only phase 1 uses more than 1 thread.
  • buckets – The number of buckets to use. The default provided by Chia is 128.
  • memory_buffer – The amount of memory you want to allocate to the process.
  • max_concurrent – The maximum number of plots to have for this job at any given time.
  • max_concurrent_with_start_early – The maximum number of plots to have for this job at any given time including phases that started early.
  • initial_delay_minutes – This is the initial delay that is used when initiate the first job. It is only ever considered once. If you restart manager, it will still adhere to this value.
  • stagger_minutes – The amount of minutes to wait before the next plot for this job can get kicked off. You can even set this to zero if you want your plots to get kicked off immediately when the concurrent limits allow for it.
  • max_for_phase_1 – The maximum number of plots on phase 1 for this job.
  • concurrency_start_early_phase – The phase in which you want to start a plot early. It is recommended to use 4 for this field.
  • concurrency_start_early_phase_delay – The maximum number of minutes to wait before a new plot gets kicked off when the start early phase has been detected.
  • temporary2_destination_sync – This field will always submit the destination directory as the temporary2 directory. These two directories will be in sync so that they will always be submitted as the same value.
  • exclude_final_directory – Whether to skip adding destination_directory to harvester for farming. This is a Chia feature.
  • skip_full_destinations – When this is enabled it will calculate the sizes of all running plots and the future plot to determine if there is enough space left on the drive to start a job. If there is not, it will skip the destination and move onto the next one. Once all are full, it will disable the job.
  • unix_process_priority – UNIX Only. This is the priority that plots will be given when they are spawned. UNIX values must be between -20 and 19. The higher the value, the lower the priority of the process.
  • windows_process_priority – Windows Only. This is the priority that plots will be given when they are spawned. Windows values vary and should be set to one of the following values:
    • 16384 BELOW_NORMAL_PRIORITY_CLASS
    • 32 NORMAL_PRIORITY_CLASS
    • 32768 ABOVE_NORMAL_PRIORITY_CLASS
    • 128 HIGH_PRIORITY_CLASS
    • 256 REALTIME_PRIORITY_CLASS
  • enable_cpu_affinity – Enable or disable cpu affinity for plot processes. Systems that plot and harvest may see improved harvester or node performance when excluding one or two threads for plotting process.
  • cpu_affinity – List of cpu (or threads) to allocate for plot processes. The default example assumes you have a hyper-threaded 4 core CPU (8 logical cores). This config will restrict plot processes to use logical cores 0-5, leaving logical cores 6 and 7 for other processes (6 restricted, 2 free).

Sample config, how it looks like for me:

chia_location: C:\Users\chiablockchain\AppData\Local\chia-blockchain\app-1.1.6\resources\app.asar.unpacked\daemon\chia.exe

manager:
  check_interval: 60
  log_level: INFO

# where you want swar to log
log:
  folder_path: D:\Chia\swar_log\

view:
  check_interval: 60
  datetime_format: "%Y-%m-%d %H:%M:%S"
  include_seconds_for_phase: false
  include_drive_info: true
  include_cpu: true
  include_ram: true
  include_plot_stats: true

# don't need any of these
notifications:
  notify_discord: false
  discord_webhook_url: https://discord.com/api/webhooks/0000000000000000/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  notify_ifttt: false
  ifttt_webhook_url: https://maker.ifttt.com/trigger/{event}/with/key/{api_key}

  notify_sound: false
  song: audio.mp3

  notify_pushover: false
  pushover_user_key: xx
  pushover_api_key: xx
  
  notify_telegram: false
  telegram_token: xxxxx

  notify_twilio: false
  twilio_account_sid: xxxxx
  twilio_auth_token: xxxxx
  twilio_from_phone: +1234657890
  twilio_to_phone: +1234657890

instrumentation:
  prometheus_enabled: false
  prometheus_port: 9090

progress:
  phase1_line_end: 801
  phase2_line_end: 834
  phase3_line_end: 2474
  phase4_line_end: 2620
  phase1_weight: 33.4
  phase2_weight: 20.43
  phase3_weight: 42.29
  phase4_weight: 3.88

# my system can handle 4 plots at a time and maximum 2 in phase 1
global:
  max_concurrent: 4
  max_for_phase_1: 2
  minimum_minutes_between_jobs: 0

jobs:
  - name: NVME1
    max_plots: 999
    farmer_public_key:
    pool_public_key:
    temporary_directory: F:\
    temporary2_directory:
    destination_directory: 
      - E:\
    size: 32
    bitfield: true
    threads: 4
    buckets: 128
    memory_buffer: 6500
    max_concurrent: 2
    max_concurrent_with_start_early: 2
    initial_delay_minutes: 0
    stagger_minutes: 150
    max_for_phase_1: 2
    concurrency_start_early_phase: 4
    concurrency_start_early_phase_delay: 0
    temporary2_destination_sync: false
    exclude_final_directory: false
    skip_full_destinations: true
    unix_process_priority: 10
    windows_process_priority: 32
    enable_cpu_affinity: false
    cpu_affinity: [ 0, 1, 2, 3, 4, 5, 6 ]

  - name: NVME2
    max_plots: 999
    farmer_public_key:
    pool_public_key:
    temporary_directory: H:\
    temporary2_directory:
    destination_directory:
      - G:\
    size: 32
    bitfield: true
    threads: 4
    buckets: 128
    memory_buffer: 6500
    max_concurrent: 2
    max_concurrent_with_start_early: 2
    initial_delay_minutes: 0
    stagger_minutes: 150
    max_for_phase_1: 2
    concurrency_start_early_phase: 4
    concurrency_start_early_phase_delay: 0
    temporary2_destination_sync: false
    exclude_final_directory: false
    skip_full_destinations: true
    unix_process_priority: 10
    windows_process_priority: 32
    enable_cpu_affinity: false
    cpu_affinity: [ 0, 1, 2, 3, 4, 5, 6 ]

Setting up chiabot

First of all you need to get the Discord messaging app installed to your phone. Open your app manager on your phone an download it, register and then you are all set. Once the app us running click on the green ‘+’ button then at the bottom ‘Join a friend on Discord’. To the invite link add the Swar’s Chia Community link: https://discord.gg/fPjnWYYFmp

Chiabot is a discord bot that monitors your chia farm and can send you notification when blocks are found, gives you information about your connection status and many more. There is an official guide here: https://github.com/joaquimguimaraes/chiabot but let me walk you through how I did it:

Setup is very simple, you just decompress the file to a place where you want to run it, e.g. c:\users\$your_user_name\chiabot\ and either run farmer.exe or harvester.exe.

If you are setting it up the first time, you need the the client-id to connect it to discord:

==============Your id is fooo-baar-foo-baar-fooobar, run=================
!chia link fooo-baar-foo-baar-fooobar
to link this client to your discord user
You can interact with ChiaBot in Swar's Chia Community
Open the following link to join the server: https://discord.gg/fPjnWYYFmp

The fooo-baar-foo-baar-fooobar is what you need, open the discord app from your phone, go to the SWAR’S COMMUNITY CHAT panel and enter the bot-spam channel. Then write to the message board the following:

!chia link $your_client_id

Where the $your_client_id is the id that appeared on the screen when you run farmer.exe OR harvester.exe.

If your device was linked successfully you can use the following commands (makes sure you stay in bot-spam):

  • !chia – displays your basic farming stats
  • !full – displays your full farming stats
  • !workers – client specific stat
  • !status – displays your workers

There are more you, use !help if you need more information. If you stop farmer.exe OR harvester.exe then this will stop working so make sure it’s running all the time. If you need more information and would like to fine tune what is reported by the client then go to: https://github.com/joaquimguimaraes/chiabot#first-time