ETHEREUM batch check balance of addresses in txt file via localhost:8545

Job ID: 36728366

Budget: $10 – $30 USD

I have a txt file with around 1300 ethereum addreses (1 each line) that I have saved during the years. Now I am running a node I would like to utilize it to automatically check the balance of each address quickly.

How can I utilize my ethereum node to use the check balance function, one by one, from wallet.txt, and inform/output about if the address balance is above 0.

Manually via the geth javascript console I could use

web3.fromWei(web3.eth.getBalance('0xbd3Afb0bB76683eCb4225F9DBc91f998713C3b01'));

Result:

0.483296293327556759

OR via terminal

curl -X POST localhost:8545 \
-H "Content-Type: application/json" \
--data \
'
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xbd3Afb0bB76683eCb4225F9DBc91f998713C3b01", "latest"],
"id": 1
}
'

Result:

{"jsonrpc":"2.0","result":"0x728d934e8054bc7","id":1}

(a hex number which should be converted to readable format like previous -- if balance is 0 then it outputs 0x0)


Anyone who can write a nice batch script to go through line by line in the most efficient (RAM/CPU) way possible?

My node rpc is localhost:8545
Related categories: Python Shell Script Node.js Ethereum Bash Scripting