Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How to check the balance of the list of 1 million Bitcoin Addresses?
by
starmyc
on 17/06/2019, 08:37:11 UTC
⭐ Merited by Heisenberg_Hunter (1)
Hello,

I would rather personally use a 3rd party key/value database in order to manipulate small data set like this, like redis.
A way to do it would be:

First, import database (& go take a coffee, as it will take a few minutes):

Code:
$ awk -F ';'  '{print "SET " $1 " " $2 }' < balances-bitcoin-20190617-0000-foryjL2u  | redis-cli >/dev/null

Check database import by cheching number of keys:

Code:
$ wc -l ~mycroft/balances-bitcoin-20190617-0000-foryjL2u
25330187 /home/mycroft/balances-bitcoin-20190617-0000-foryjL2u

$ redis-cli dbsize
(integer) 25330187

Then, retrieve all wanted balances & build a k/v export set (where "randomset" is the list of addresses searched in database):

Code:
$ awk '{print "GET " $1 }' < randomset  | redis-cli | tr -d \" > randomset.balances

$ paste randomset randomset.balances
1FMbcnYvvccZ6hR324cFRpn1QX9TCkqtAe      800000001092
1C7u4Zqu6ZZRsiKsFMYVDvNLfCwsGrbeTq      800000001092
155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4      191404456773
1BzK87zuqidZn489Wb2oLSktrjKrX7TLKe      200000174647
16BBBjvAArL3zdb1Fh1isr2w2hX7K1K4Gm      800000001092

Not found value would show (nil), which would make easy to know they are not appearing in database.