0

I have one event inside my solidity smart contract and in web application I am fetching the values using "contractInstance.Transferred({}, {fromBlock: 0, toBlock: 'latest'}).get".

When I changes the value of fromBlock to any non zero value like 12 or 20 , then it is giving the data. But how it is possible, means all the block are interconnected with each other, then how can we get the details from the in between of blockchain that I am not getting.

Can anyone make my this concept clear that how can we fetch history in between of blockchain as all blocks are interconnected with each other.

1 Answer 1

0

Scanning from the first block is technically OK. However, in practice scans of very large ranges are often too slow and in practice may never return.

Since your contract was not deployed at block 0, you should at least be able to specify the block number of the block at which your contract was first deployed as the starting block of the range. You may also need to fetch the data back with repeated calls in smaller chunks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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