cothority icon indicating copy to clipboard operation
cothority copied to clipboard

Subscription for eventlog (SecureKG)

Open kc1212 opened this issue 6 years ago • 1 comments
trafficstars

EventLog client need an API like this:

public void subscribeEventLog(EventProcessor p, SkipBlockID blockID)
public interface EventProcessor { void process(EventBatch es); void error(String s); }
public void unsubscribeEventLog(EventProcessor p)

to listen to new events. Where EventBatch represent all the events in a block, i.e., it includes a skipblock ID and a list of events in that block.

Writing the API this way will allow us to avoid adding any new server-side code, since ByzCoin can already listen to events. The client downloads all the blocks from the given blockID to the latest block, and at the same time starts the ByzCoin listening API. With the appropriate buffering, the client should be able to streaming all the events from the given blockID. Some work needs to be done to decode the transactions because we need to run the contract code to turn them into events. The contract code is not currently available on the client.

kc1212 avatar Dec 10 '18 11:12 kc1212

Take a look, maybe, @pierluca .

jeffallen avatar Sep 17 '20 14:09 jeffallen