2017-09-24 7 views
0

하이퍼 레저가있는 응용 프로그램을 작성하려고하는데 다른 체인 코드의 체인 코드와 통신 할 방법을 찾고있었습니다. 하이퍼 레저에서 가능합니까?체인 코드가 다른 체인 코드와 상호 작용할 수 있습니까?

나는 다른 똑똑한 계약과 통신하기 위해 이더넷에서 가능한 일을 알고 있지만, 초보자도 마찬가지입니다. 같은 관련 링크를 찾을 수 없습니다. 이것에 접근하는 방법에 대한 제안은 정말 도움이 될 것입니다.

나는 Writing Your First Application을 체크 아웃했는데, 동일한 설명을 찾을 수 없었다. 여기

// 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 

당신이 그것을 사용하는 방법의 예는 다음과 같습니다 :

답변

1

Chaincode는 예를 들어, ChaincodeStubInterfaceAPI 기존 활용의 수단으로 다른 chaincode와 상호 작용할 수있는 코스 피어의

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

해야 권리와 체인 코드가 설치되어 있어야합니다.