Skip to content

Instantly share code, notes, and snippets.

@grayfallstown
Last active June 10, 2021 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grayfallstown/8530acb84eb131d3dae074e4be23badb to your computer and use it in GitHub Desktop.
Save grayfallstown/8530acb84eb131d3dae074e4be23badb to your computer and use it in GitHub Desktop.
plot.ps1
# drive letters
$temp1 = "c:\PlotTemp"
$temp2 = "c:\PlotTemp"
$final = "p:\Plots"
$username = "test"
$chiaversion = "1.1.5"
# Find these value by running
# C:\Users\ <your username here> \AppData\Local\chia-blockchain\app-1.1.5\resources\app.asar.unpacked\daemon\chia.exe keys show
# in your powershell.
$publickey = "ac8e049..."
$fingerprint = "341...."
$host.ui.RawUI.WindowTitle = "plotting $temp1-$temp2-$final"
$BUFFER=3416
$THREADS=4
$BUCKETS=128
& "C:\Users\$username\AppData\Local\chia-blockchain\app-$chiaversion\resources\app.asar.unpacked\daemon\chia.exe" plots create --tmp_dir "$temp1" --tmp2_dir "$temp2" --final_dir "$final" --size 32 --buffer $BUFFER --num_threads $THREADS --buckets $BUCKETS --alt_fingerprint $fingerprint --pool_public_key $publickey 2>&1 | % ToString | Tee-Object -FilePath "C:\Users\$username\.chia\mainnet\plotter\$([GUID]::NewGUID().ToString('D')).log"
@manowar40
Copy link

:\Users$username\AppData\Local\chia-blockchain\app-$chiaversion\resources\app.asar.unpacked\daemon\chia.exe : Die Benennung "C:\Users$username\AppData\Local\chia-blockchain\app-$chiaversion\resources\app.asar.unpacked\daemon\chia.exe" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei
oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:18 Zeichen:1

  • C:\Users$username\AppData\Local\chia-blockchain\app-$chiaversion\res ...
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\$usern...daemon\chia.exe:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    

What is my problem here ?

@grayfallstown
Copy link
Author

I forgot an & at the beginning. Without powershell does not interpret the "C:\Users$username...." as a command correctly. Fixed it

@drakunov
Copy link

is that not necessary?

$publickey = "ac8e049..."$fingerprint = "341...."

@grayfallstown
Copy link
Author

@drakunov It is, but you should insert YOUR public key and fingerprint there and not mine, so I shortened them but left a bit so you can see what they should look like.

Find them by running C:\Users\ <your username here> \AppData\Local\chia-blockchain\app-1.1.5\resources\app.asar.unpacked\daemon\chia.exe keys show in your powershell.

@drakunov
Copy link

@drakunov It is, but you should insert YOUR public key and fingerprint there and not mine, so I shortened them but left a bit so you can see what they should look like.

Find them by running C:\Users\ <your username here> \AppData\Local\chia-blockchain\app-1.1.5\resources\app.asar.unpacked\daemon\chia.exe keys show in your powershell.

I am plotting without those parameters and all seems ok

@grayfallstown
Copy link
Author

@drakunov Does the farmer pick up the finished plots? Does chia.exe plots check return any errors?

@drakunov
Copy link

@drakunov Does the farmer pick up the finished plots? Does chia.exe plots check return any errors?

Hpool is ok, i cant check plots right now, I think that default keys in app dir are used if no CLI arguments provided

@jddeltoro
Copy link

If I wanted to add 5 plot in sequence, after a plot finished. What would be the best way to modify the script to support this operation?

@drakunov
Copy link

If I wanted to add 5 plot in sequence, after a plot finished. What would be the best way to modify the script to support this operation?

add -n 5 At the end

@jddeltoro
Copy link

Thankyou

@evr1ka
Copy link

evr1ka commented May 26, 2021

The version number $chiaversion can be taken as follows:
$(ls "$env:LOCALAPPDATA\chia-blockchain\app-*").name

@evr1ka
Copy link

evr1ka commented May 26, 2021

And the username:
$username = $($env:USERNAME)

And you can use $env:LOCALAPPDATA and put everything on one line:
"$($env:LOCALAPPDATA)\chia-blockchain$($(ls "$env:LOCALAPPDATA\chia-blockchain\app-*").name)\resources\app.asar.unpacked\daemon\chia.exe"

@grayfallstown
Copy link
Author

@evr1ka nice of you to post this. I wanted to keep the example as simple as possible so I do not get many support issues.

@evr1ka
Copy link

evr1ka commented May 27, 2021

@evr1ka nice of you to post this. I wanted to keep the example as simple as possible so I do not get many support issues.

I agree. The simpler the code, the clearer it is.)

@itongx
Copy link

itongx commented Jun 10, 2021

any chance to make log name tag similar to chia gui did

@grayfallstown
Copy link
Author

@itongx what do they look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment