Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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. Once the timer launches, the block height numbers will be updated on a weekly cadence.

Step-by-step guide

  1. Use the bash script shown below. Save as a .txt file to your local environment (ex blocks.txt)
  2. In the terminal make the file executable

    chmod 755 blocks
  3. Execute the script with the specification of 30 days before today and 90 days after today

    ./blocks 30 90
  4. After the script runs, find the new numbers in the log

  5. Use these numbers to update the numbers on the timer.

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



  • No labels