Explorer: Add print command; G1Stats: Use explorer print to export cumulate json

This commit is contained in:
poka 2020-10-05 09:39:48 +02:00
parent 41dc74a545
commit 27abf57a44
3 changed files with 10 additions and 7 deletions

View File

@ -75,14 +75,14 @@ for i in $@; do
case "$i" in
-c|--cumulate) jsonData="$(jq "$jqCumulate" <<<$jsonData)";;
-h|--help) helpOpt && exit 0;;
*) isOptions+="$i|";;
*) isArg+="$i|";;
esac
done
# Load arguments in respective variables
cmd=$(cut -d'|' -f1 <<<"$isOptions")
dateRange=$(cut -d'|' -f2 <<<"$isOptions")
args="$(cut -d'|' -f2- <<<"$isOptions" | sed 's/.$//' | tr '|' ' ')"
cmd=$(cut -d'|' -f1 <<<"$isArg")
dateRange=$(cut -d'|' -f2 <<<"$isArg")
args="$(cut -d'|' -f2- <<<"$isArg" | sed 's/.$//' | tr '|' ' ')"
# If no date, set last available
[[ -z "$dateRange" ]] && dateRange=$(jq -r '.[].date' <<<$jsonData | tail -n1)
@ -134,6 +134,10 @@ anniversary() {
jq "$jqNewUD" <<<$jsonData
}
print() {
jq . <<<"$jsonData"
}
# Load functions
case $cmd in
'') day;;

View File

@ -61,7 +61,8 @@ web() {
echo "$wallets" | grep . > $WEBPATH/data/wallets-g1.txt
echo -e "$membresPubkeys" | sed 's/ /\n/g' > $WEBPATH/data/wallets-g1-membres.txt
echo -e "$simpleWallets" > $WEBPATH/data/wallets-g1-simple.txt
cp $GPATH/db/{daily.json,cum-daily.json} $WEBPATH/data/
cp $GPATH/db/daily.json $WEBPATH/data/
$GPATH/explorer.sh print -c > $WEBPATH/data/cum-daily.json
if [[ "$startTime" == "00:00" ]]; then
cp $indexhtml $WEBPATH/history/index_$day.html

View File

@ -251,8 +251,6 @@ scanTxWallets() {
.rWallets = (\$row.rWallets + .rWallets|roundit);
\$row + . )]"
jq "$jqCumulate" $jsonFile > $GPATH/db/cum-daily.json
# On supprime les doublons et les lignes vides
wallets=$(echo -e "$wallets" | sort -u | awk 'NF')
# On écrit les pubkeys avec transaction dans un fichier de cache pour la prochaine itération