I need to parse live Ethereum blockchain to retrieve all transactions that belongs to particular smart contract's address.

So my general question is how can I do it properly?

My thought about it so far:

  • Need to download blockchain on my local machine
  • Loop thought all blockchain block-by-block and filter transactions against smart contract address that I'm interested in.
  • Store retrieved information in JSON file.

As far I know, Ethereum blockchain format is LevelDb and I guess it's doable. Could please help me this my task and point to right direction?

  • When you say "live" chain, do you mean parsing the DB while it is updated with live blocks/transactions, i.e. by a running Ethereum client? If so, it might be easier to do the same thing through web3 RPC: personally I found it easily corrupts the db with such usage. Although admittedly, web3 is also a pain, as the information can't be retrieved in batch (always single block or transaction) – Linmao Song Feb 8 '18 at 11:00
  • I needed the same and ended up using Etherscan.io's API, it's free and provides exactly what you want, although keep in mind the usage is limited. – Julien Feb 8 '18 at 13:42

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.