aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-calculate-size
blob: 63ae2f7a5b2dab19efac17cbf2d77c4d3572974a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
ak-extract-cids > to_stats
sum=0 ; while IFS="" read -r p || [ -n "$p" ]
do
    if [ "$p" != "" ]
    then
        num=$(ak-ipfs-block-stat $p | grep Size | sed -e 's/Size: //g')
    else
        num=0
    fi
	sum=$(expr $sum + $num )
done < to_stats
echo "Chain is : $sum bytes"
rm to_stats