Skip to content

Instantly share code, notes, and snippets.

@jimscarver
Last active June 13, 2023 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimscarver/84463a8d126c771b7ecc8f2de1a89902 to your computer and use it in GitHub Desktop.
Save jimscarver/84463a8d126c771b7ecc8f2de1a89902 to your computer and use it in GitHub Desktop.
: collect rev transactions to update balances.
end=${2-4ce82f16b5d214d18c4538ea5f4e7ea61e7660e2c7ce8914b68b629766c09f3c}
#TODO let latest block should not be hard coded.
latest=${1-0c436d462b09f5c2ab4ab791522729df5ec97ff994cba997e133cb32e8223d7c}
while [ $latest != $end ]; do
curl -s https://observer.services.mainnet.rchain.coop/api/block/$latest >/tmp/rho
latest=$(jq -r '.blockInfo.parentsHashList[0]' </tmp/rho)
#echo $latest
deploys=$(jq '.deploys' </tmp/rho)
#echo $deploys
i=0
while true; do
term=$(echo $deploys| jq -r '.['$i'].term')
echo "$i"
echo $term
if [ "$term" == null ]; then break; fi
echo
trans=$(echo $term|sed 's/.*"transfer\\"",//;s/).*//')
echo $trans
i=$(($i+1))
done
exit # for testing first block exit
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment