1

I have a question about chaincode instantiation. I think all same chaincode in a channel will be instantiated all at once by one request from this doc.

http://hyperledger-fabric.readthedocs.io/en/release-1.1/install_instantiate.html

Note: The initial instantiation applies to all peers in the channel, and is affected upon any peer that has the chaincode installed.

but in my vagrant environment with v1.0.6 fabric, always only one (of three installed cc on endorsers) chaincode is instantiated by my Instantiate request from Node SDK. then it seems that if any other proposal request is received, that endorser start to instantiate other chaincode. so if my endorsement policy needs that endorsement, first invoke request is failed...

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

2

Initially, chaincode will only be launched on peers to which you send the actual instantiate proposal. It will then be launched on other peers in the channel upon the first invoke request. If you want to have the chaincode launched at instantiate time, you need to send the instantiate request to all of the endorsing peers. The channel.sendInstantiateProposal takes a ChaincodeInstantiateUpgradeRequest which allows you to specify an array of peers in it's target property.

Gari Singh
  • 11,418
  • 2
  • 18
  • 41