[Ethereum] Does Etherscan store all the events and transaction history

etherscaneventstransactions

To get the history of a transactions for an account, we have to traverse the whole chain everytime, but etherscan provides the entire history of all the accounts instantly.

Similarly it does the same thing for smart contracts, it gives all erc20 transaction history by giving us the whole 'Transfer' event log.

I was exploring Etherscan and was trying to implement these functionalities for a private network and was trying to find if these are some build-in functionalities to achieve this but it seems like it isn't.

There are several of these ether chain explorers and they are showing all the tokens in any particular wallet, hence keeping track of all token transfers from all public contracts. Now that is a lot of data tracking.

Also I couldn't find out how they are monetizing this service.

So, Is my assumption true?? How they do it. For the usage of similar features in private network, do I have to save and keep track of everything too?

Best Answer

Re. monitisation - etherscan.io runs advertisements.

If you want to determine something like all token transfers you would need to 'scan' the blockchain from inception (or at least when the token was created) - you can do this if you have a full archive node, or scan new blocks as they are added and create a secondary data store with the data you need.

Related Topic