Blockchain 链码能否与其他链码交互?

Blockchain 链码能否与其他链码交互?,blockchain,hyperledger-fabric,hyperledger,Blockchain,Hyperledger Fabric,Hyperledger,我正在尝试用hyper ledger编写一个应用程序,我正在寻找一种与另一个链码中的链码通信的方法。这在超级分类账中可能吗 我知道在etherum中可以与其他智能合约进行通信,但在hyperledger中也是如此。我找不到任何与此相关的链接。任何关于如何实现这一点的建议都将非常有用 我已签出,但找不到合适的解释。链码可以通过利用现有的链码接口与其他链码进行交互,例如: // InvokeChaincode locally calls the specified chaincode `Invoke

我正在尝试用hyper ledger编写一个应用程序,我正在寻找一种与另一个链码中的链码通信的方法。这在超级分类账中可能吗

我知道在etherum中可以与其他智能合约进行通信,但在hyperledger中也是如此。我找不到任何与此相关的链接。任何关于如何实现这一点的建议都将非常有用


我已签出,但找不到合适的解释。

链码可以通过利用现有的
链码接口与其他链码进行交互,例如:

// InvokeChaincode locally calls the specified chaincode `Invoke` using the
// same transaction context; that is, chaincode calling chaincode doesn't
// create a new transaction message.
// If the called chaincode is on the same channel, it simply adds the called
// chaincode read set and write set to the calling transaction.
// If the called chaincode is on a different channel,
// only the Response is returned to the calling chaincode; any PutState calls
// from the called chaincode will not have any effect on the ledger; that is,
// the called chaincode on a different channel will not have its read set
// and write set applied to the transaction. Only the calling chaincode's
// read set and write set will be applied to the transaction. Effectively
// the called chaincode on a different channel is a `Query`, which does not
// participate in state validation checks in subsequent commit phase.
// If `channel` is empty, the caller's channel is assumed.
InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response
下面是一个如何使用它的示例:

response := stub.InvokeChaincode(chaincodeName, chainCodeArgs, channelName)

当然,对等方应该拥有安装的权限和链码。

链码可以通过利用现有的
链码接口与其他链码进行交互,例如:

// InvokeChaincode locally calls the specified chaincode `Invoke` using the
// same transaction context; that is, chaincode calling chaincode doesn't
// create a new transaction message.
// If the called chaincode is on the same channel, it simply adds the called
// chaincode read set and write set to the calling transaction.
// If the called chaincode is on a different channel,
// only the Response is returned to the calling chaincode; any PutState calls
// from the called chaincode will not have any effect on the ledger; that is,
// the called chaincode on a different channel will not have its read set
// and write set applied to the transaction. Only the calling chaincode's
// read set and write set will be applied to the transaction. Effectively
// the called chaincode on a different channel is a `Query`, which does not
// participate in state validation checks in subsequent commit phase.
// If `channel` is empty, the caller's channel is assumed.
InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response
下面是一个如何使用它的示例:

response := stub.InvokeChaincode(chaincodeName, chainCodeArgs, channelName)

当然,对等方应该拥有安装的权限和链码。

API链接已断开。你能帮帮我吗?@WebArtisan我追踪到了回购协议。链接将您指向
接口。转到
所以,我认为应该是这个文件。在chaincode到chaincode调用中,如果当前chaincode调用“同一通道”中另一个chaincode的私有数据事务,会发生什么情况?目前,HLF版本为1.4.4API链接已断开。你能帮帮我吗?@WebArtisan我追踪到了回购协议。链接将您指向
接口。转到
所以,我认为应该是这个文件。在chaincode到chaincode调用中,如果当前chaincode调用“同一通道”中另一个chaincode的私有数据事务,会发生什么情况?目前,HLF版本为1.4.4