You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
blocks, block headers and block digest data providers
Based on the Draft design of new WebSockets, blocks, block headers and block digests data providers should be implemented as part of the new WebSocket pub/sub system. The draft design document describes all requirements and relationships between components.
Requirements:
Blocks, block headers and block digests data providers constructors should be implemented. Each constructor should create a corresponding subscription.Subscription based on input arguments, and store topic, subscription and other necessary parameters in a newly created instance. These constructors should be called in a DataProviderFactory::NewDataProvider method.
messagesHandler should be implemented for each handler type. This method will be triggered by the constructor in the separate goroutine and will run in a forever loop until the subscription is closed. This method collects streaming data from the subscription, similar to how we do it, for example in SubscribeBlockHeadersFromStartBlockID:
Then the data is formatted in response messages for the client and written to the broadcastMessage callback. The data response message structure is next:
{
id: 'sub123',
topic: 'blocks',
data: [...],
}
The Close method should be implemented to gracefully shut down the subscription and close messagesHandler processing.
ID and Topic getters should return subscription.Subscription ID and topic that stores in the handler.
The content you are editing has changed. Please copy your edits and refresh the page.
Guitarheroua
changed the title
[Access] Add implementation BlockSubscriptionHandler for blocks subscription
[Access] Add implementation BlockSubscriptionHandler for blocks subscriptions
Oct 22, 2024
Guitarheroua
changed the title
[Access] Add implementation BlockSubscriptionHandler for blocks subscriptions
[Access] Add implementation BlockSubscriptionHandler, BlockHeaderSubscriptionHandler and BlockDigestsSubscriptionHandler for blocks and block headers subscriptions
Oct 22, 2024
Guitarheroua
changed the title
[Access] Add implementation BlockSubscriptionHandler, BlockHeaderSubscriptionHandler and BlockDigestsSubscriptionHandler for blocks and block headers subscriptions
[Access] Add implementation for blocks, block headers and block digests data providers
Nov 12, 2024
blocks, block headers and block digest data providers
Based on the Draft design of new WebSockets, blocks, block headers and block digests data providers should be implemented as part of the new WebSocket pub/sub system. The draft design document describes all requirements and relationships between components.
Requirements:
Blocks, block headers and block digests data providers constructors should be implemented. Each constructor should create a corresponding
subscription.Subscription
based on input arguments, and storetopic
,subscription
and other necessary parameters in a newly created instance. These constructors should be called in aDataProviderFactory::NewDataProvider
method.messagesHandler
should be implemented for each handler type. This method will be triggered by the constructor in the separate goroutine and will run in a forever loop until the subscription is closed. This method collects streaming data from the subscription, similar to how we do it, for example inSubscribeBlockHeadersFromStartBlockID
:flow-go/access/handler.go
Lines 1181 to 1182 in 3496c0f
Then the data is formatted in response messages for the client and written to the
broadcastMessage
callback. The data response message structure is next:The
Close
method should be implemented to gracefully shut down the subscription and closemessagesHandler
processing.ID
andTopic
getters should returnsubscription.Subscription ID
and topic that stores in the handler.Tasks
The text was updated successfully, but these errors were encountered: