I am using below code for submitting a transaction in fabric but not getting committing transaction Id in node js SDK
let eventHub = await hlcConnection.channel.newChannelEventHub(hlcConnection.peer);
// eventHub = await hlcConnection.channel.getChannelEventHubsForOrg("updevop1");
//eventHub = await hlcConnection.channel.getChannelEventHubsForOrg();
let txPromise = new Promise((resolve, reject) => {
let handle = setTimeout(() => {
eventHub.unregisterTxEvent(transactionIdString);
eventHub.disconnect();
resolve({event_status: "TIMEOUT"});
}, 30000);
eventHub.registerTxEvent(transactionIdString, (tx: any, code: any, block: any) => {
clearTimeout(handle);
const returnsStatus = {event_status: code, tx_id: tx};
if (code !== "VALID") {
console.error("The transaction was invalid, code = " + code);
resolve(returnsStatus);
} else {
console.log("The transaction has been committed on peer " + eventHub.getPeerAddr());
resolve(returnsStatus);
}
}, (err: any) => {
//this is the callback if something goes wrong with the event registration or processing
reject(new Error("There was a problem with the eventhub ::" + err));
},
{startBlock: null} //disconnect when complete
);
eventHub.connect();
});
promises.push(txPromise);
I am getting temp txid 4826e50b51d505c31c6529a1699d51a8c78aaa6b0b360f92f44f8be7855b08cf but commiting id "transactionId": "e8622f67-9987-46c6-9094-93deb464184c"
I am not able to get this committing ID at the time of event hub Please help me to resolve this issue