0 votes
1 view
in Blockchain by (7k points)

I'd like to call another chaincode from inside a chaincode's Invoke() method. What's the recommended way to do this? I guess I can use the standard REST API on /chaincode and reference to it by its ID (returned by the deploy operation), but are there "system" GO APIs to accomplish this, also, can I reference the chaincode by name instead of the ID?

1 Answer

0 votes
by (14.5k points)

There are 2 samples in the path: 

fabric/ folder examples/chaincode/go/chaincode_example04 examples/chaincode/go/chaincode_example05

These samples might help you.

Both of them invoke chaincode_example02. The only difference between them is that chaincode_example04 hardcodes chaincode_example02's ID and chaincode_exampl05 gets the ID from an argument.

At the present time, one cannot reference chaincode by name (except in "dev" mode).

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...