I was following the tutorial at https://developer.ibm.com/tutorials/ibm-blockchain-platform-vscode-smart-contract/ and when I submit a transaction via the IBM blockchain platform VS code extension, I get the error:
"Error submitting transaction: No successful events received".
The function called was 'instantiate' as shown below:
public async instantiate(ctx: Context): Promise<any> {
const greeting = { text: 'Instantiate was called!' };
await ctx.stub.putState('GREETING', Buffer.from(JSON.stringify(greeting)));
}
Running this will successfully write to the ledger in fact even though an error was thrown. I was able to query the ledger afterwards and saw the right value "{ text: 'Instantiate was called!' }" was returned.
Here's the error trace when I ran the unit test for instantiate
. Hope it helps:
Error: No successful events received
at AllForTxStrategy.checkCompletion (node_modules/fabric-network/lib/impl/event/allfortxstrategy.js:34:12)
at AllForTxStrategy.errorReceived (node_modules/fabric-network/lib/impl/event/abstracteventstrategy.js:67:8)
at TransactionEventHandler._onError (node_modules/fabric-network/lib/impl/event/transactioneventhandler.js:126:17)
at EventRegistration.eventHub.registerTxEvent [as _onErrorFn] (node_modules/fabric-network/lib/impl/event/transactioneventhandler.js:90:20)
at EventRegistration.onError (node_modules/fabric-network/node_modules/fabric-client/lib/ChannelEventHub.js:1709:9)
at ChannelEventHub._closeAllCallbacks (node_modules/fabric-network/node_modules/fabric-client/lib/ChannelEventHub.js:867:15)
at ChannelEventHub._disconnect (node_modules/fabric-network/node_modules/fabric-client/lib/ChannelEventHub.js:625:8)
at ClientDuplexStream._stream.on (node_modules/fabric-network/node_modules/fabric-client/lib/ChannelEventHub.js:539:11)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at ClientDuplexStream.Readable.push (_stream_readable.js:219:10)
at Object.onReceiveMessage (node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:1292:19)
at InterceptingListener.recvMessageWithContext (node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:607:19)
at /Users/chana/projects/ibm-bp/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:706:14