#!/bin/bash
if [ -z "$1" ]
then
echo "usage: plotLoop <tmp directory>"
exit
fi
tmpdir=$1

dstdir=/opt/usbhdd
logdir=/home/myuser/logs

#get the keys from command: chia keys show
farmkey="<<your chia farm key>>"
poolkey="<<your chia pool key"

#farming to pool
#from pool contract address from command: chia plotnft show
poolingcontract="xch<<your pool contract id>>"

#chia command
chia="/opt/chia/resources/app.asar.unpacked/daemon/chia "

arg1=" plots create -k32 -n1 -t$tmpdir -2$tmpdir -d$tmpdir -b3390 -u128 -r2 -a1235814531 -x"

#arg2 for generating self pooling plots
#arg2=" -f $farmkey -p $poolkey"

#arg2 for generating plots to be used in other pools
arg2=" -f $farmkey -c $poolingcontract"

copycmd="nohup rsync --partial --remove-source-files --bwlimit=50000 $tmpdir/*.plot $dstdir/ "

i=0
while :
do
i=$((i+1))
fn=`date | awk '{print "chia-plot-"$4"-"$3"-"$2"-"$5"-"$4}'`
fnappendix="${tmpdir//\//-}"
logfile=$logdir/$fn-$fnappendix.log
echo "chia plotting loop number $i - logging to $logfile"
echo "$chia $arg1 $arg2 >>$logfile"
`$chia $arg1 $arg2 >>$logfile`
# echo "transfer plot file in background"
# echo $copycmd
# `$copycmd `
sleep 4
done

computer2know :: thank you for your visit :: have a nice day :: © 2024