code: func getChaincodeDeploymentSpec(spec *pb.ChaincodeSpec, crtPkg bool) (*pb.ChaincodeDeploymentSpec, error) {
  	var codePackageBytes []byte
  	if chaincode.IsDevMode() == false && crtPkg {
  		var err error
  		if err = checkSpec(spec); err != nil {
  			return nil, err
  		}
  
  		codePackageBytes, err = container.GetChaincodePackageBytes(platformRegistry, spec)
  		if err != nil {
  			err = errors.WithMessage(err, "error getting chaincode package bytes")
  			return nil, err
  		}
  	}
  	chaincodeDeploymentSpec := &pb.ChaincodeDeploymentSpec{ChaincodeSpec: spec, CodePackage: codePackageBytes}
  	return chaincodeDeploymentSpec, nil
  }
docs: // getChaincodeDeploymentSpec get chaincode deployment spec given the chaincode spec