Adapt compareMass.sh for non cache

This commit is contained in:
poka 2020-09-24 21:04:58 +02:00
parent d1d99c1655
commit 80a468b537
1 changed files with 2 additions and 1 deletions

View File

@ -3,7 +3,8 @@ source .env
day=$1
[[ -z $day ]] && day=$(jq .[].date db/daily.json | wc -l)
bloc=$(grep -n . db/debug/udblocs | grep -E "^$day:" | cut -d: -f2)
#bloc=$(grep -n . db/debug/udblocs | grep -E "^$day:" | cut -d: -f2)
bloc=$(curl -s ${DUNITER}/blockchain/with/ud | jq '.result.blocks[]' | grep -n . | grep -E "^$day:" | cut -d: -f2)
chainData=$(curl -s ${DUNITER}/blockchain/block/$bloc | jq '.membersCount,.monetaryMass')
chainMass=$(tail -n1 <<<"$chainData" | xargs -i echo "scale=2; {}/100" | bc)
chainMbr=$(head -n1 <<<"$chainData")