aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-zchain-extract-cids
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ak-zchain-extract-cids')
-rwxr-xr-xbin/ak-zchain-extract-cids13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/ak-zchain-extract-cids b/bin/ak-zchain-extract-cids
new file mode 100755
index 0000000..a07c481
--- /dev/null
+++ b/bin/ak-zchain-extract-cids
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# Extracts unique IPFS CIDs from an ak-entered zchain
+#
+# Previously:
+# ak-enter | jq | grep Qm | sed -e 's/^.*Qm/Qm/g' | cut -d '"' -f 1
+#
+if [ ! -z $1 ] && [ -n "$1" ]
+then
+ ak-enter $1 | jq | grep Qm | sed -e 's/".*"://g; s/ //g; s/[{,"]//g' | sort | uniq
+else
+ ak-enter | jq | grep Qm | sed -e 's/".*"://g; s/ //g; s/[{,"]//g' | sort | uniq
+fi