aboutsummaryrefslogtreecommitdiff
path: root/enter
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-12-18 04:43:41 +0200
committerkaotisk <kaotisk@arching-kaos.com>2021-12-18 04:43:41 +0200
commit288e24bcd9c1905bc46a5bc97247bc6c9f642634 (patch)
treedf26fc00f1342745bfcbb037290b9ba90aab82ef /enter
parenta6a3d2d893e852b860af6baff507b602d64f704b (diff)
downloadarching-kaos-tools-288e24bcd9c1905bc46a5bc97247bc6c9f642634.tar.gz
arching-kaos-tools-288e24bcd9c1905bc46a5bc97247bc6c9f642634.tar.bz2
arching-kaos-tools-288e24bcd9c1905bc46a5bc97247bc6c9f642634.zip
Enter script
- Gets the ZLATEST and scrolls back up to the first ever block - Dry run script, just scrolls the chain based on latest
Diffstat (limited to 'enter')
-rwxr-xr-xenter34
1 files changed, 34 insertions, 0 deletions
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