This guide describes how to update the block height numbers on the REV issuance timer to be published on https://developer.rchain.coop/token-swap.
Step-by-step guide
- Use the bash script shown below. Save as a .txt file to your local environment (ex blocks.txt)
In the terminal make the file executable
chmod 755 blocks
Execute the script with the specification of 30 days before today and 90 days after today
./blocks 30 90
After the script runs, find the new numbers in the log
Example
Timer bash script
#!/bin/bash block=$((curl etherscan.io 2> /dev/null) | tr '<' '\n' | tr '>' '\n' | grep -e ^[0-9][0-9]*$) # echo block=$block rate=$((curl etherscan.io 2> /dev/null) | tr '<' '\n' | tr '(' '\n' | grep [0-9]s\) | sed -n "s/^\([0-9][0-9].[0-9]\).*$/\1/p") # echo rate=$rate s/blk now=$(date +%s) let seconds=1543968000-now # echo seconds till 2018-12-05=$seconds openWindow=$1 let afterSec=seconds-\(openWindow*86400\) closeWindow=$2 let beforeSec=seconds+\(closeWindow*86400\) after=$(echo $block+\($afterSec/$rate\) | bc -l | sed -n "s/^\([0-9]*\).*$/\1/p") echo $after before=$(echo $block+\($beforeSec/$rate\) | bc -l | sed -n "s/^\([0-9]*\).*$/\1/p") echo $before