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
In general we have two types of clients who can interact with blockchain node:
users with help of their gadgets and web apps. They usually just request latest state of blockchain so they use queries and they do not need streaming too much.
external program components which can interested in getting stream of blocks
As an examples of second type clients we can consider:
external component which can subscribe to blocks and put them into OLAP database for advanced analytics other blockchain
external component which can process blocks and provide blockchain explorer capabilities for users
external component which can be an oracle so it consumeы blocks and can respond with extrinsic in blockchain
etc
For such clients preferable way of interaction is a streaming of blocks. It allows utilize resources better and get blocks as soon as they were produced. Additional to implementing feature of streaming blocks it is reasonable to allow to specify block number from which stream of blocks must start.
Let's say current height is 1000 and blocks have persisted in the node. Client can specify starting block number as 950. In this case first block in stream will have block number 950 and then will be send all persisted blocks until block with number 1000 and then will be sent all next blocks was produces since subscription begins(1000+).
Motivation for this feature it is that external component can be down for some time so the block that was produced during downtime will be missed. Handling such case require additional logic before the component starts and it makes processing of blocks more complex. Specifying next required block allows to our node clients make block processing simpler and smoother so it makes work with our blockchain more developer friendly.
The text was updated successfully, but these errors were encountered:
In general we have two types of clients who can interact with blockchain node:
As an examples of second type clients we can consider:
For such clients preferable way of interaction is a streaming of blocks. It allows utilize resources better and get blocks as soon as they were produced. Additional to implementing feature of streaming blocks it is reasonable to allow to specify block number from which stream of blocks must start.
Let's say current height is 1000 and blocks have persisted in the node. Client can specify starting block number as 950. In this case first block in stream will have block number 950 and then will be send all persisted blocks until block with number 1000 and then will be sent all next blocks was produces since subscription begins(1000+).
Motivation for this feature it is that external component can be down for some time so the block that was produced during downtime will be missed. Handling such case require additional logic before the component starts and it makes processing of blocks more complex. Specifying next required block allows to our node clients make block processing simpler and smoother so it makes work with our blockchain more developer friendly.
The text was updated successfully, but these errors were encountered: