diff --git a/g1-stats.sh b/g1-stats.sh index bfb6518..4bc0597 100755 --- a/g1-stats.sh +++ b/g1-stats.sh @@ -21,8 +21,8 @@ echo -e "\n############# $day à $startTime #############\n" echo "Initialisation ..." outFile="/tmp/g1-stats-$day-$startTime_$id" TXBLOCKS=$(curl -s ${DUNITER}/blockchain/with/tx | jq '.result.blocks[]') -TXBLOCKS+=$(curl -s ${DUNITER2}/blockchain/with/tx | jq '.result.blocks[]') -TXBLOCKS+=$(curl -s ${DUNITER3}/blockchain/with/tx | jq '.result.blocks[]') +#TXBLOCKS+=$(curl -s ${DUNITER2}/blockchain/with/tx | jq '.result.blocks[]') +#TXBLOCKS+=$(curl -s ${DUNITER3}/blockchain/with/tx | jq '.result.blocks[]') TXBLOCKS=($(echo "$TXBLOCKS" | sort -hu | awk '{printf $1" "}')) unset 'TXBLOCKS[${#TXBLOCKS[@]}-1]' MEMBERS=($(curl -s ${DUNITER}/wot/members | jq '.results[].pubkey' | tr -d '"')) @@ -37,12 +37,12 @@ loopWalletUp() { [[ -z ${TXBLOCKS[$i]} ]] && break sleep 0.1 WALLETS0=$(curl -s ${DUNITER}/blockchain/block/${TXBLOCKS[$i]}) - until WALLETS=$(echo $WALLETS0 | jq '.transactions[].outputs[]' 2>/dev/null); do + until WALLETS=$(echo $WALLETS0 | jq '.transactions[] | select(.issuers[0] as $issuers | .outputs[0]|contains($issuers)|not) | .outputs[0]'); do [[ $isWeb != "web" ]] && echo -e "iter $iter \n$WALLETS0" sleep 2 WALLETS0=$(curl -s ${DUNITER}/blockchain/block/${TXBLOCKS[$i]}) done - [[ -z "$WALLETS" ]] && echo "Erreur: $RET" && exit 1 + [[ -z "$WALLETS" ]] && continue WALLETS=$(echo "$WALLETS" | tr -d '"' | awk -F '(' '{ print $2 }' | tr -d ')') bloc=${TXBLOCKS[$i]} @@ -56,6 +56,7 @@ loopWalletUp() { echo "Heure de début: $startTime" echo echo "Scan en cours: $progress% - $bloc/$lastBloc" + echo $WALLETS fi ((iter++))