Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - look up by date #5

Closed
Gingeropolous opened this issue Nov 13, 2016 · 10 comments
Closed

Feature request - look up by date #5

Gingeropolous opened this issue Nov 13, 2016 · 10 comments

Comments

@Gingeropolous
Copy link
Contributor

Can you pretty please add a feature to look up a block by the timestamp?

Timestamp [UCT]: 2016-11-13 08:51:43

I dunno which format would be best, but the data seems to be in there.

@moneroexamples
Copy link
Owner

Good idea. I will look into it. I already have code for estimation of block height from a date, so maybe can use this. Could also add the stamp to the custom lmdb database, for super fast and exact search of block.

@moneroexamples
Copy link
Owner

moneroexamples commented Nov 24, 2016

Just marged it to master.
#11

The supported datetime format is 2016-11-13 08:51:43 . If the block with exact timestamp does not exist, the first boock with higher timestamp is returned.

For this to work, the custom lmdb database must be up to date, as the timestamps are taken from it. In Monero blockchain, you cant search blocks based on timestamps.

Also UTC timezone were fixed, so now the dates and times shown are UTC, unlike before. Hinnant library requires curl, so you mean need to install it, sudo apt install libcurl4-openssl-dev first.

@Gingeropolous
Copy link
Contributor Author

Gingeropolous commented Nov 24, 2016

2016-11-13 08:51:43

i'll probably find out once I compile and test it, but can you input substrings of the above?

e.g., 2016-11-13 08:51:43 would get a specific block, but

2016-11-13 08:51 would return any block found in that minute

and 2016-11-13 08 would return any block found in that hour, or blocks found starting at that hour.

2016-11-13 would return blocks found starting that day
etc etc

@Gingeropolous
Copy link
Contributor Author

For this to work, the custom lmdb database must be up to date, as the timestamps are taken from it. In Monero blockchain, you cant search blocks based on timestamps.

OOOOH im an idiot. By up to date, you mean recompile. Not simply that the database on the server is currently up to date with the blockchain.

@moneroexamples
Copy link
Owner

moneroexamples commented Nov 24, 2016

Nope, just having current blocks. No need to recompile or recreate it.

Yes, was thinking about the "no-full" timestamps. Its duable, but need time to implement that.

@Gingeropolous
Copy link
Contributor Author

hrm... though there are a lot of changes to lmdb-cpp since I compiled last apparently

@moneroexamples
Copy link
Owner

moneroexamples commented Nov 27, 2016

The datetime search has been extended and its ready for testing.

  • 2015-04-15 12:02:33 searches for block of this timestamp or first next one.
  • 2015-04-15 12:02 searches for all txs made in the given minute
  • 2015-04-15 12 searches for all txs made in the given hour
  • 2015-04-15 searches all txs made in that day (only up to 500 txs are displayed though).

SInce the custom lmdb database is used for the searches (its not possible to search for this efficiently in monero blockchain), lmdb must be running and keeping its records up to date with blockchain.

@Gingeropolous
Copy link
Contributor Author

sweeeeeet.

@moneroexamples
Copy link
Owner

moneroexamples commented Nov 28, 2016

No problem. Let me know if there are some problems with it or something else is required.

@moneroexamples
Copy link
Owner

If there are no further question or issues, I will close this issue. Please feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants