1. Using it, can I parse all addresses with a positive balance from the entire blockchain to a text file?
2. Can I check the balances of a large list of addresses from a text file and write them to another text file?
Regarding the first point, you might want to have a look as goxplorer chainstate branch https://gitlab.com/iMil/goxplorer/-/tree/chainstate
I've just pushed a working version of what I hinted, you can now make a database of all addresses with a positive balance (better said, UTXOs), but it's not yet documented. The fastest way of getting this done is to 1st create the LevelDB database (can take some time depending on your hardware):
$ goxplorer -addr mkdb:anameyoulike
Then if you want to extract them to a plain text file, you can use https://github.com/yuuichi-fujioka/go-leveldbctl this way:
$ leveldbctl --dbfile=anameyoulike k > addresses.txt
The second point is on its way.I've added a
print function to ease this process in the
chainstate branch. Export
chainstate location and run
goxplorer with the
-addr print flag:
$ export BTCCHAINSTATE=chainstate # use a copy, not the original chainstate database!
$ ./goxplorer -addr print
This will output every UTXO in a JSON dict to be taken individually, an array would be too big.
Example output:
{
"txid": "57f50996a619a65979a8adf64396e76ed26c2c643492cbb2b35414246b040f00",
"height": 616335,
"nsize": 0,
"address": "19iLbtVWjer23uWR4tdw6WdxvMDZ8CeUxz",
"amount": 133097
}
{
"txid": "57f50996a619a65979a8adf64396e76ed26c2c643492cbb2b35414246b040f00",
"height": 616335,
"nsize": 0,
"address": "1N1YgwAFgEuTZmtKaAskhQRK8Q6k9iuzKU",
"amount": 57914
}
...
The
chainstate branch is actually capable of more useful actions but I'm still working on polishing and documenting them.