04 PLSR Supplemental Information - Pulsar-Coin/Pulsar-Coin-Cryptocurrency GitHub Wiki

๐Ÿ–ฅ Dedicated Hardware

The foundation for an optimal PLSR wallet begins with selecting computer hardware dedicated to the wallet environment. When it comes to wallet optimization, better and upgraded hardware on a dedicated computer produces greater performance results than wallet configuration tweaks. In light of PLSR's developing faster blockchain speed, users might consider "future proofing" their hardware within their budget.

  • 8+ Multi-Core processor;
  • 2TB+ NVMe storage;
  • 16GB+ Ram;
  • UPS for the modem and the router;
  • UPS for the computer hosting the PLSR wallet.

Some users even host multiple dedicated computers in their homelab with each computer running its own dedicated instance of the PLSR wallet.

PLSR Multiple Dedicated Computer Example:

Multiple Pulsar Coin wallets running on unique computers using connect= to interface with other wallets that have internet access

  • Machine 1: UNENCRYPTED WALLET.DAT; NO BALANCE; PORT 5995 (TCP) OPEN.
    addnode=<MACHINE 2 LAN IP>
    addnode=<MACHINE 3 LAN IP>
  • Machine 2: ENCRYPTED WALLET.DAT; MINING BALANCE.
    connect=<MACHINE 1 LAN IP>
    connect=<MACHINE 3 LAN IP>
    Mixer Hint: Transfer the desktop mining wallet balance as a lump sum to your Discord wallet, then transfer the balance from the Discord wallet to your desktop staking wallet.
  • Machine 3: ENCRYPTED WALLET.DAT; STAKING BALANCE.
    connect=<MACHINE 1 LAN IP>
    connect=<MACHINE 2 LAN IP>

Operating System

Whereas the PLSR wallet runs on both Windows and Linux machines, Linux tends to be a community favorite because of its free price point, its proven security among administrators, and its low resource requirements. Newcomes to Linux often observe that operating a computer with a Linux operating system provides a graphical user interface ("GUI") similar to Windows, so if you are accustomed to Windows, transitioning to Linux will provide a similar desktop experience. For the purpose of hosting the PLSR wallet on a dedicated machine, Linux Lite works well.


๐Ÿ–ง PLSR Node Clustering

A node on the Pulsar network is simply an instance of the Pulsar Wallet running on computer hardware. When multiple nodes, and thus multiple dedicated computers, are present on the same internal homelab network, the user's router assigns each dedicated computer a unique internal local area network ("LAN") address, such as 192.168.1.xx1, 192.168.1.xx2, and so on. Now, the external IP address for each of these computers will be same, unless the user's ISP has assigned multiple static IPs to the user's account and the user provisions these static IPs correctly to the dedicated machines in the internal network.

Proxmox Cluster Example

18 PLSR Node Cluster

Proxmox (Hardware 1 OS - ex: 192.168.1.101)
|
+- Linux Lite (VM1 - ex: 192.168.1.102)
|โ€ƒ |
|โ€ƒ+- PLSR Wallet 1
Proxmox (Hardware 2 OS - ex: 192.168.1.103)
|
+- Linux Lite (VM2 - ex: 192.168.1.104)
โ€ƒ  |
โ€ƒ +- PLSR Wallet 2

The Promox Virtual Environment assists users in managing multiple Pulsar nodes present on the user's internal network. Proxmox is free and is based on Debian Linux and installs on all machines in the user's homelab as step one. During the Proxmox installation process, users will be asked to assign a dedicated LAN IP address and set a password for each machine (accessible on port 8006 on the home network). When multiple Promox installations are present on the same LAN, Proxmox Clustering enables each dedicated machine to join the cluster, which allows users to manage each machine from one desktop interface using a web browser. Users can then create a Virtual Machine ("VM") using Linux Lite for each dedicated computer. Once Linux Lite has been installed on each VM, users can then install the Pulsar Wallet for Linux on each dedicated machine.

Note

  • Users are recommended to educate themselves on Proxmox though forum searches and YouTube tutorial videos, which are beyond the scope of this presentation.

๐Ÿ•œ Auto-Start Script

Tip

  • Remember to configure your BIOS settings to "POWER ON" your machine after power has been restored.

Warning

  • This is an unofficial and unsupported script shown for example purposes.

Whether you are using Windows or Linux, it is important to setup your operating system to open the Pulsar Wallet, automatically, after a restart. Windows uses the "Task Scheduler" and Linux Lite uses "Sessions and Startup - Application Autostart." Rather than starting the pulsar-qt binary directly, users can opt to execute a Windows .bat file or a Linux .sh bash file that will in turn automatically load the pulsar-qt upon a computer restart. Starting the wallet from a script rather than from the pulsar-qt binary itself enables the user to execute commands to the wallet upon loading, such as zapwallettxes.

Of course, these example scripts must be edited to reflect the user and the install location of the wallet binary and data directory.

Windows auto-start PLSR wallet after reboot

start-zap-pulsar.bat

@cd /d "%~dp0"
start "Start-Zap Pulsar" /b /High "C:\Program Files\Pulsar\pulsar-qt.exe" -datadir=C:\Users\<user>\AppData\Roaming\Pulsar -zapwallettxes
exit

For Linux, right click on the .sh script name, click Properties, click Permissions, then tick box Allow this file to run as a program.

Linux auto-start PLSR wallet after reboot

start-zap-pulsar.sh

#!/bin/bash
/home/<user>/Desktop/Pulsar/pulsar-qt -datadir=/home/<user>/.pulsar/ -zapwallettxes

๐Ÿ”‘ Auto-Unlock Script

Warning

  • This is an unofficial and unsupported script shown for example purposes.

Caution

It is indeed possible to run a .bat file or a .sh script at regular intervals to unlock the wallet for staking. However, since the unlocking passphrase will be stored in plaintext, it is recommended that users proceed at their own risk should they decide to create auto-locking and auto-staking scripts. Using a dedicated machine for the sole purpose of hosting the Pulsar wallet is recommended to prevent malware and viruses from finding their way to the host machine. Additionally, preventing others from accessing these dedicated machines is important because co-workers or family members might install infected software without the operator's knowledge. Checking email, playing games, downloading software, and browsing the internet is not advised on these dedicated machines to limit potential exposure.

When it comes to creating a script that will auto-unlock the wallet for staking, it is important to keep in mind that it will take different computer hardware different amounts of time to load the wallet fully before the wallet is able to accept the unlock and stake command from the script. Therefore, a user wishing to auto-unlock and auto-stake their wallet should do so in a script that executes every 30m - 1h. For this purpose, Windows uses the task scheduler and Linux uses the crontab.

Windows auto-unlock PLSR wallet every 30m - 1h

unlock-pulsar.bat

@cd /d "%~dp0"
start "Stake Pulsar" "C:\Program Files\Pulsar\daemon\pulsar-cli.exe" -datadir=C:\Users\<user>\AppData\Roaming\Pulsar walletpassphrase "<passphrase>" 94608000 true
exit

Linux auto-unlock PLSR wallet every 30m

unlock-pulsar.sh

#!/bin/bash
/home/<user>/Desktop/Pulsar/pulsar-cli -datadir=/home/<user>/.pulsar/ walletpassphrase "<passphrase>" 94608000 true

Linux crontab -e from terminal

*/30 * * * * /home/<user>/.pulsar/pulsar-scripts/unlock-pulsar.sh

Setting up your wallet to automatically load after a reboot and configuring either the Windows task manager or the Linux contab to execute the auto-staking script will help ensure that your wallet is available to participate in Pulsar Coin's PoS rewards mechanism. Due to the unpredictable nature of a power loss or a mandatory system restart, you will be doing your part to ensure your wallet's high availability. We do not necessarily recommend that all users implement auto-unlocking due to the security vulnerability of saving the wallet's passphrase in a plain-text file. However, using a secure and dedicated machine to host the Pulsar wallet is the first step of creating a safe and secure environment for both your wallet and the scripts.


๐Ÿ” Ensure Wallet Encryption

When the Pulsar Wallet runs for the first time, the wallet will create a new, blank, and unencrypted wallet.dat file. Those wanting to participate in Pulsar Coin's Proof-of-Stake ("PoS") rewards must encrypt their wallet.dat. The user's chosen passphrase should be written down and stored in a safe location. After the user inputs a passphrase, the wallet will shutdown and the user will have to restart their wallet so that the encryption takes effect.

Caution

  • The team cannot offer support for a lost or forgotten passphrase.

Pulsar Coin Wallet Encryption


๐Ÿ”“ Unlocking the Wallet

After the wallet restarts, the wallet will notify the user that Staking is suspended due to locked wallet. To unlock the wallet in a safe and secure manner, the user will click Help - Debug window - Console and type the command walletpassphrase "<pw>" 94608000 true.

Unlocking the PLSR wallet for PoS Rewards


๐Ÿ—„ Backup the Wallet

A user may backup their wallet anytime that the PLSR wallet is running. To do so, the user will click on Help - Backup Wallet. The user will be prompted to select a location for the backup file to be created; it is recommended to store wallet backups on a removeable thumb drive - or multiple removable thumb drives and to keep the thumb drives in a safe and secure location.

Tip

  • After selecting the location of the backup, it is important to use a descriptive naming structure for the backup file.
  • Instead of using a generic name such as wallet.dat for the backup, use a descriptive name such as plsr-wallet-<address>.dat as the file name.
  • Store this descriptive name in a folder named PLSR Wallet Backups, for example.
  • Using descriptive names makes wallet management all the easier.
  • IF YOUR WALLET IS RUNNING NORMALLY, BACK IT UP NOW!

Caution

  • The team cannot offer support for a lost or corrupted backup file.

Backup the PLSR wallet


๐Ÿ”ฌ Software Tweaks

pulsar.conf can be edited to accomodate a Pulsar Node cluster and implement other user configurations. Editing the pulsar.conf will override the default hardcoded values found in the wallet's source code, therefore, edits to the pulsar.conf file should be taken seriously and with the upmost of care. If you are having difficulties with your wallet installation, you may backup or rename your existing pulsar.conf file before implementing default values for it as part of the Pulsar Wallet troubleshooting process. For changes to pulsar.conf to take effect, a wallet restart is necessary.

rpcuser=username
rpcpassword=password
server=1
listen=1
daemon=1
port=5995
rpcport=5996
rpcbind=127.0.0.1
rpcallowip=127.0.0.1

๐Ÿ’ข PLSR Wallet Crashes at Load

Before you begin troubleshooting why your Pulsar Wallet installation crashes during loading, you must backup your wallet.dat file, which can be found in the wallets folder inside the data directory. DO NOT OVERRIDE PREVIOUS BACKUPS OF WALLET.DAT in case your existing wallet.dat has become corrupted and is the reason for the program crashing. This is why it was stated earlier to create a backup upon first loading the wallet! The procedure for backing up the wallet.dat file was covered earlier in this guide.

Now, take your time and move slowly. After you have made sure to have a secure wallet backup on hand, preferrably on multiple removable thumb drives, the recommended procedure is to purge the Pulsar program and all related files from your system. This means removing Pulsar's data directory, which include the blocks, chainstate, and wallets directories.

Warning

  • Ensure that you do not have other instances of the Pulsar wallet elsewhere on your system in different directories.
  • The rule of thumb is to operate one unique instance of the Pulsar wallet on each unique piece of computer hardware.

๐Ÿ”จ 10 Steps to Fix a Broken Wallet

  1. Download the latest version of the Pulsar wallet;
  2. Download the latest blocks and chainstate snapshot;
  3. Extract the Pulsar binaries and double click pulsar-qt;
  4. Stop/close/shutdown the wallet after about 10 seconds.
  5. Browse to Pulsar's data directory;
  6. Remove the blocks and chainstate folder;
  7. Extract the latest blocks and chainstate snapshot and place in the data directory;
  8. Restore your wallet backup from the thumbdrive back to your PC; rename backup file to wallet.dat and override the existing wallet.dat in the wallets directory as the program will create a new, blank, and fresh wallet.dat upon first load;
  9. Verify that pulsar.conf matches the above example; and
  10. Open the wallet program and wait for the program to syncronize.

๐Ÿงช Wallet Performance

Input Timer

Found in debug.log

Pulsar Coin Wallet Measure PoS Performance with Input Timer

The input timer provides automatic notice in debug.log when input submission times for PoS exceed 1000ms or 1s while the wallet is unlocked and staking. No user changes to the pulsar.conf are necessary for this to occur. The notice in debug.log is meant to alert users to optimize their wallet in order to lower their timer value. Lower values for the input timer are always better. Input timer values exceeding 1000ms or 1s disqualify the input from participating in PoS.

Force activate

rpcuser=username
rpcpassword=password
server=1
listen=1
daemon=1
port=5995
rpcport=5996
rpcbind=127.0.0.1
rpcallowip=127.0.0.1

debug=bench

Users may add debug=bench to pulsar.conf to force activate input timer values to render in debug.log after a wallet restart, however, debug.log will quickly grow in size as a result. After benchmarking the wallet's performance for several minutes, remove debug=bench from pulsar.conf and restart the wallet again to deactivate forced activation.

Warning

We have found a direct positive relationship between a large number of transactions in wallet.dat and a slower speed of the input timer. This is to say that as the number of transactions increases, the input timer's delay speed also increases -- meaning that the wallet's performance decreases. Of course, more powerful CPUs will allow for many more transactions before impacting the input timer. Also, be aware that if you are running a mining program on the same machine operating the Pulsar wallet program, the CPU demands of the mining program will increase the wallet's input timer -- closing out the mining program will lower the wallet's input timer value. Even if you specify CPU affinity for both the mining program and the wallet program, the use of a mining program increases the wallet's input timer.

Lower the Input Timer

Method 1: HW Upgrade

Sluggish performance might reflect the hardware running the Pulsar wallet. For example, running the same wallet.dat on two different computers using two different CPUs is likely to change the value of the input timer. Operating the Pulsar wallet on dedicated computer hardware using NVMe storage with a multi-core processor is recommended.

Method 2: Consolidation

Note

  • Click Send.
  • Click Inputs...
  • This shows how many inputs each address contains.
  • To consolidate inputs, simply use your own address as the payment address. You are essentially sending your own coins back to yourself. For example, if your total bag size is 500,000 PLSR stored in 2938 inputs containing various amounts, sending 100,000 PLSR back to yourself 5 times would consolidate 2938 inputs down to 5 inputs.
  • Alternatively, you can send your whole bag to your Discord wallet address and then use the Discord wallet to send chunks of your bag back to your PLSR desktop wallet.

Pulsar Wallet Input Consolidation

Each deposit to a wallet address, whether from mining or from PoS, adds 1 input to the wallet.dat. Over a period of days, weeks, and months the number of inputs increases. Mining pools offering 1 hour payouts especially compound this issue since there are 24 hours in a day, 168 hours in a week, 730 hours in a month, and 8760 hours in a year.

Method 3: New wallet.dat

The file size of a new wallet.dat is about 1MB and the file size of a wallet.dat containing 4000 inputs is about 3MB. Even though input consolidation reduces the number of inputs, it will not reduce the actual size of the wallet.dat file itself because wallet.dat contains the transaction history of all the addresses contained therein. As the file size of wallet.dat grows over time, it will become less and less efficient. If input consolidation fails to reduce input timer values in a meaningful way, then it is recommended to start over with a new wallet.dat and seed it with the funds from the old wallet.dat.

Note

  • Backup the old wallet.dat and use a file name describing it as such;
  • Send your entire balance from the PLSR desktop wallet to your Discord wallet address;
  • Stop/shutdown/close the PLSR desktop wallet;
  • Delete the old wallet.dat and restart the wallet;
  • Encrypt the new wallet.dat and restart the wallet;
  • Go about creating a single receiving address or multiple addresses for the new wallet.dat;
  • Create a backup of the new wallet.dat using a descriptive naming scheme.
  • Finally, send chunks of your bag hosted in your Discord wallet to the new address(es) in the PLSR desktop wallet.

๐Ÿ” Orphan Transactions

All active staking wallets are constantly submitting hash values to the blockchain and are constantly competing with one another for PoS rewards. Wallets with higher staking balances increase the the likelihood of guessing the correct hash value and winning the PoS Block. However, when 2 or more wallets correctly guess the hash value at the same time, the fastest wallet with the correct answer wins the block. (This is why it is important to ensure that you are connected to multiple peers with a low ping value.) Other slower connection wallets submitting the correct hash value at the same time do not win the block. Moreover, the input from these slower wallets that have guessed the correct hash will be locked in the wallet as an Orphan Transaction until the user either manually abandons the orphan or uses a script to auto-abandon orphaned transactions.

Note

  • Click on Transactions to see a list of all wallet transactions.
  • Identify lines of orphaned transactions: icon will be a circled question mark, hovering the mouse over will reveal Generated but not accepted, the block reward will appear in brackets [45.000000], and the text color of an orphaned transaction will look different than other accepted transactions.
  • Right click on the line containing the orphaned transaction to reveal the command menu.
  • Click on Abandon transaction to clear out the orphan and return the PLSR locked in the input back to the wallet balance.
๐Ÿ”Ž CLICK HERE TO SEE SCREENSHOTS OF IDENTIFYING AND ABANDONING ORPHANED TRANSACTIONS

Identify Orphaned Transactions in the Pulsar Coin wallet.
Manually abandon orphaned transactions in the Pulsar Coin wallet

๐Ÿ’ Auto abandon Windows script

Warning

  • This is an unofficial and unsupported script shown for example purposes.

Caution

  • Malicious users can use scripts to steal your coins.
  • Do not run scripts you find on the internet unless they are vetted for safety.
  • Scripts that use the following CLI commands are immediately suspect: sendmany, sendrawtransaction, and sendtoaddress.

Toe Wallet Monitor for Pulsar Coin

Preparation

  • Use of the auto-abandon orphans script requires the user to create the pulsar-scripts folder in %appdata%\Pulsar. After creation, the user should be able to access %appdata%\Pulsar\pulsar-scripts\. Both files abandon-orphans.bat and toe-wallet-monitor-v1.1.ps1 will be stored in this pulsar-scripts folder.
  • Users must ensure that pulsar-cli.exe resides in the C:\Program Files\Pulsar\daemon folder.
  • User will execute the .bat file, not the .ps1 directly.

Files

abandon-orphans.bat
ATTENTION: edit this .bat file to reflect correct user name.

@echo off
set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/c cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -NonInteractive -NoProfile -File "C:\Users\<user>\AppData\Roaming\Pulsar\pulsar-scripts\toe-wallet-monitor-v1.1.ps1"

Important

  • The full source code to the script is available for inspection.
  • This script makes use of the following CLI commands: getwalletinfo, listtransactions, and abandontransaction.
  • This script will automatically create the transactions.json file in the pulsar-scripts directory.

toe-wallet-monitor.ps1

###
# EDIT THIS NUMBER. MUST BE > 0.
$previousDays = 7; # CHANGE THIS VALUE TO DECIDE HOW FAR YOU WANT TO GO BACK AND EVALUATE.
Set-Alias pulsar-cli "C:\Program Files\Pulsar\daemon\pulsar-cli.exe"; # CHANGE TO REFLECT LOCATION OF YOUR pulsar-cli.exe FILE
$scriptDir = "$env:APPDATA\Pulsar\pulsar-scripts"; # Place this Powershell file in a the "pulsar-scripts" directory inside your "%APPDATA%\Pulsar" directory.
##

cls
echo "";
echo "";
echo "        _____              _";          
echo "       /__   \ ___    ___ ( )___ ";
echo "         / /\// _ \  / _ \|// __|";
echo "        / /  | (_) ||  __/  \__ \";
echo "        \/    \___/  \___|  |___/";                      
echo "                   --";
echo "Pulsar Coin (`"PLSR`") Wallet Monitor v1.1";
echo "==========================================";
echo "";
echo "";

$numTransactions = ($previousDays * 200); # NOTE: $numTransactions will need to increase as $previousDays increases!
echo "[$(Get-Date)]    API: Querying xeggex exchange" ;
$xeggexAPI = Invoke-WebRequest -Uri https://xeggex.com/api/v2/market/getbysymbol/PLSR_USDT | Select-Object -ExpandProperty Content | ConvertFrom-Json;
$xeggexAPI.updatedAt = [int]$xeggexAPI.updateAt;
$xeggexAPI.primaryUsdValue = [decimal]$xeggexAPI.primaryUsdValue;
$xeggexAPI.primaryCirculation = [decimal]$xeggexAPI.primaryCirculation;
$xeggexAPI.lastPrice = [decimal]$xeggexAPI.lastPrice;

echo "[$(Get-Date)]    CLI: Querying 'getwalletinfo' information" ;
$pulsarWalletInfo = & pulsar-cli getwalletinfo | ConvertFrom-Json;
# balance
# unlocked_staking_only (true or false)
echo "[$(Get-Date)]    CLI: Saving $previousDays day(s) of transactions to file" ;
$grabTransactions = ((& pulsar-cli listtransactions "*" $numTransactions)) | Out-File -FilePath $scriptDir\transactions.json;

$tFile = Get-Content -Raw -Path $scriptDir\transactions.json | ConvertFrom-Json;

$numOrphans = 0;
$numStakesInProgress = 0;
echo "[$(Get-Date)]    CLI: Running orphan 'abandontransaction' " ;
$tFile | Select-Object -Property category,txid | ForEach-Object {
    if ($_.category -eq "stake-orphan") { 
        $numOrphans = ($numOrphans + 1);
        pulsar-cli abandontransaction $_.txid; 
        }

    if ($_.category -eq "stake") { 
        $numStakesInProgress = ($numStakesInProgress + 1);
        }
}

if ($numOrphans -eq 0) { echo "[$(Get-Date)] STATUS: $numOrphans transaction orphans found "; }
if ($numOrphans -ge 1) { echo "[$(Get-Date)] STATUS: $numOrphans orphan(s) abandoned."; 
    echo "                              |";
    echo "                              | RESTART Wallet with '-zapwallettxes' to remove this notice. ";
    echo "                              |"; }
if ($numStakesInProgress -gt 0) { echo "[$(Get-Date)] NOTICE: $numStakesInProgress immature stake reward(s) may temporarily decrease confirmed wallet balance"; }

$walletUnlocked = $pulsarWalletInfo.unlocked_staking_only;
if ($walletUnlocked -eq 1) { echo "[$(Get-Date)] WALLET: UNLOCKED" }
if ($walletUnlocked -eq 0) { 
    echo "[$(Get-Date)] WARNING: WALLET IS LOCKED.";
    echo "                            |";
    echo "                            | To UNLOCK for STAKING ALONE: Click Help -> Debug Window -> Console";
    echo "                            | Then type command: walletpassphrase `"<PW>`" 94608000 true";
    echo "                            |";
}

$pulsarBalanceFormatted = ($pulsarWalletInfo.balance -as [decimal]).ToString('N6');
$pulsarCirculation = ($xeggexAPI.primaryCirculation -as [decimal]).ToString('N6');
$pulsarCirculationUSD = ((($xeggexAPI.primaryCirculation * $xeggexAPI.primaryUsdValue) -as [decimal]).ToString('N6')) ;
$walletValueUSD =  ($pulsarWalletInfo.balance * $xeggexAPI.primaryUsdValue);
$walletValueUSD = ($walletValueUSD -as [decimal]).ToString('N6');
$pulsarOwnedCirculatingSupply = $($pulsarOwnedCirculatingSupply -as [decimal]).ToString('N6');
echo "";
echo "--";
echo "||";
echo "|| PRICE PER COIN: `$$($xeggexAPI.primaryUsdValue) USD";
echo "||    CIRCULATION: $pulsarCirculation PLSR (`$$pulsarCirculationUSD USD)";
echo "||    THIS WALLET: $pulsarBalanceFormatted PLSR (`$$walletValueUSD USD)";
echo "||";
echo "--";
echo "";
##############################################################################

echo "PROOF OF STAKE (`"PoS`") FOR $previousDays PREVIOUS DAYS:";

$totalNumberOfPoSs = 0;
$totalPulsarPoSAmt = 0;

for ($i = 0; $i -le $previousDays; $i++) {      

    $num = 0;
    $pulsarPosAmt = 0;
    $pulsarPoSAmtUSD = 0;

    if ($i -eq 0) { $daysAgoStart = (Get-Date '00:00:00').AddDays(-$i); $daysAgoEnd = (Get-Date).AddDays(-$i); }
    if (($i -lt $previousDays) -and ($i -ne 0)) { $daysAgoStart = (Get-Date '00:00:00').AddDays(-$i); $daysAgoEnd = (Get-Date '23:59:59').AddDays(-$i); }
    if (($i -eq $previousDays) -and ($i -ne 0)) { $daysAgoStart = (Get-Date '00:00:00').AddDays(-$previousDays); $daysAgoEnd = (Get-Date '23:59:59').AddDays(-$previousDays); }
    
    $daysAgoStartUnixTime = [System.Math]::Truncate((Get-Date -Date $daysAgoStart -UFormat %s));    
    $daysAgoEndUnixTime = [System.Math]::Truncate((Get-Date -Date $daysAgoEnd -UFormat %s));
        
    $tFile | Select-Object -Property category,amount,time | ForEach-Object { 
        if (($_.category -eq "stake-mint") -and ($_.time -ge $daysAgoStartUnixTime) -and ($_.time -le $daysAgoEndUnixTime)) 
        {         
            $num = $num + 1;
            $pulsarPoSAmt = ($pulsarPoSAmt + $_.amount);
        }   
     }

     $pulsarPoSAmtUSD = ($pulsarPoSAmt * $xeggexAPI.primaryUsdValue);
     $pulsarPoSAmtUSD = $($pulsarPoSAmtUSD -as [decimal]).ToString('N2');   
          
     if ($i -eq 0) # Don't count today's PoS rewards in the total amount for previous days as today's number might change.
     {         
        $totalNumberOfPoSs = 0;
        $totalPulsarPoSAmt = 0;
        echo "--";  
        echo "|| TODAY: $num Blocks; +$pulsarPoSAmt PLSR (`$$pulsarPoSAmtUSD USD)";
        echo "--"
     }
     if ($i -ne 0)
     {
        $totalNumberOfPoSs = ($totalNumberOfPoSs + $num); # HOLD UNTIL END.
        $totalPulsarPoSAmt = ($totalPulsarPoSAmt + $pulsarPoSAmt); #HOLD UNTIL END 
        echo "[$((Get-Date).AddDays(-$i).ToString("MM/dd/yyyy"))] Blocks: $num. [+$pulsarPoSAmt PLSR (`$$pulsarPoSAmtUSD USD)]" ;
     }


}

$pulsarBalancePerPoS = (($pulsarWalletInfo.balance / $totalNumberOfPoSs)*$previousDays);
$pulsarBalancePerPoS = [math]::round($pulsarBalancePerPoS,6);
$pulsarBalancePerPoS = $pulsarBalancePerPoS.ToString('N6');

echo "--";
echo "|| TOTAL: $previousDays PREVIOUS DAYS :: $totalNumberOfPoSs BLOCKS :: AVG 1 PoS BLOCK PER $pulsarBalancePerPoS PLSR";
echo "--";

Sleep -Seconds 30
โš ๏ธ **GitHub.com Fallback** โš ๏ธ