Hi,
Currently, I am working on streams. I have used the following code to publish data in the stream using node.js.
packet = new Buffer(data[0]).toString("hex")
mc.publish({ stream: "datastream", key: "through", data: packet }).then(x => {
sucess++;
//total_size += passedSize;
callback(null, sucess);
}).catch(y => {
//sucess++;
//total_size += passedSize;
callback(null, sucess);
})
Here, I want to find the latency of adding data in the block for publishing data in the stream. But I think in this code, the callback is returned when data is added as an unspent transaction. But I want to wait till it added in the block. How to do that? any help?
here is the parameter:
chain-protocol = multichain
chain-description = MultiChain buchain
root-stream-name = root
root-stream-open = true
chain-is-testnet = false
target-block-time = 2
maximum-block-size = 1000000000
# Global permissions
anyone-can-connect = false
anyone-can-send = false
anyone-can-receive = false
anyone-can-receive-empty = true
anyone-can-create = false
anyone-can-issue = false
anyone-can-mine = false
anyone-can-activate = false
anyone-can-admin = false
support-miner-precheck = true
allow-arbitrary-outputs = false
allow-p2sh-outputs = true
allow-multisig-outputs = true
setup-first-blocks = 60
mining-diversity = 0.3
admin-consensus-upgrade = 0.5
admin-consensus-admin = 0.5
admin-consensus-activate = 0.5
admin-consensus-mine = 0.5
admin-consensus-create = 0.0
admin-consensus-issue = 0.0
lock-admin-mine-rounds = 10
mining-requires-peers = true
mine-empty-rounds = 10
mining-turnover = 0.5
initial-block-reward = 0
first-block-reward = -1
reward-halving-interval = 52560000
reward-spendable-delay = 1
minimum-per-output = 0
maximum-per-output = 100000000000000
minimum-relay-fee = 0
native-currency-multiple = 100000000
skip-pow-check = false
pow-minimum-bits = 1
target-adjust-freq = -1
allow-min-difficulty-blocks = false
only-accept-std-txs = true
max-std-tx-size = 100000000
max-std-op-returns-count = 1024
max-std-op-return-size = 2097152
max-std-op-drops-count = 5
max-std-element-size = 32768
Thanks in advance.