Can a World State variable be accessed by a chainc

2019-05-21 01:59发布

If a chaincode A stores a variable V to the World State can this variable V be accessed by another chaincode B?

In other words, are variables in the World State access protected?

If it is not possible, how can I make chaincode B read the variables from chaincode A (I need it for my use case)?

1条回答
smile是对你的礼貌
2楼-- · 2019-05-21 02:03

No, variables stored by some chaincode A can only be accessed by the same chaincode A. So if a chaincode B tries to access the variable V, access will be denied.

If you wanted to access such variables (because your use case requires interconnection between chaincodes) you can invoke/query chaincode A from chaincode B using this.

查看更多
登录 后发表回答