User Tools

Site Tools


guides:farming:chia_autostart_windows

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guides:farming:chia_autostart_windows [2021/09/17 12:26] vleesbanaanguides:farming:chia_autostart_windows [2024/01/05 08:07] (current) – Use Chia 2.x paths aj
Line 1: Line 1:
 ====== Chia Autostart (Windows) ====== ====== Chia Autostart (Windows) ======
  
-In this guide, we show you two methods for automatically restarting you Chia processess upon system reboot.  +In this guide, we show you two methods for automatically restarting you Chia processes upon system reboot.  
-  * Method 1: Using a batchfile and the built-in Task Scheduler +  * Method 1: Using a batchfile and the built-in Task Scheduler (recommended) 
-  * Method 2: Using nssm.cc+  * Method 2: Using nssm.cc (this uses 3rd party software, use at own risk)
  
 ====Method 1: Batchfile==== ====Method 1: Batchfile====
-This is a way to run the Chia node/farmer/harvester on a headless Windows machine. Anytime the machine reboots, this will start it all automatically.+This is a way to run the Chia node/farmer/harvester on a headless Windows machine by using Windows Task Scheduler. Anytime the machine reboots, this will start the Chia farmer automatically. Windows Task Scheduler will facilitate Chia farmer to run in a user context without having to log on to the system.  
 What you need is a batchfile in some location (eg ''C:\<Yourlocation>\BootChia.bat''). You will also need to create a task through Task Scheduler. What you need is a batchfile in some location (eg ''C:\<Yourlocation>\BootChia.bat''). You will also need to create a task through Task Scheduler.
 ===Step 1 - Creating the Batchfile=== ===Step 1 - Creating the Batchfile===
Line 12: Line 13:
 Open Notepad and copy the following lines: Open Notepad and copy the following lines:
  
-''    timeout /t 60 >NUL ''+<code - C:\Yourlocation\BootChia.bat> 
 +timeout /t 60 >NUL 
 +START "Daemon" /b /normal %LOCALAPPDATA%\Programs\Chia\resources\app.asar.unpacked\daemon\chia.exe start farmer 
 +Exit 
 +</code>
  
-''    START "Daemon" /b /normal %LOCALAPPDATA%\chia-blockchain\app-1.2.5\resources\app.asar.unpacked\daemon\chia.exe start farmer   ''    +and save in any location (eg ''C:\<Yourlocation>'') as "''BootChia.bat''". You might need to check / manually replace the pasted double quote characters in the bat file as the wiki converts them to an incompatible type it seems.
-         +
-''    Exit  '' +
- +
- +
-and save in any location (eg ''C:\<Yourlocation>'') as "''BootChia.bat''"+
  
 The script has 3 components:  The script has 3 components: 
Line 27: Line 27:
  
 __**Note:**__ __**Note:**__
-Should you ever upgrade Chia, say to version 1.2.7 then the "''app-1.2.5''" part needs to be changed to "''app-1.2.7''".+The chia.exe path was changed in a 1.6.x release to a more convenient structure where the version reference was removed from the full pathOn older client versions you will need to fetch and change the version specific path to chia.exe in the .bat file([[guides:farming:chialocation|More information]])  
 You can cause plotting to start automatically as well, visit our [[https://discord.gg/EgnjUCnCCt|discord server]] if you want to learn how.  You can cause plotting to start automatically as well, visit our [[https://discord.gg/EgnjUCnCCt|discord server]] if you want to learn how. 
  
Line 47: Line 48:
  
 Voilà, next time your PC restarts, Chia will automatically start up. Voilà, next time your PC restarts, Chia will automatically start up.
 +To ensure everything is working as intended you can open a Powershell window and run the following command to verify the farmer is processing incoming challenges correctly
 +
 +''    Get-Content ~\.chia\mainnet\log\debug.log -wait -tail 50 | Select-String "eligible"   ''   
  
 ==== Method 2 - using nssm.cc==== ==== Method 2 - using nssm.cc====
Line 54: Line 58:
   - Change Directory to the folder in 1, in our case the Downloads folder: ''cd C:\Users\<username>\Downloads\nssm-2.24\win64''   - Change Directory to the folder in 1, in our case the Downloads folder: ''cd C:\Users\<username>\Downloads\nssm-2.24\win64''
   - type ''nssm.exe'' and hit enter   - type ''nssm.exe'' and hit enter
-  - Install chia.exe as a service: ''nssm install Chia-service'' +  - Install chia.exe as a service: type ''nssm install Chia-service'' and hit enter 
-  - A window will pop up. In the "Application" tab in the "Path" field fill in the location of the chia.exe file: ''%LOCALAPPDATA%\chia-blockchain\app-1.2.5\resources\app.asar.unpacked\daemon\chia''  +  - A window will pop up. In the "Application" tab in the "Path" field fill in the location of the chia.exe file: ''%LOCALAPPDATA%\Programs\Chia\resources\app.asar.unpacked\daemon\chia.exe''  
-  - Under "Startup directory", us the the same, but without \chia ''%LOCALAPPDATA%\chia-blockchain\app-1.2.5\resources\app.asar.unpacked\daemon''+  - Under "Startup directory", us the the same, but without \chia ''%LOCALAPPDATA%\Programs\Chia\resources\app.asar.unpacked\daemon\''
   - Under "Arguments" put ''start farmer''    - Under "Arguments" put ''start farmer'' 
   - proceed to the "Logon" tab. Select "this account" and provide your username and password :!: Again a disclaimer: Third-party software, use at your own risk.    - proceed to the "Logon" tab. Select "this account" and provide your username and password :!: Again a disclaimer: Third-party software, use at your own risk. 
Line 62: Line 66:
   - Click "Install Service" and you are done.   - Click "Install Service" and you are done.
  
-Go to the Windows Start button look for the "Services" app. Here you will find Chia-service.+Go to the Windows Start button look for the "Services" app. Here you will find "Chia-service". You can rightclick and press "Start" to test if it works (make sure you have no other instances of Chia running)
  
 Now when your system reboots, chia.exe will automatically start.  Now when your system reboots, chia.exe will automatically start. 
 For more information, visit https://nssm.cc/usage and https://www.youtube.com/watch?v=96OtET8HmA0 For more information, visit https://nssm.cc/usage and https://www.youtube.com/watch?v=96OtET8HmA0
 +
 ==== Disable Windows Auto-update==== ==== Disable Windows Auto-update====
 If you want to disable Windows automatic update, you can follow this guide: https://www.windowscentral.com/how-stop-updates-installing-automatically-windows-10. If you want to disable Windows automatic update, you can follow this guide: https://www.windowscentral.com/how-stop-updates-installing-automatically-windows-10.
  
 Note that stalling updates for too long is not recommended (there's a reason for the updates). Note that stalling updates for too long is not recommended (there's a reason for the updates).
guides/farming/chia_autostart_windows.1631881581.txt.gz · Last modified: 2021/09/17 12:26 by vleesbanaan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki