• 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] KAU records. 5 different types (0 1 5 8 9). In different places from the KAG equivalents. Check 'em side-by-side

Back in the saddle...
Counts on CSV (transaction?) extract from Derek's Watchernode for KAU. Out-of-date by about a month. No matter. Our purpose here is to extend our box of tools. In public. So that others can chip in, criticize and improve the tools. Use the tools themselves, adapt them. Learn from them. In the open source ethic.
End result counts (last column):
Code:
0 create_account 37412
1 payment 8336
5 set_options 123
8 account_merge 36540
9 inflation 27
How to do it within a couple of minutes from first principles (without using SQL):
Code:
Will create temporary throw-away files t1 t2 t3 etc...

linux> KAU_extract=../Blockchain-Exploration/KAU/stellar-export-KAU-2023-02-24-T09\:37\:45-UTC.csv

linux> cat $KAU_extract | sed 's/"//g' | awk -F, 'NR>1 {print $4, $5}' | sort -u | sort -k2
create_account 0
payment 1
set_options 5
account_merge 8
inflation 9

cat $KAU_extract | sed 's/"//g' | awk -F, 'NR>1 {print $4, $5}' | sort -u | sort -k2 > t1

linux> for i in 0 1 5 8 9; do echo $i; sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v x=$i '($5==x) {print}' | wc -l; done
0
37412
1
8336
5
123
8
36540
9
27

for i in 0 1 5 8 9; do echo $i; sed '1d' $KAU_extract | sed 's/"//g' | awk -F, -v x=$i '($5==x) {print}' | wc -l; done > t

cat t | sed -n 1~2p > t2
cat t | sed -n 2~2p > t3

linux> cat t | sed -n 1~2p > t2
linux> cat t | sed -n 2~2p > t3

paste t[2-3]
0    13774
1    3421
5    123
8    12803
9    28
linux> paste t[2-3] > t4

linux> cat t4
0    13774
1    3421
5    123
8    12803
9    28

linux> join -1 2 -2 1 <(sort -k2 t1) t4 
0 create_account 37412
1 payment 8336
5 set_options 123
8 account_merge 36540
9 inflation 27
To see the actual layout of all 5 records, one after each other and then side by side with their KAG equivalents, see my upcoming reply below.
 

Attachments

  • KAU-utilities.zip
    342.4 KB · Views: 1
Looking first at the KAU flat file:
Code:
for i in 0 1 5 8 9
do
  sed '1d' $KAU_extract | sed 's/\"//g' | awk -F, -v x=$i '($5==x) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba
  sleep 3
done > KAU-record-formats
We actually want to compare with the format of the KAG records. It gets mighty confusing when you're doing real work if you don't.
Code:
KAG_extract=../Blockchain-Exploration/KAG/stellar-export-20230223-1606.csv 
for i in 0 1 5 8 9; do   sed '1d' $KAG_extract | sed 's/\"//g' | awk -F, -v x=$i '($5==x) {print $0}' | head -1 | sed 's/,/\n/g' | nl -ba;   sleep 3; done > KAG-record-formats
paste -d " " KAG-record-formats KAU-record-formats | more

pr -m -t KAG-record-formats KAU-record-formats | expand | less
pr -m -t KAG-record-formats KAU-record-formats | expand > KAG-KAU-record-formats-sideByside
Might as well post that last output file here:
Not perfect formatting but it does the job.
The 5 record types. One after each other.
Side by side.
As advertised.
Code:
     1  105811428484583425               1      105699527406653441
     2  true                             2      true
     3  GBTYCT2VVWURNU23ZSR3IPSXU6B      3      GDIENNQ3BXCTB74ZYCQAGXCY7KT
     4  create_account                   4      create_account
     5  0                                        5      0
     6  2023-02-23T11:08:51Z             6      2023-02-24T07:45:04Z
     7  deb678de9a4fed8f28cc3d18d91      7      6e5d6f56e12f0f4d582120142ca
     8                                           8      GD6LVLQE6EQJPPWV4ZZBLRIRXS5
     9                                           9      
    10                                          10      800.0000000
    11                                          11      GDIENNQ3BXCTB74ZYCQAGXCY7KT
    12  GCLBGCC673GPM2GYKIOGREGLEX3     12      
    13                                          13      
    14  17.0000000                      14      
    15  GBTYCT2VVWURNU23ZSR3IPSXU6B     15      
    16                                          16      
    17                                          17      
    18                                          18      
    19                                          19      
    20                                          20      
    21                                          21      
     1  105821216715051009               1      105593544793657345
     2  true                             2      true
     3  GBTYCT2VVWURNU23ZSR3IPSXU6B      3      GBUBOKEFUNF4ZZQA7QJCGYF54U4
     4  payment                          4      payment
     5  1                                        5      1
     6  2023-02-23T14:33:18Z             6      2023-02-22T19:08:40Z
     7  236ee99f5a6fe01b62168357a5a      7      c508035abf68a3af36c1d2bcc9d
     8  native                           8      
     9  GBTYCT2VVWURNU23ZSR3IPSXU6B      9      
    10  GAAEXODE6OKY2GSB3PZ6YXIFQNA     10      
    11  97.8040500                      11      
    12                                          12      native
    13                                          13      GBUBOKEFUNF4ZZQA7QJCGYF54U4
    14                                          14      GDIENNQ3BXCTB74ZYCQAGXCY7KT
    15                                          15      2400.0000000
    16                                          16      
    17                                          17      
    18                                          18      
    19                                          19      
    20                                          20      
    21                                          21      
     1  99417377527042049                        1      99242061256986625
     2  true                             2      true
     3  GBTYCT2VVWURNU23ZSR3IPSXU6B      3      GBUBOKEFUNF4ZZQA7QJCGYF54U4
     4  set_options                      4      set_options
     5  5                                        5      5
     6  2022-11-22T09:27:08Z             6      2022-11-22T09:27:53Z
     7  3abf26b47a3b70e24f8dead4bd2      7      d77ac02b3ac4a3f4e9d433226ec
     8                                           8      
     9                                           9      
    10                                          10      
    11                                          11      
    12                                          12      
    13                                          13      
    14                                          14      
    15                                          15      
    16  GCK7NXBOVWY4V2VETTGZJXME4I6     16      GB6V2RXDYWZ2HKCS7RSIJSG2EBB
    17  0                                       17      0
    18                                          18      
    19                                          19      
    20                                          20      
    21                                          21      
     1  105811437074518017               1      105699535996588033
     2  true                             2      true
     3  GCLBGCC673GPM2GYKIOGREGLEX3      3      GD6LVLQE6EQJPPWV4ZZBLRIRXS5
     4  account_merge                    4      account_merge
     5  8                                        5      8
     6  2023-02-23T11:09:02Z             6      2023-02-24T07:45:15Z
     7  c24e71f8460271631c2bda8ac33      7      645902f4d2c1c3df719b89d4b26
     8                                           8      GD6LVLQE6EQJPPWV4ZZBLRIRXS5
     9                                           9      GBUBOKEFUNF4ZZQA7QJCGYF54U4
    10                                          10      
    11                                          11      
    12  GCLBGCC673GPM2GYKIOGREGLEX3     12      
    13  GBTYCT2VVWURNU23ZSR3IPSXU6B     13      
    14                                          14      
    15                                          15      
    16                                          16      
    17                                          17      
    18                                          18      
    19                                          19      
    20                                          20      
    21                                          21      
     1  104264634667634689               1      104088459404120065
     2  true                             2      true
     3  GDCQANEHPUIIT6CQGJO2NTKGCRF      3      GDCQANEHPUIIT6CQGJO2NTKGCRF
     4  inflation                                4      inflation
     5  9                                        5      9
     6  2023-02-01T00:00:22Z             6      2023-02-01T00:00:20Z
     7  944501899ed4565fcab1056cb64      7      2ae222a142b23ac5945478517d1
     8                                           8      
     9                                           9      
    10                                          10      
    11                                          11      
    12                                          12      
    13                                          13      
    14                                          14      
    15                                          15      
    16                                          16      
    17                                          17      
    18                                          18      
    19                                          19      
    20                                          20      
    21                                          21
 

Translate

Back
Top