Hyperledger Fabric. Is it possible to deploy more

2019-06-24 05:03发布

问题:

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)