0

How to interact multiple chaincode in go lang for hyperledger fabric how to call one function into another chaincode in hyperledger fabric

1 Answers1

0

Assuming you are using fabric-contract-api-go for your smart contract implementation:

  1. Get the chaincode stub from the transaction context with GetStub()
  2. Use the stub to invoke the second chaincode with InvokeChaincode()

If you are using the low-level fabric-chaincode-go for your chaincode implementation then your transactions are invoked with the chaincode stub rather than a transaction context, so you can ignore step one and just call InvokeChaincode() on the stub.

bestbeforetoday
  • 1,302
  • 1
  • 8
  • 12