PIVX CLI: Easily check how many coins were minted

in #pivx7 years ago (edited)

Execute this once~/.pivx/pivx-cli getbalance > ~/.pivx/balance. Then, add the alias below to ~/.bash_aliases.

alias pivx-minted='pivx-minted'
function pivx-minted() {
  prev=`head -n 1 $HOME/.pivx/balance`;
  curr=`$HOME/.pivx/pivx-cli getbalance`;
  echo $curr > $HOME/.pivx/balance;
  new=$(bc <<< $curr-$prev);
  echo 'current: '$curr;
  echo '   last: '$prev;
  echo "    new: $new";
}

Load the new alias with source ~/.bash_aliases. Usage example:

pivx-minted
current: 102.49170039
   last: 100
    new: 2.49170039

It tells you how many coins were minted since the last time you checked. If you immediately check again the result will be zero until new coins are minted.

Coin Marketplace

STEEM 0.24
TRX 0.21
JST 0.036
BTC 98033.04
ETH 3424.27
USDT 1.00
SBD 3.36