You are viewing a single comment's thread from:

RE: Greenshift 011: Finding the Most Recent Vote

in #greenshift6 years ago (edited)

You might consider streaming the blockchain instead.

https://www.rubydoc.info/gems/radiator/Radiator/Stream#operations-instance_method

Or are you trying to just peek at history to get the minimum amount back to find the latest vote, without asking for 10,000 results?

Sort:  

I'm just peeking at the history to get the most recent vote. Streaming gets live information from the blockchain, right? I don't think that will work since there's a chance that the author may not vote while the stream is live. I think though I will remove the loop and simply take a larger sample as that's probably more efficient than pinging the blockchain multiple times.

Yeah, that's basically what this tutoral does, except it's for comments instead of votes. But either op type would work:

https://developers.steem.io/tutorials-ruby/get_account_comments

If you look at the JavaScript version, they do get_state which is discouraged. While it's discouraged, it might be a more efficient API call at the moment. When hivemind goes live, these kinds of queries will probably be a lot more efficient.

At the moment, the best, non-descouraged-yet-still-efficient way is to use SteemSQL.

Cool. I like the way that's formatted. It's nicer than using indices just by passing that array as a block into another closure.