Unlocking and running the Pulsar wallet on your Windows desktop means inevitably dealing with Windows updates. Sometimes, your computer will need to restart in order to finish updating. Using a few .bat files through Windows Task Manager will ensure that you do not miss out on proof of stake rewards for hours or even days. However, unlocking the Pulsar wallet in an automated fashion carries benefits as well as risks. Combining the information presented here along with the information found in the post about Auto-Abandon Pulsar Transaction Orphans Powershell Script will improve automated Pulsar wallet management once the risks have been identified.
UNLOCKING RISKS WITH USING .bat AUTOMATION
We begin with the walletpassphraseconsole command. Typing help walletpassphrase in the console reveals:
walletpassphrase “passphrase” timeout stakeonly
Stores the wallet decryption key in memory for ‘timeout’ seconds. This is needed prior to performing transactions related to private keys such as sending pulsar
“passphrase” (string, required) The wallet passphrase
timeout (numeric, required) The time to keep the decryption key in seconds; capped at 100000000 (~3 years).
stakeonly optional true/false allowing only block staking.
Basically, the risk here is that your password needs to be stored in the .bat file in order to perform auto-unlocking for staking. Using an unlocking .bat file means that anyone will be able to view the wallet’s password without much effort just from viewing the .bat file. For this reason, it is recommended that you use .bat files on a secure system or even host your wallet on a dedicated and secured MiniPC.
TWO .bat FILES ARE NEEDED
Just make sure to change these .bat files to reflect the proper path, i.e., the username, and be sure to type in your wallet’s password in the staking .bat file.
Copy to Clipboard
The start-zap-pulsar.bat file loads and zaps the wallet — meaning that this .bat file loads the wallet in such a fashion that it removes orphans from your tansaction history. Since the time it takes to zap the wallet varies from system to system, it is recommended that you use a stopwatch to see how long it takes for the wallet to fully load. Systems with more powerful CPUs will load the Pulsar wallet in less time; systems with less powerful CPUs will take longer to load the Pulsar wallet.
Copy to Clipboard
Now you can see why I made it a point to identify the risk in using a .bat file to auto-unlock the wallet for staking. Remember: Ensure that your Pulsar wallet environment is secure!
CALLING THE .BAT FILES FROM WINDOWS TASK SCHEDULER
Since we will be using 2 .bat files, we will create two tasks.
Create a new task for start-zap-pulsar.bat that runs at the logon of any user.
Create a new task for stake-pulsar.bat after X mins have elapsed after the logon of any user. (This is why I had you use a stopwatch earlier.)
After rebooting for Windows Updates and after Windows restarts because of a power loss, your wallet will auto-restart and clean itself. Then, after your wallet has fully loaded, it will auto-unlock to earn staking rewards.
Toe hails from West Texas, USA and contributes ideas to the Pulsar Team on a regular basis. All articles, opinions, and information appearing on this website reflect the personal effort of the author and may not necessarily be endorsed by Pulsar Coin or the Pulsar Team. All content published here is for informational purposes only; you should not construe any such information or other material as legal, tax, investment, financial, or other advice. Find Toe in the Pulsar Discord.