[go: up one dir, main page]

Event service [API v3]

Design and implement an Event service to compliment !557 (merged).

Preliminary design

type EventService interface {
	// Subscribe subscribes to event notifications. The channel will be closed
	// once the context is canceled. Subscribe will leak goroutines if the
	// context is not canceled.
	Subscribe(ctx context.Context, opts SubscribeOptions) (<-chan Event, error)
}

Events must include:

  • BlockEvent - sent after each block is completed, should be a 'fat ping' that lists not just the chain entries, but includes the objects they reference such as transactions and signatures, to minimize the queries recipients will subsequently send.

Events may include:

  • GlobalsEvent - sent when global variables are changed, so that tools like APIs can easily update routing tables/etc without needing to manually process each block event.
Edited by Ethan Reesor