3

The blockchain required to run ethereum is several Terabytes large. This means more than 9 years would be required to download it with my connection speed.

In my case, I just want to know if the storage of a single contract’s address contains a specific value and in which transaction such value was created.

So how to download all key/values pairs of a single contract address ?

3
  • According to bitinfocharts.com, current size of Ethereum blockchain is 236.69GB. This is what you need to download. Several terabytes probably refer to blockchain state size, i.e. how much disk space the node will occupy on the hard disk. – Mikhail Vladimirov Feb 29 '20 at 9:56
  • You got the other point (otherwise yes my connection was that slow). Laptop with 19Tb of nvme storage aren t common. – user2284570 Feb 29 '20 at 11:07
  • I believe several terabytes is disk requirement for so called “archive” node, that stores not only the current state, but also all the past states. Normal “fast” node, that regularly purges old states, should use much less disk space. – Mikhail Vladimirov Feb 29 '20 at 17:50
0

I'm not sure if some client supports this but at least in theory you could start downloading the blockchain only from a certain block number. As the contract (most likely) won't have transactions into it before it was created you only need to check blocks after that.

If you're saying that the blockchain is several terabytes in size then you must mean an archival node (https://etherscan.io/chartsync/chainarchive). That's the most disk space consuming mode and is mostly useless data for typical scenarios. The typical synchronization mode is fast sync which takes a lot less space - currently around 200GB (https://etherscan.io/chartsync/chaindefault). Different clients offer also even more optimized synchronization modes (such as Geth's light sync) but they are limited in what data they offer.

But in any case I don't think there is any way to only download some of the data inside blocks. You have to download a whole block at a time. Once you have downloaded the block you can do all sorts of analysis on it and discard it and/or extract needed information from it and continue on to the next block. This means changes into the client's (node's) code implementation.

14
  • Downloading from August 2015 to July 2019 ? No good… And no I don’t mean an archival node hackernoon.com/… – user2284570 Sep 25 '19 at 18:27
  • Also what about the underlying call web3.eth.getStorageAt() is using ? – user2284570 Sep 25 '19 at 18:33
  • Ah that rant article. 1) It's 1,5 years old 2) The only understandable reference to the >1TB size clearly states "Parity full archive 1,1TB". As far as I can tell everything tells me that archive nodes are the only nodes which are above 1TB. And as for getStorageAt - it's a web3 feature so it can only utilize the data your node has collected. So if your node has downloaded the right data then web3 can show it to you but your node won't start downloading such certain block just because web3 asks for it. – Lauri Peltonen Sep 25 '19 at 18:38
  • But you see the point is web3 doesn’t requires to use your own node and as such often run inside the web browser (at least I never had to do it)… Also I’m afraid that I need an archival node for what I need do which is described in the question. – user2284570 Sep 25 '19 at 18:45
  • Well yes, you can point your web3 to any node you have access to. If you point it to somebody else's node (for example Infura) you don't need to worry about downloading the blockchain yourself. But no, you don't need an archival node for just seeing when some value is set in a contract. But, if you have further questions please post a new question – Lauri Peltonen Sep 25 '19 at 18:47

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.