Home > Backend Development > Golang > Can Chaincodes in Hyperledger Fabric Node SDK Identify their Callers?

Can Chaincodes in Hyperledger Fabric Node SDK Identify their Callers?

Barbara Streisand
Release: 2024-10-31 18:48:29
Original
368 people have browsed it

 Can Chaincodes in Hyperledger Fabric Node SDK Identify their Callers?

Getting Chaincode Caller ID in Hyperledger Fabric Node SDK: Is It Possible?

Problem:

Consider the network architecture:

A -> Chaincode1 -> fabcar
Copy after login

When Chaincode1 invokes fabcar using APIstub.InvokeChaincode(), can fabcar retrieve the caller chaincode ID?

Question:

Is there any way for fabcar to obtain the caller chaincode ID or information specific to Chaincode1?

Answer:

No.

Currently, chaincodes do not have individual identities, so fabcar cannot directly obtain the caller chaincode ID. The getCreator() method only returns the caller organization, which is not specific enough.

Additional Attempts and Findings:

The getSignedProposal() method was investigated as a potential solution. However, its resulting SignedProposal object does not provide explicit access to the caller chaincode ID or related information.

Conclusion:

Retrieving the caller chaincode ID by the called chaincode (fabcar) is not feasible in Hyperledger Fabric Node SDK at this time.

The above is the detailed content of Can Chaincodes in Hyperledger Fabric Node SDK Identify their Callers?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template