Transaction event is not emitted after successful invoke #fabric-sdk-node

Kumari Shweta

Hi Team,
I am using fabric node sdk api for events.
Transaction (commitEvent) is not working.New block is generated successfully but transaction event is not emitted.

Passing eventhandler option in gatewayoption in following way.



    await gateway.connect(ccp, {


        identity: appUser,

        discovery: {

            enabled: true,

            asLocalhost: true


                eventHandlerOptions: {

                commitTimeout: 300,

                strategy: DefaultEventHandlerStrategies.MSPID_SCOPE_ANYFORTX


       // }




const listener = (error, event) => {

           console.log("event is called................");

    if (error) { 


    } else {

// Handle transaction commit event




const peers = network.getChannel().getEndorsers("Org1MSP");

const transaction =  contract.createTransaction("createCar");


await network.addCommitListener(listener, peers, transaction.getTransactionId());

const result =  await transaction.submit('createCar' ,'CAR1112', 'Honda', 'Accord', 'Black', 'Tom' );

console.log('Transaction has been submitted');

let me correct if anything wrong.



Mark Lewis

See the answer to the same question with nearly identical client code here:

You are attaching your listener in the correct place, but it's listening for a transaction that is never submitted and is duplicating work that happens as part of the submit anyway.

Mark Lewis

If you do want to provide your own implementation of how the client waits for a submitted transaction to be committed by network peers, this tutorial has some useful information: