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

Add NotificationPlugin interface #352

Conversation

localhuman
Copy link
Contributor

This PR adds a NotificationPlugin interface for plugins that wish to persist events emitted from smart contracts, and provide a REST interface for applications that wish to query those events.

  • StartPersistingNotifications would be called on any NotificationPlugin that is installed in the plugins directory. This method creates a database and begins saving events to the database.

  • UserAgent is an interface to instruct the NotificationPlugin what version of neo core is running when persisting events

  • StartRESTApi would optionally be called on any NotificationPlugin interface in the event that the operator wishes to expose a REST interface for public consumption of notification events.

All feedback welcome!

@erikzhang
Copy link
Member

When will this plugin be called?

@localhuman
Copy link
Contributor Author

@erikzhang
Copy link
Member

@localhuman
Copy link
Contributor Author

I have seen it.

@jsolman
Copy link
Contributor

jsolman commented Sep 16, 2018

Can’t you just subscribe to blockchain BlockPersisted events instead of needing this?

@localhuman
Copy link
Contributor Author

Yes. But I do not want to serve the notifications via JSON-RPC, and would like to start a REST server for that.

@jsolman
Copy link
Contributor

jsolman commented Oct 14, 2018

IMO, this is too specific of a type of plugin. Plugins should be for modifying behavior of the neo core or adding features to the RpcServer it exposes. For starting a completely separate REST server, why not do it from your project depending on the neo core. You can listen to BlockPersisted and then persist the notifications wherever you want and serve them up over your REST server that is started from your project depending on neo.dll.

Adding new plugin types to core for every type of additional server someone wants to build on top of Neo seems bloated.

@vncoelho
Copy link
Member

vncoelho commented Jun 3, 2019

I will close this PR due to lack of inactivity and also a better design for plugins that has been done in these last months.

As @jsolman emphasized, we may use the current templates for creating such plugin.

On the other hand, fell free to reopen it @localhuman if you believe that we still should move in this direction.

@vncoelho vncoelho closed this Jun 3, 2019
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

Successfully merging this pull request may close these issues.

None yet

4 participants