Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- DCRCTL=dcrctl
- POOLTKSIZE=540
- SOLOTKSIZE=296
- POOLFEEPERCENT=0.05
- HEIGHT=$( $DCRCTL getblockcount )
- WINDOWS=$(($HEIGHT/144+1))
- #BLOCKS=$(($HEIGHT+1))
- BLOCKS=0
- FEESTATS=$( $DCRCTL ticketfeeinfo $BLOCKS $WINDOWS )
- #FEESTATS=`cat data.json`
- FEETYPE=mean
- FEELIST=$(echo $FEESTATS | jq -r '.feeinfowindows[] | (.startheight|tostring) +":" + (.'$FEETYPE'|tostring)')
- echo "DATE TIME;BLOCK;PRICE;SOLOTKFEE;POOLTKFEE;SUBSIDYMIN;SUBSIDYAVG;SUBSIDYMAX"
- for PAIR in $FEELIST; do
- BLOCK=$( echo $PAIR | awk -F: '{print $1}' )
- FEE=$( echo $PAIR | awk -F: '{print $2}' )
- SUBSIDYMIN=$( dcrctl getblocksubsidy $(($BLOCK+256)) 1 | jq '.pos / 100000000' )
- SUBSIDYMAX=$( dcrctl getblocksubsidy $(($BLOCK+256+40960)) 1 | jq '.pos / 100000000' )
- SUBSIDYAVG=$( dcrctl getblocksubsidy $(($BLOCK+256+288*28)) 1 | jq '.pos / 100000000' )
- HASH=$( dcrctl getblockhash $BLOCK )
- BLOCKDATA=$( dcrctl getblock $HASH )
- TIME=$( echo $BLOCKDATA | jq -r '(.time|strftime("%Y-%m-%d %H:%M:%S"))' )
- PRICE=$( echo $BLOCKDATA | jq -r '.sbits' )
- SOLOTKFEE=$( echo "[ $FEE , $SOLOTKSIZE ]" | jq '.[0] * .[1] / 1000' )
- POOLTKFEE=$( echo "[ $FEE , $POOLTKSIZE ]" | jq '.[0] * .[1] / 1000' )
- echo "$TIME;$BLOCK;$PRICE;$SOLOTKFEE;$POOLTKFEE;$SUBSIDYMIN;$SUBSIDYAVG;$SUBSIDYMAX"
- done
Advertisement
Add Comment
Please, Sign In to add comment