0

I have a list of 50.000 Ethereum addresses which at any time may receive ERC20 transfers.

I know I can create filters but I don't think it scales to send 50.000 RPC calls to an Ethereum node every 20 seconds. Is the solution to ask the Ethereum node for all Transfer events and then filter the events in RAM?

I am using Parity and NEthereum (a C# library).

2

You may listen to many addresses via one subscription: https://web3js.readthedocs.io/en/1.0/web3-eth-subscribe.html#subscribe-logs

Also you may omit address parameter and listen for all Transfer events from all tokens.

1

Listen to contracts, not addresses.

You listen to the ERC20 contracts for transfer events. On the client side, check your list to see if the transaction is of interest.

Hope it helps.

  • The receiving contracts that I listen to can also receive ETH transfers. When they do, they emit an event. – Thorkil Værge Apr 18 at 18:27
  • And that would mean that I registered 200 filters by the Ethereum node, right? One for each ERC20 that I am interested in? – Thorkil Værge Apr 18 at 18:36
  • 1
    Yes. 200 is less than 50,000. I wouldn't be comfortable with dismissing concerns about that many filters until seeing it working experimentally. I also wouldn't say it's outside the realm of reasonableness. Possibly someone with direct experience can chime in about running that many filters, or the next alternative. The alternative that springs to mind is listening to blocks/transactions and building your own scalable filter. You can iterate over transactions in a block and see the events emitted and the contracts that emitted them. A purpose-built system may be more efficient. – Rob Hitchens - B9lab Apr 18 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.