code: func DeployedChaincodes(q Query, filter ChaincodePredicate, loadCollections bool, chaincodes ...string) (chaincode.MetadataSet, error) {
  	defer q.Done()
  
  	var res chaincode.MetadataSet
  	for _, cc := range chaincodes {
  		data, err := q.GetState("lscc", cc)
  		if err != nil {
  			Logger.Error("Failed querying lscc namespace:", err)
  			return nil, errors.WithStack(err)
  		}
  		if len(data) == 0 {
  			Logger.Info("Chaincode", cc, "isn't instantiated")
  			continue
  		}
  		ccInfo, err := extractCCInfo(data)
  		if err != nil {
  			Logger.Error("Failed extracting chaincode info about", cc, "from LSCC returned payload. Error:", err)
  			continue
  		}
  		if ccInfo.Name != cc {
  			Logger.Error("Chaincode", cc, "is listed in LSCC as", ccInfo.Name)
  			continue
  		}
  
  		instCC := chaincode.Metadata{
  			Name:    ccInfo.Name,
  			Version: ccInfo.Version,
  			Id:      ccInfo.Id,
  			Policy:  ccInfo.Policy,
  		}
  
  		if !filter(instCC) {
  			Logger.Debug("Filtered out", instCC)
  			continue
  		}
  
  		if loadCollections {
  			key := privdata.BuildCollectionKVSKey(cc)
  			collectionData, err := q.GetState("lscc", key)
  			if err != nil {
  				Logger.Errorf("Failed querying lscc namespace for %s: %v", key, err)
  				return nil, errors.WithStack(err)
  			}
  			instCC.CollectionsConfig = collectionData
  			Logger.Debug("Retrieved collection config for", cc, "from", key)
  		}
  
  		res = append(res, instCC)
  	}
  	Logger.Debug("Returning", res)
  	return res, nil
  }
docs: // DeployedChaincodes retrieves the metadata of the given deployed chaincodes