-
Notifications
You must be signed in to change notification settings - Fork 48
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
Event and filtering system (high-level API) #15
Comments
We already have some plans to create an event framework. First one is Pub-Sub model like Ethereum. and Second one is POST method in Coinstack 3sp1. We can discuss them in here. |
@ashen1dev I think the POST method in Coinstack is interesting, but the use case seems a bit different. I guess it's a bit like a webhook in GitHub? So the server will request a given URL when something happens in the contract? It makes the contract very tightly coupled to a specific centralized deployment, right? |
This has landed in 0.12, but documentation is still lacking. |
There's some documentation here:
I'd like to see a bit more in the first article and also in the Lua Guide |
We need an event system, not just for plugins like in #14, but also as general API so that clients can react without needing to scan all transactions.
In Go
How about making a system similar to the actor messages with pub/sub? Maybe a component could
Subscribe(events.Block)
and then
For contract events, you probably want to subscribe to something like Ethereum-style topics.
SubscribeWithFilter(events.Transaction, { To: someAddress, Topic: someTopic } )
This is how it could look in Go, but more importantly this should also be accessible over GRPC, ideally supporting both streams for real-time and searching in the past.
End-to-end example for streams
Herajs
GRPC
Aergosvr
(Need to think about performance here, what if there are a lot of clients connecting to the server at once?)
Filtering
Is there any problem with just implementing Ethereum-like filters? (Store logs in tx receipts and have bloom filters to quickly search for topics)
Some related discussion about topics/filters:
The text was updated successfully, but these errors were encountered: