Just wondering if there is a way to calculate the total supply via web3? I imagine you'd need to scan for all addresses? Not sure where to start with coding this one....


So since it's not possible via web3, would be possible via NodeJS or PHP? if so how?

  • Total supply of what??? Sep 22 '19 at 10:10
  • Sorry haha should have been more specific, I'd like to calculate the total supply of Ether.
    – Methereym
    Sep 22 '19 at 10:27
  • 1
    It'd probably (literally) take until the end of time using an RPC-bound service like web3. Just use an API instead? api.etherscan.io/api?module=stats&action=ethsupply Sep 22 '19 at 10:37
  • That's unfortunate... I've been working on a decentralized API for stats using IPFS & multiple RPC nodes for data collection this was the last piece of the puzzle. Anyway thanks for the quick reply!
    – Methereym
    Sep 22 '19 at 10:45
  • If you're running your own node then the other option would be to read the chain state data directly (rather than via RPC). This would be much faster, but probably much more technically involved. (See this question, for example: ethereum.stackexchange.com/questions/25620/…) Sep 22 '19 at 11:34

Your Answer

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

Browse other questions tagged or ask your own question.