Reputation: 1053
What happens during chaincode install and instantiate in Hyperledger fabric?
Upvotes: 1
Views: 306
Reputation: 474
Install:
The process of placing a chaincode on a peer’s file system.
Instantiate:
The process of starting and initializing a chaincode application on a specific channel. After instantiation, peers that have the chaincode installed can accept chaincode invocations. As it's related to channel, you do not need to instantiate from every peer on this channel, once it's instantiate by maintaining some valid process, the rules will be same for each participating node.
NOTE: This method i.e. Instantiate was used in the 1.4.x and older versions of the chaincode lifecycle. For the current procedure used to start a chaincode on a channel with the new Fabric chaincode lifecycle introduced as part of Fabric v2.0, see Chaincode-definition_.
So from Fabric v2.0 or later, you have to commit the chaincode after proper approval process instead of Instantiate.
Upvotes: 0
Reputation: 86
Chaincode installation means keeping chaincode on the peers of the ledger. chaincode instantiation means initializing chaincode with the set of parameters with we pass through chaincode command.
Installing the chaincode on the peers is required and instantiating the chaincode is not necessary.
Upvotes: 0
Reputation: 1053
A common misunderstanding when interacting with chaincode on the network is the difference between chaincode installation and instantiation. It is important that all peers on the network MUST have chaincode installed, but not instantiated.
Chaincode installation means that we are putting the source code (of our chaincode) on a specific peer. Chaincode instantiation means that we are initializing the chaincode source code. This is done by passing through a set of initialization arguments attached to the instantiate command. Please note that, even though the chaincode is installed on the peer, when chaincode gets instantiated, it is instantiated on the channel.
Upvotes: 1