forked from axiom-team/g1-stats
Explorer: Add print command; G1Stats: Use explorer print to export cumulate json
This commit is contained in:
parent
41dc74a545
commit
27abf57a44
12
explorer.sh
12
explorer.sh
|
@ -75,14 +75,14 @@ for i in $@; do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
-c|--cumulate) jsonData="$(jq "$jqCumulate" <<<$jsonData)";;
|
-c|--cumulate) jsonData="$(jq "$jqCumulate" <<<$jsonData)";;
|
||||||
-h|--help) helpOpt && exit 0;;
|
-h|--help) helpOpt && exit 0;;
|
||||||
*) isOptions+="$i|";;
|
*) isArg+="$i|";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load arguments in respective variables
|
# Load arguments in respective variables
|
||||||
cmd=$(cut -d'|' -f1 <<<"$isOptions")
|
cmd=$(cut -d'|' -f1 <<<"$isArg")
|
||||||
dateRange=$(cut -d'|' -f2 <<<"$isOptions")
|
dateRange=$(cut -d'|' -f2 <<<"$isArg")
|
||||||
args="$(cut -d'|' -f2- <<<"$isOptions" | sed 's/.$//' | tr '|' ' ')"
|
args="$(cut -d'|' -f2- <<<"$isArg" | sed 's/.$//' | tr '|' ' ')"
|
||||||
|
|
||||||
# If no date, set last available
|
# If no date, set last available
|
||||||
[[ -z "$dateRange" ]] && dateRange=$(jq -r '.[].date' <<<$jsonData | tail -n1)
|
[[ -z "$dateRange" ]] && dateRange=$(jq -r '.[].date' <<<$jsonData | tail -n1)
|
||||||
|
@ -134,6 +134,10 @@ anniversary() {
|
||||||
jq "$jqNewUD" <<<$jsonData
|
jq "$jqNewUD" <<<$jsonData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print() {
|
||||||
|
jq . <<<"$jsonData"
|
||||||
|
}
|
||||||
|
|
||||||
# Load functions
|
# Load functions
|
||||||
case $cmd in
|
case $cmd in
|
||||||
'') day;;
|
'') day;;
|
||||||
|
|
|
@ -61,7 +61,8 @@ web() {
|
||||||
echo "$wallets" | grep . > $WEBPATH/data/wallets-g1.txt
|
echo "$wallets" | grep . > $WEBPATH/data/wallets-g1.txt
|
||||||
echo -e "$membresPubkeys" | sed 's/ /\n/g' > $WEBPATH/data/wallets-g1-membres.txt
|
echo -e "$membresPubkeys" | sed 's/ /\n/g' > $WEBPATH/data/wallets-g1-membres.txt
|
||||||
echo -e "$simpleWallets" > $WEBPATH/data/wallets-g1-simple.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
|
if [[ "$startTime" == "00:00" ]]; then
|
||||||
cp $indexhtml $WEBPATH/history/index_$day.html
|
cp $indexhtml $WEBPATH/history/index_$day.html
|
||||||
|
|
|
@ -251,8 +251,6 @@ scanTxWallets() {
|
||||||
.rWallets = (\$row.rWallets + .rWallets|roundit);
|
.rWallets = (\$row.rWallets + .rWallets|roundit);
|
||||||
\$row + . )]"
|
\$row + . )]"
|
||||||
|
|
||||||
jq "$jqCumulate" $jsonFile > $GPATH/db/cum-daily.json
|
|
||||||
|
|
||||||
# On supprime les doublons et les lignes vides
|
# On supprime les doublons et les lignes vides
|
||||||
wallets=$(echo -e "$wallets" | sort -u | awk 'NF')
|
wallets=$(echo -e "$wallets" | sort -u | awk 'NF')
|
||||||
# On écrit les pubkeys avec transaction dans un fichier de cache pour la prochaine itération
|
# On écrit les pubkeys avec transaction dans un fichier de cache pour la prochaine itération
|
||||||
|
|
Loading…
Reference in New Issue