In Fabric how chaincode versioning happen internally?

Scenario:

I am creating hyperledger infrastructure with two organizations each having two peers and one orderer joining two channel.

Questions:

  1. How are we define channels at the time of chain-code installation?
  2. How the chain-code version maintains internally?

Thanks

#hyperledger #blockchain

2.50 GEEK