Using web3
I can query the balance of any fixed account with web3.eth.getBalance
. Assuming I have the entire blockchain downloaded, how can I recover the list of all addresses that have a positive balance at this moment?
[Ethereum] How to list ALL Ethereum addresses with a positive balance
mappingweb3js
Best Answer
simple:
value > 0
to
addressesfilter out addresses with balance
0
let this script run for a week or two and you'll have your result. The script requires the 1.0 version of web3
npm i web3
should do the trick. No other dependencies.to run this simply use
node scriptName.js
improvements may include finding out which addresses are contracts with
eth.getCode
. You could also write the result to disk instead of doing it all in memory.