I am using fabric 2.1, with new client library fabric-network. I have configured network, created channel, installed chaincode, etc. I could invoke transactions through CLI.
Fabric Version: 2.1 fabric-network:2.1
I have defined Event Handler Strategy as below 1) strategy: DefaultEventHandlerStrategies.MSPID_SCOPE_ANYFORTX
2) strategy: createTransactionEventHandler
await gateway.connect(ccp, {
wallet, identity: username, discovery: { enabled: true, asLocalhost: true }, transaction: {
strategy: DefaultEventHandlerStrategies.MSPID_SCOPE_ANYFORTX
}
});
When I submit the transaction, getting an empty buffer in both cases instead of transaction id(Not sure if we get tx id).
The invoked transaction is getting added to the blockchain. I confirmed it from CouchDB and querying the asset.
> let result = await contract.submitTransaction(fcn, args[0], args[1],args[2], args[3], args[4]);
I tried with a custom event handler, but this function is not getting triggered. strategy: createTransactionEventHandler
const createTransactionEventHandler = (transactionId, network) => { const mspId = network.getGateway().getIdentity().mspId; const myOrgPeers = network.getChannel().getEndorsers(mspId); console.log(`tx id : ${transactionId}`) return new MyTransactionEventHandler(transactionId, network, myOrgPeers); }
Does anyone have any suggestions?