INTRODUCTION

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 walletpassphrase console 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

Arguments:

  1. “passphrase” (string, required) The wallet passphrase
  2. timeout (numeric, required) The time to keep the decryption key in seconds; capped at 100000000 (~3 years).
  3. 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.

  1. Create a new task for start-zap-pulsar.bat that runs at the logon of any user.
  2. 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.