Flowee the Hub — API documentation


Block Notification API

This is a subscription style service. Clients can subscribe to receive block notifications with NewBlockOnChain messages whenever a new block is found by the Hub.

The service ID for this service is 18.



Subscribing doesn’t require any special field, just a simple message.


Unsubscribing doesn’t require any special field, just a simple message.



Normally blocks come in sequence, but sometimes two miners make a block at the same time and for a while there is insecurity which block becomes part of the chain. The Hub can thus have in this time either of the two blocks as its tip of the chain. And there is a risk that the Hub may have to revert its tip and switch over to the other block that was mined at the same time.

This event we call a reorg and while this kind of event is rare, it is a natural result of our decentralized nature. When the Hub encounters such an event it will let subscribers to the block notification service know.

The message sent by the Hub will repeat the BlockHash/BlockHeight pair for every block that was needed to be reverted. While 1-block reorgs are rare, multi-block ones are extremely rare. But we do allow for the situation and we send a BlockHash/BlockHeight pair for each of the blocks that gets reverted.