When does a stream item become available to the node

+1 vote
We are using streams to record events within a series of nodes.  Our stream items are created via externally signed raw transactions submitted to a node.  We have found that when we create a new stream item there seems to be small period whereby a get stream item using the key from the previous create will not find the stream item.

Just to clarify the behaviour, when can we expect a stream item to be available for fetching from the stream upon receipt of a transaction?  I suspect our service needs to handle a window between the transaction to create the stream item being accepted and the item being available on the stream for discovery via the api?




asked Jun 26, 2018 by marty

1 Answer

0 votes
I assume you're publishing on one node and then retrieving the data on another. In that case there will be indeed be an (inevitable) delay, due to transaction propagation. As soon as the transaction arrives on the second node, the stream item will be available.
answered Jun 27, 2018 by MultiChain
Actually this is a publish followed by a retrieve on the same node.  It caught us out because the get came straight after the publish and because it didn't find the first published item, the client created a second.
OK. Can you please post an example of the full API commands used for publishing and retrieving, so we can take a detailed look here.