Re: Question about invokeChaincode api #fabric-chaincode

David Faulstich Diniz Reis


The chaincode has a unique identifier in the network when it is running. If a chaincode calls itself (another function) using invokeChaincode method, an error will occur.  You have to call the function directly without using invokeChaincode method. 

If a chaincode invokes another chaincode in the same channel, both calls will have their write sets appended to the transaction.

If a chaincode invokes another chaincode in another channel, it will be considered a query and no changes will be applied to the second chaincode state.

Best regards.


Em sex., 17 de dez. de 2021 às 08:24, BigBang019 <zhuxy0000@...> escreveu:

Environment: fabric release-2.2
My chaincode named vulnerable is as follows:

When I invoke helloworld directly, it gives me responce "helloworld", everything works fine.

But when I invoke invokeChaincode method, it gives me

and chaincode docker container logging is as follows:

It seems like
(1) the statement System.out.printf("\n%s\n", chaincodeName) works fine.
(2) org.hyperledger.fabric.shim.impl.InvocationStubImpl.invokeChaincode also finds the registered method helloworld, but it encountered another exception half way the invocation.

Does anyone met this problem before?
Thanks in advance.

Join to automatically receive all group messages.