Learning PowerShell for Chia

Well, the first step is to run the command, and redirect the output to a file.

Then the next step is to grab specific text from the file into a second, smaller file, probably matching via a regular expression.

However I don’t think the task – identify “unlucky” plots – is a good idea… you want to remove bad plots for sure, ones that fail plot check, but don’t worry about the unlucky stuff, it is a waste of time…

I also buy plots from others and create some myself.
This poses two problems:

  1. whether plots are duplicate or not
  2. whether pub keys are correctly used

My idea is to check three things: plot’s pub key, plot’s private key and checksum of the file

Basically

  1. run chia plots check
  2. export to .txt or .csv in columns:
  • plot file name
  • farmer pub key
  • pool pub key
  • private key
  • proofs

After getting such .txt or .csv file, it’s much easier to manage and check whether I have duplicates across multiple machines or not. This is a workaround where I do not want to expose private key to all machines nor attach that drive to full node, where chia plots check -l -n 0 can somewhat do similar job.

I think the best way to check is using plot’s private key as a checking criteria. I know it’s not that difficult in term of writing Powershell but I’m kinda newbie in this area. Any suggested code is much appreciated.

I got error with this command

Get-Content "~\.chia\mainnet\log\debug.log" -Wait -Tail 10 | select-string 'time taken to process farming_info from' | ForEach {write-host -f $(if ($_ -Match "[1-9][0-9]*\seconds") {'green'}) $_.line}

Trying to color the harvester that exceeds 2 seconds in red. If below 1 second, color green