Chaincode (smart contract) interactions within and across channels in Hyperledger Fabric

纵然是瞬间 提交于 2019-12-05 17:39:37

Peers can only execute chaincode that they have installed and have access to (local). You can have multiple chaincode for a given peer, but you can't have peers executing chaincode of other peers.

From ChaincodeStub.invokeChaincode(chaincodeName, args, channel) documentation at https://fabric-shim.github.io/ChaincodeStub.html#invokeChaincode__anchor:

Locally calls the specified chaincode invoke() using the same transaction context; that is, chaincode calling chaincode doesn't create a new transaction message.

You should be able to install each chaincode for all peers and use the ChaincodeStub.invokeChaincode method along with the ClientIdentity class (https://fabric-shim.github.io/ClientIdentity.html) to handle with access control.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!