coding
coding

Reputation: 687

Seems to me that in the Hyperledger Fabric test-network, only chaincode that created the asset has access to it

I was using Fabric Java chaincodes and CLI to work with the creation of assets by different chaincodes in the same channel, and it seems to me that only the chaincode that defined that particular access can implement getStringState/putStringState in its logic for that asset, so it works. Other chaincodes return nothing. it is network https://github.com/hyperledger/fabric-samples/tree/main/test-network that I am using.

I am also interested how to put restrictions in networks where there is not this kind of restriction,

Upvotes: 0

Views: 21

Answers (1)

bestbeforetoday
bestbeforetoday

Reputation: 1649

In Hyperledger Fabric, each chaincode has its own namespace. In other words, each chaincode has its own world state, separate from all other chaincode. Only the chaincode that stored some state can then read, update or delete that state within its transaction functions.

See the Namespaces section of Fabric's Ledger documentation for more details.

Upvotes: 0

Related Questions