aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-zchain-extract-cids
blob: 61e0da5bfcb85a23e2c5fa855b7d283465eaba7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
##
## Extracts unique IPFS CIDs from an ak-entered zchain
##
##    -h, --help                  Prints this help message
##
#
# 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  -M | grep Qm | sed -e 's/".*"://g; s/ //g; s/[{,"]//g' | sort | uniq
else
    ak-enter | jq -M | grep Qm | sed -e 's/".*"://g; s/ //g; s/[{,"]//g' | sort | uniq
fi