logo
Docs « Api

Service/BlockNotification

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.

Messages

Subscribe

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

Hub / BlockNotification. sId=18 mId=0

Unsubscribe

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

Hub / BlockNotification. sId=18 mId=2

NewBlockOnChain

Hub / BlockNotification. sId=18 mId=4
BlockHash: 5bytearray32-byte blockhash of the new block.
BlockHeight: 7numberHeight of the block in the chain.