INFURA / infura

Official Public Repository for INFURA
https://infura.io
381 stars 62 forks source link

Best practise for calling balanceOf many times for different addresses #111

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, I need to get the token balance of 100K addresses. What is the best practise for doing that? atm I'm getting invalid rpc responses after a few seconds. I'm using web3js.

Am0rfu5 commented 6 years ago

Just to clarify, you are able to get a few balances successfully but then start getting an invalid rpc response errors correct? Can you share the code that you are currently using?

bsin1 commented 6 years ago

This may not be directly related, but I am running into a similar issue with the rest API. Currently I am making ~650 requests (in parallel) to https://api.infura.io/v1/jsonrpc/mainnet/eth_call The first ~15 requests succeed, but the remainder fail with a connection error: Could not resolve host: 'api.infura.io'

ghost commented 6 years ago

sorry to get back to this so late... I solved the issue by implementing concurrency so only a set amount of requests are fired at the same time.