专注Chia
分享与XCH有关的资讯

Chia Powershell绘图脚本,Chia Powershell P盘脚本

【Chia在哪交易?】XCH如何交易,操作教程!

 

#performance tweaks
$initial_delay = 0
$delay_increment = 2400
$plots_to_run = 1
$ram_buffer_size = 8192
$cores_to_use = 3

#folders
$chia_version = "1.1.1"
$home_folder = "C:\Users\user_name"
$temp_drive_location = "h:\"
$final_drive_location = "f:\"
$chia_executable_location = "$home_folder\AppData\Local\chia-blockchain\app-$chia_version\resources\app.asar.unpacked\daemon"

$current_loop = 1
DO
{

 "Starting plot $current_loop"

  $wait_argument = $initial_delay + $delay_increment * ($current_loop - 1)

 "Now current_loop is $current_loop and wait_argument is $wait_argument"

 cd $chia_executable_location 

 $current_plotting_command = "start-process ./chia.exe plots create -k 32 -r $cores_to_use -b $ram_buffer_size -n 100 -t $temp_drive_location -d $final_drive_location"
 
 $current_log = "$(get-date -f yyyy-MM-dd-hh-mm-ss)_log.txt"

 Invoke-Expression  $current_plotting_command *> $home_folder/.chia/mainnet/plotter/$current_log

 "executing: $current_plotting_command logging to $current_log"

  timeout /t $wait_argument;

 $current_loop ++

} While ($current_loop -le $plots_to_run -1)
 # this script runs a string of plots -- one immideately, and then one every $delay_increment seconds
# when done it sends you an sms (you need a Twilio account for that)

####################################################################################################
# Config -- make sure you change this to your specifics.
####################################################################################################
# since location of chia executable changes with every release you need to update 
# $chia_version every time!
####################################################################################################

#how many plots?
$plots_to_run = 12

#delay (first plot will fire off in 1 second, the rest will fire $delay_increment seconds after each other
$initial_delay = 1
$delay_increment = 2400 #40 minutes

#ram and cores
$ram_buffer_size = 4000
$cores_to_use = 3

#location of the executable (you only need to change the version and your home folder -- in Windows it depends on your username)
$chia_version = "1.1.2"
$home_folder = "C:\Users\your_user_name"
$chia_executable_location = "$home_folder\AppData\Local\chia-blockchain\app-$chia_version\resources\app.asar.unpacked\daemon"


# temp drive and final drive 
# todo: add support for multiple drives 
$temp_drive_location = "h:\"
$final_drive_location = "g:\"

# End config
# If you are not gonna rip out sms functionality, there's also hardcoded config for Twilio below 
####################################################################################################

# pretty countdown timer. 
Function Sleep-Progress($seconds_to_sleep, $message){
    for ($i=5; $i -gt 1; $i–-) {  
        Write-Progress -Activity  $message -SecondsRemaining $i
        Start-Sleep 1
    }
}


#you need a twilio.com account for this to work
#send sms message with Twilio -- config hardcoded inside
Function Send-SMS($message){
    if($send_sms){

        # Twilio sms config
        $send_sms = 1
        $sid = 'your_sid'
        $token = 'your_token'
        $number = 'your_twilio_number'

        # Twilio API endpoint and POST params
        $url = "https://api.twilio.com/2010-04-01/Accounts/$sid/Messages.json"
        $params = @{ To = "+phone_number_you_are_messaging"; From = $number; Body = $message }

        # Create a credential object for HTTP basic auth
        $p = $token | ConvertTo-SecureString -asPlainText -Force
        $credential = New-Object System.Management.Automation.PSCredential($sid, $p)

        # Make API request, selecting JSON properties from response
        Invoke-WebRequest $url -Method Post -Credential $credential -Body $params -UseBasicParsing |
        ConvertFrom-Json | Select sid, body
    }

} 


#this is the main loop

$current_loop = 1
DO
{

 "Starting plot $current_loop"

  if(1 -eq $current_loop){
    $wait_argument = $initial_delay
  }
  else{
     $wait_argument = $delay_increment * ($current_loop - 1)
  }

 "Now current_loop is $current_loop and wait_argument is $wait_argument"

 cd $chia_executable_location 

 $current_plotting_command = "$chia_executable_location/chia.exe plots create -k 32 -r $cores_to_use -b $ram_buffer_size -n 1 -t $temp_drive_location -d $final_drive_location"
 
 $current_log = "$(get-date -f yyyyMMdTHHmmssffffZ)_log.txt"

 Invoke-Expression -Command  $current_plotting_command *> $home_folder/.chia/mainnet/plotter/$current_log

 "executing: $current_plotting_command logging to $current_log"


  $sleep_message = "Getting ready to launch $current_loop of $plots_to_run. Sleeping for $wait_argument seconds"

  Sleep-Progress $wait_argument $sleep_message

  "sleep over, waking up, next iteration"

 $current_loop ++

} While ($current_loop -le $plots_to_run)

"done with looping"
Send-SMS "done with looping"

bb

推荐:全球第二大交易所OKEx欧意,邀请链接: https://www.ouyi.run/join/1837888  能交易XCH,BZZ,BTC,ETH等等安全交易,新用户能开合约。
赞(0) 打赏
未经允许不得转载:Chia之家 » Chia Powershell绘图脚本,Chia Powershell P盘脚本

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

DIY Chia矿机,更便宜,更有乐趣

进入DIY矿机配置单

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏