Reputation: 101
Being new to Blockchain and Hyperledger Fabric I am trying to find answers to the below questions,
I am planning to use the IBM Bluemix starter plan and install a chaincode to a sample fabric network using a BNA developed in Hyperledger composer.
In a multi-org, multi-peer setup (real world scenario) where does the chaincode exist (or gets installed) in the Hyperledger Fabric network - is it confined to a specific peer or all the peers in a channel?
If the chaincode is residing in a specific peer then what happens to the network in case the peer is down (due to connectivity disruption or other unforeseen calamities) - will the whole channel be unable to operate without a chaincode?
How can multiple chaincodes in various peers access the same set of data in hyperledger fabric?
Upvotes: 1
Views: 838
Reputation: 1644
In a multi-org, multi-peer setup (real world scenario) where does the chaincode exist (or gets installed) in the Hyperledger Fabric network - is it confined to a specific peer or all the peers in a channel?
Chaincodes are installed on every peer which has to endorse a given transaction. Endorsement involves execution of the chaincode with some given arguments, finding out the result and signing it (with MSP of the org that the peer is a part of). Chaincodes are installed on a per peer basis and can be instantiated on one or more channels. If peer is belonging to a channel but is not endorsing any transactions, then it doesn't need not the chaincode. It can just choose to store the ledger of the given channel (act as a committing peer).
If the chaincode is residing in a specific peer then what happens to the network in case the peer is down (due to connectivity disruption or other unforeseen calamities) - will the whole channel be unable to operate without a chaincode?
If there is more than one endorsing peer per organization's MSP, you can sign and continue transactions smoothly. Setting up more than one peer per ORG MSP can help in crash fault tolerance as you have explained. Secondly, if there is only one peer per ORG MSP and your endorsement policy is such that you absolutely require the signature of that MSP for your transaction to go through only then the channel's transaction for that given chaincode will fail. Other chaincodes on the same channel, that does not require this signature will still continue to function fine.
How can multiple chaincodes in various peers access the same set of data in hyperledger fabric?
By permission, it means that if the invoker organization's MSP has rights to access the channel. So if you are trying to invoke Channel2's data from Channel1 then you (the invoking client) has to be a part of that channel either as a reader/writer.
Upvotes: 4