MrPig91 / PSChiaPlotter

A repo for powershell module that helps Chia Plotting
MIT License
181 stars 47 forks source link

PSChiaPlotter

A repo for powershell module that helps Chia Plotting.

Installation

Open a powershell as administrator and run the following command:

Install-Module -Repository PSGallery -Name PSChiaPlotter

If you want to update to the latest version, run this command:

Update-Module PSChiaPlotter

If you get and error like the following "The 'Command' command was found in the module 'PSChiaPlotter', but the module could not be loaded." then you will need to set your Execution Policy to remote signed by running the command below. Please note that execution policy is not a security feature, so changing it will not make your system more or less secure. Execution Policy is used to prevent you from accidentally running scripts that goes aganist the policy, but it does not prevent those scripts being ran in bypass mode. You can read more about Execution Policy on its about page here

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force

Setup

Run this in Powershell one time to add the Chia.exe directory to your $ENV:Path in your profile script so that it is available every time you open powershell. This is not necessary to use the module but very useful for quickly using the chia.exe cli tool.

$addToProfile = '
$chiapath = (get-item "$env:LOCALAPPDATA\Chia-Blockchain\app-*\resources\app.asar.unpacked\daemon\").fullname

$env:Path =  $env:Path + "; $chiapath"
'

Add-Content -Path $profile.CurrentUserAllHosts -Value $addToProfile

If you get an error stating "Add-Content : Could not find a part of the path "C:\Users\yourUSERNAME\Documents\WindowsPowerShell\profile.ps1"." Then you made need to create any missing folders in that path.

Video Guides

Using the PSChiaPlotter Plot Manager GUI

Plot Manager GUI Video

Basic Chia Plotting Using Powershell Guide

Plot Manager GUI Video

Advanced Chia Plotting Using Powershell - Adding Progress Bar

Plot Manager GUI Video

How to user Start-ChiaHarvesterWatcher and Get-ChiaHarvesterActivity To Check Harvester Health

Plot Manager GUI Video

Road Map

The following is a list of things I want to add or improve on in the module. Not listed in any particular order.

:white_check_mark: 1. Start-ChiaHarvesterWatcher

Example Script

If you want a very basic chia scripting file for parallel plotting with delays you can use the one below. Chia.exe directory must be added to $ENV:Path as shown above. Please note this script has nothing to do with the functions in this module and is only here to show people who want to write their own scripts using powershell.

param(
  [int]$parallel = 3,
  [int]$delay = 3600,
  [int]$PlotsPerQueue = 1,
  [int]$Buffer = 3390,
  [int]$Threads = 2,
  [Parameter(Mandatory)]
  [string]$tempDir,
  [Parameter(Mandatory)]
  [string]$FinalDir,
  [Parameter(Mandatory)]
  [string]$LogDir
)

for ($i = 1; $i -le $parallel;$i++){
  $date = Get-date -format yyyy-MM-dd-hh-mm-ss
  $logpath = Join-Path $LogDir $date
  Start-Process -FilePath powershell.exe -ArgumentList "chia.exe plots create -n $plotsperQueue -b $Buffer -r $Threads -t $tempDir -d $FinalDir | Tee-Object -FilePath $($LogPath)_$($i).log"
  Start-Sleep -Seconds $delay
}

Donate

If you find these tools useful and want to donate you can use any of the below addresses.

XCH: xch1xlsrczvnfzjfeg7ejpaxy7evcn0nvsr73s4gcmzdqd7zkzlvy8ds49qvv2

ETH: 0xeeb3d0FEECaAfEd8BBC705370579689BFA024Be4

XMR: 4Adn4LNiaqjUfkAq1RNmLLcRd2oBDdGx8HWL4L76eZmMWQGbowrYhvuajRCdFYLq6pGAPgXYE9P3g2wvVp36FFRn3EAzRjW

BAN: ban_37o6aossupgce34dma9r6na4hi79j6mhqrtp1gkr8ygz6nxjz8t9q3emkp4h