I am trying to tackle an issue of getting the block details based on the start date and end date using JAVASCRIPT, Geth1.4.11.
WHAT I WANT ?
I want to get input of Start date and End date from user and using that start and end date i need to search the block , whatever blocks comes in between those dates have to be traced and data of those block has to be obtained.
e.g :: Assume there are 1000 blocks created between month January and March. I need to get the from,to and value details in the block from February 1st to February 28th.
WHAT I WORKED ON? (My Approach)
Assigned start and End date into variable , obtained from user.
Traverse from 0 to endBlock. Get timestamp of the traversed block number.
Compare the obtained timestamp with the user inputted Start date timestamp, if matched, traverse to capture end date timestamp and compare.
Record the blockNumber at which the start and end date were obtained and then traverse through the StartBlock and EndBlock fetching from ,to and Value.
Problems facing
The traverse crashes my webpage since it has lot of blocks to traverse through.
WHAT I AM LOOKING FOR
An API which takes start date and end date as input and gives the from, to and value.
A Optimized way to jump to the block of start date and end date and use traversal.
or any as such function.