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

Make virtual operations accessible over the RPC endpoint #146

Closed
tchap opened this issue Jul 8, 2016 · 3 comments
Closed

Make virtual operations accessible over the RPC endpoint #146

tchap opened this issue Jul 8, 2016 · 3 comments

Comments

@tchap
Copy link

tchap commented Jul 8, 2016

Hi,

I am implementing SteemWatch, a service for sending notifications for Steem, and since virtual operations like comment_reward are virtual and not present in any block (using get_block), I don't know how to watch for these operations happening on the blockchain.

So, would it be possible to somehow make these virtual operations visible as they are happening? Or in case that is already possible over the RPC endpoint, how to do it?

Thanks!

@mvandeberg
Copy link
Contributor

The get_account_history call in database_api returns the operation history of a specific account, virtual operations included. There is not currently a way to get the full stream of virtual ops over the RPC endpoint. If you are wanting to write an application that does this, I would suggest implementing it as a plugin. The blockchain statistics plugin in branch 79-blockchain-statistics subscribes to the operation signal and uses a visitor to tally events based on operation. I imagine a similar pattern may work for what you want to do. This will grant you full access to the object database and you can also create an API specifically for your front end.

If the need arrises for third party developers to subscribe to a stream of virtual ops, we may add the functionality, but there are currently no plans to do so. Subscriptions in BitShares were to individual objects. I am not sure what the status of subscriptions are in Steem. It may also work. However, subscribing to a stream of all vops is expensive and having an API call to do this could be an attack vector.

If I can be of any further assistance, let me know.

@aaroncox
Copy link
Contributor

aaroncox commented Sep 6, 2016

Resurrecting this issue a little bit since it's still not closed. Could we add a parameter to get_account_history that let's us filter by operation type, much like get_followers recently received (the "what" param, "blog" or "ignore", etc)?

I'd like to be able to call get_account_history jesta transfer -1 10 to get the 10 most recent transfers. It might even be nice to call get_account_history jesta author_reward -1 10 to get the most recent rewards.

Right now a number of the projects I work on have to call get_account_history, receive every event, and then parse through to pick out the ones I need.

@mvandeberg
Copy link
Contributor

get_ops_in_block added in #649 can return virtual ops.

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

3 participants