Re: #hyperledger-fabric Contract to call a Contract within the same chaincode #hyperledger-fabric


Matthew White
 

Hello,

 

I’d suggest looking at the `fabric-contract-api-go` that will do exactly what you want. Specifically https://github.com/hyperledger/fabric-contract-api-go/blob/main/tutorials/getting-started.md#declaring-a-contract

 

Thanks Mathew

 

From: fabric@... <fabric@...> On Behalf Of adineshreddy1mt@...
Sent: 18 April 2022 14:29
To: fabric@...
Subject: [EXTERNAL] [Hyperledger Fabric] #hyperledger-fabric Contract to call a Contract within the same chaincode

 

Hello , I am trying to implement multiple contracts in a single chaincode in Go lang. Ref:(https://hyperledger-fabric.readthedocs.io/en/release-2.3/smartcontract/smartcontract.html#terminology) We have a method called `InvokeChaincode(chaincodeName ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Hello ,

I am trying to implement multiple contracts in a single chaincode in Go lang.

Ref:(https://hyperledger-fabric.readthedocs.io/en/release-2.3/smartcontract/smartcontract.html#terminology)
We have a method called `InvokeChaincode(chaincodeName string, args [][]byte, channel string)` where we will  invoke a method ,from one chaincode to another  method of another chaincode.,

Do we have any methods where a contract will call another contract in a same chaincode in Fabric Go-SDK.

Eg:

Vehicle chaincode{
       Car contract{
           create car,
           query car
        }
       boat contract{
           create boat,
           query boat
        }
       person contract{
           updatevehicles vehicles,
           queryvehicles vehicles
        }
}

Call create car(car contract) and create boat(Boat contract) in person contract 
smart.diagram2

Thanks in-advance.

Thanks,
Dinesh. A

Join fabric@lists.hyperledger.org to automatically receive all group messages.