nebulasio / go-nebulas

Official Go implementation of the Nebulas protocol.
https://nebulas.io
GNU Lesser General Public License v3.0
712 stars 203 forks source link

Event functionality #25

Closed fbzhong closed 6 years ago

fbzhong commented 6 years ago

Since Smart Contract and Transaction is executed in async way, submit and wait. As a developers or users, they are want to know when the submitted tx is onchain, or notice them it's done.

So in nebulas, we introduce the Event functionality, as the following:

  1. Smart Contract developers can define their own Event in Smart Contract. After successful execution, the events will be triggered in order.
  2. Developers can subscribe the successful events.
fbzhong commented 6 years ago

@royshang For the event, we may need a trie to store them and keep them consistent.

fbzhong commented 6 years ago

@LeonLi000 the event functionality in Network/Dispatcher should be use the commit above.

fbzhong commented 6 years ago

We should follow up the following working items:

  1. add Event trie and Event Trigger Point in Core for ChainEventCategory, by @royshang
  2. add Event Hook in Network for NodeEventCategory, by @LeonLi000
  3. add Server Push RPC API in rpc, by @qywang2012 we can use Server streaming RPCs in gRPC, have no idea in HTTP.
  4. add Event functionality and Event Hook in NVM for ChainEventCategory, by @fbzhong
  5. add EventEmitter in Neblet, by @LeonLi000
royshang commented 6 years ago

done.