From 288e24bcd9c1905bc46a5bc97247bc6c9f642634 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 18 Dec 2021 04:43:41 +0200 Subject: Enter script - Gets the ZLATEST and scrolls back up to the first ever block - Dry run script, just scrolls the chain based on latest --- enter | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 enter diff --git a/enter b/enter new file mode 100755 index 0000000..23036d5 --- /dev/null +++ b/enter @@ -0,0 +1,34 @@ +#!/bin/bash +entrance="$(cat $ZLATEST)" +#entrance="QmW5WVXCJfhb4peHG6cbEdamC24vZzMX2Vz386vpENh38U" +#entrance="QmNjQq7GkuXGF8kFT1z2Mv3i4JhY7sBXVUmHDiR1zkQjoE" +#entrance="QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" +end="QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" +previous="$entrance" +while true +do + if [ ! -v $previous ] + then + if [ "$previous" != "$end" ] + then + ipfs cat $previous | json2bash > tmp-zblock + source tmp-zblock + ipfs cat $block | json2bash > tmp-block + source tmp-block + if [ -v $previous ] + then + echo "$block has no previous zblock" + exit 3 + else + echo "$block after $previous" + fi + elif [ "$previous" == "$end" ] + then + echo "$previous is GENESIS block" + exit 0 + fi + else + echo "Check not passed... No previous IPFS CID" + exit 1 + fi +done -- cgit v1.2.3