Replace good jq command with issuers skipping

This commit is contained in:
poka 2020-06-25 18:59:48 +02:00
parent c5e95e43b2
commit 27a544bddf
1 changed files with 5 additions and 4 deletions

View File

@ -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++))