• Short guides to forum navigation, searching, posting, translation, alerts and notifications viewable by clicking here.
  • Türk dostlarımıza hoş geldiniz Giriş burada.
  • Scammers are running ads on Facebook and Instagram claiming a giveaway. DO NOT OPEN THESE LINKS AND LOG IN. See this thread: here

[Forensics] Spot-check KAG and KAU numbers from Watcher flat files. Possible format change (format for KAU file may be like KAG file now. Great :)

Sledge-hammer approach

All based on previous work.

I may have had to change the parameters in the KAU section.

Conceivable that @Derek has now standardized the KAU output format to the same as for KAG format. I am too knackered to check properly. I'm on automatic mode. Gettin' the job done.
If so, we are communicating telepathically ;) (y)

Should all be self-explanatory from the variable and symbol names...

KAG before KAU

Code:
KAG

mv ../dat/stellar-export.csv ../dat/kag-stellar-export-using-Operations-TAB-`date -u +"%Y-%m-%d-T%H:%I:%S-%Z"`.csv

KAG_extract=../dat/kag-stellar-export-using-Operations-TAB-2023-06-23-T02\:02\:41-UTC.csv 
. ./KAG-set-main-account-symbols.sh 

linux> set | grep ^KAG | sort -t= -k2
KAG_extract=../dat/kag-stellar-export-using-Operations-TAB-2023-06-23-T02:02:41-UTC.csv
KAG_GAPSAccount=GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
KAG_RootAccount=GAUCIFE37F4KQ5F6QPNSZ75QKRQTNRCF32FZNUXMCXUFSKRMWGF76LTI
KAG_InflationAccount=GBBVUAMR3CYNQKMNHVWCMUQVE3XQIL3WM5GSP5D6SCECKIZNNBT6FT7I
KAG_HotWalletAccount=GBTYCT2VVWURNU23ZSR3IPSXU6BRWT3ELIOQJAJOKGIHCLLE6YDX4A7E
KAG_EmissionAccount=GCGTMT2X6NUV6ABEOAOSDI2YQ7FXQOQYKYA7KVZQ5ID67GQU3C6AIUGU

x1=`sed '1d' $KAG_extract | sed 's/\"//g' | awk -F, -v e=$KAG_EmissionAccount '($4=="create_account") && ($11==e) {sum_10 += $10} END {printf "%-10.2f\n", sum_10}'`
x2=`sed '1d' $KAG_extract | sed 's/\"//g' | awk -F, -v e=$KAG_EmissionAccount '($4=="payment") && ($13==e) {sum_15 += $15} END {printf "%-10.2f\n", sum_15}'`
x3=`sed '1d' $KAG_extract | sed 's/\"//g' | awk -F, -v x=$KAG_HotWalletAccount -v y=$KAG_EmissionAccount '( ($4=="payment") && (($13==x) && ($14==y)) ) {sum_15 += $15} END {printf "%-10.2f\n", sum_15 }'`

echo $x1
echo $x2
echo "$x1 + $x2" | bc -l | xargs printf "%-10.2f\n"
echo $x3
echo "$x1 + $x2 - $x3" | bc -l | xargs printf "%-10.2f\n"

7288125.02
1239338.08
8527463.10
5207555.92
3319907.18

Explorer column to the far-right:
Screenshot from 2023-06-23 05-34-43.png
KAG MATCH

next
KAU
Code:
mv ../dat/stellar-export.csv ../dat/kau-stellar-export-using-Operations-TAB-`date -u +"%Y-%m-%d-T%H:%I:%S-%Z"`.csv

KAU_extract=../dat/kau-stellar-export-using-Operations-TAB-2023-06-23-T02\:02\:51-UTC.csv 

. ./KAU-set-main-account-symbols.sh 

linux> set | grep ^KAU | sort -t= -k2
KAU_extract=../dat/kau-stellar-export-using-Operations-TAB-2023-06-23-T02:02:51-UTC.csv
KAU_GAPSAccount=GAPS3KZ4YVEL4UYFAGTE6L6H6GRZ3KYBWGY2UTGTAJBXGUJLBCYQIXXA
KAU_HotWalletAccount=GBUBOKEFUNF4ZZQA7QJCGYF54U4N2T5VV2QAN7RWQCVS75OOI5KSVCZS
KAU_InflationAccount=GCO75U2EVO3HKGYO2PUO2ZO7CEL52JPQL5WYUHHKPEORQSASSKT4MA3B
KAU_EmissionAccount=GDIENNQ3BXCTB74ZYCQAGXCY7KTGFBZGHRMUVF3ZLIW6SMAZIGX2JCCS
KAU_RootAccount=GDTYNME5HX3FCFDS4D3R3LTVH3DFLSB5HWVTV3VVL4PBGQ6SCKC7J3PD

linux> 
x1=`sed '1d' $KAU_extract | sed 's/\"//g' | awk -F, -v e=$KAU_EmissionAccount '($4=="create_account") && ($11==e) {sum_10 += $10} END {printf "%-10.2f\n", sum_10}'`
x2=`sed '1d' $KAU_extract | sed 's/\"//g' | awk -F, -v e=$KAU_EmissionAccount '($4=="payment") && ($13==e) {sum_15 += $15} END {printf "%-10.2f\n", sum_15}'`
x3=`sed '1d' $KAU_extract | sed 's/\"//g' | awk -F, -v h=$KAU_HotWalletAccount -v e=$KAU_EmissionAccount '( ($4=="payment") && (($13==h) && ($14==e)) ) {sum_15 += $15} END {printf "%-10.2f\n", sum_15 }'`

echo $x1
echo $x2
echo "$x1 + $x2" | bc -l | xargs printf "%-10.2f\n"
echo $x3
echo "$x1 + $x2 - $x3" | bc -l | xargs printf "%-10.2f\n"
47135720.79
3140066.21
50275787.00
49025784.01
1250002.99

I'll copy same printscreen again. Easier for the eyes.

Middle column:
Screenshot from 2023-06-23 05-34-43.png
'Tis a MATCH
KAU MATCH

Out
 
KAU output format to the same as for KAG format
The watcher node uses a third party Stellar Explorer.
One of it's "features" is the variable sequence of fields in the CSV download format.
There only seem to be a small number of different sequences, so the format will often be the same, but I wouldn't rely on it being consistent.
 

Translate

Back
Top