Hyperledger Fabric. Is it possible to deploy more than one chaincode to the same channel?

馋奶兔 提交于 2019-12-10 15:16:36

问题


Is it possible to deploy two different chaincodes to the same channel in Hyperledger fabric


回答1:


Yes. And its possible to deploy the same chaincode to 2 or more channels. You can even deploy the same chaincode to the same channel if you use a different name.




回答2:


when inspect into the block structure, I find a 'Chaincode Name' field in block, and I suppose that:

  • One channel has one ledger(offcial doc)
  • One channel can have two or more chaincodes
  • The block generated by different chaincode(we can simplely think so) will be stored in the same one ledger
  • The field 'Chaincode Name' in block will distinguish it's generated from which chaincode



回答3:


jworthington answer is correct but i want to clear some things from comments.

  • One channel means one ledger. (official doc)
  • Every chaincode have separated "view" on ledger (I visualize it as every key in db has chaincode name prefix and chaincode can access only specific keys with same prefix as its name).
  • You can invoke read/write of second chaincode from first one and that will make only one blockchain transaction (at condition that chaincodes are on same channel/ledger, if they are not, write operation will be ignored)


来源:https://stackoverflow.com/questions/49731706/hyperledger-fabric-is-it-possible-to-deploy-more-than-one-chaincode-to-the-same

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