Last active
March 24, 2020 06:09
-
-
Save strophy/8adafd6a59b0ca46accc12ad85dd0496 to your computer and use it in GitHub Desktop.
Calculate timestamp, block, blockhash and coinbase payout amount for all Dash superblocks to date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
height=$(dash-cli getblockcount) | |
for ((block=332320;block<height;block+=16616));do | |
blockhash=$(dash-cli getblockhash $block) | |
txhash=$(dash-cli getblock $blockhash|jq -r '.tx[0]') | |
time=$(dash-cli getblock $blockhash|jq -r '.time') | |
time=$(TZ=GMT date -d @$time +"%Y%m%d%H%M") | |
amount=$(dash-cli getrawtransaction $txhash 1|jq '.vout|map(.valueSat)|add') | |
amount=$(echo "scale=8;$amount / 100000000"|bc) | |
echo -e "date=$time\tblock=$block\ttxid=$txhash\tsum_dash=$amount" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment