def step_impl(context, composeYamlFile): # time.sleep(10) # Should be replaced with a definitive interlock guaranteeing that all peers/membersrvc are ready composition = compose.Composition( context, composeYamlFile, projectName=bootstrap_util.ContextHelper.GetHelper( context=context).getGuuid()) context.compose_containers = composition.containerDataList context.composition = composition
def step_impl(context, certAlias, ordererGenesisBlockName, ordererSystemChainIdName, composeFile, consensusType, consortiumsModPolicy): directory = bootstrap_util.getDirectory(context=context) contextHelper = ContextHelper.GetHelper(context=context) bootstrap_helper = contextHelper.get_bootstrap_helper() ordererBootstrapAdmin = bootstrap_util.getOrdererBootstrapAdmin(context) ordererSystemChainIdGUUID = ordererBootstrapAdmin.tags[ ordererSystemChainIdName] # Now collect the named signed config items configGroups = [ bootstrap_util.getDefaultConsortiumGroup(consortiumsModPolicy) ] for row in context.table.rows: configGroupName = row['Consortium'] configGroups += ordererBootstrapAdmin.tags[configGroupName] # Concatenate signedConfigItems service_names = compose.Composition( context, composeFilesYaml=composeFile, register_and_up=False).getServiceNames() # Construct block nodeAdminTuple = ordererBootstrapAdmin.tags[certAlias] bootstrapCert = directory.findCertForNodeAdminTuple( nodeAdminTuple=nodeAdminTuple) (genesisBlock, envelope, genesis_block_channel_config) = bootstrap_helper.create_genesis_block( context=context, service_names=service_names, chainId=ordererSystemChainIdGUUID, consensusType=consensusType, nodeAdminTuple=nodeAdminTuple, signedConfigItems=configGroups) ordererBootstrapAdmin.setTagValue( ordererGenesisBlockName + "_genesis_channel_config", genesis_block_channel_config) ordererBootstrapAdmin.setTagValue(ordererGenesisBlockName, genesisBlock) ordererBootstrapAdmin.setTagValue("ConsensusType", consensusType) ordererCallback = bootstrap_util.OrdererGensisBlockCompositionCallback( context, genesisBlock) peerCallback = bootstrap_util.PeerCompositionCallback(context) composer.ComposerCompositionCallback(context, peerCallback)
def step_impl(context, composeYamlFile): # time.sleep(10) # Should be replaced with a definitive interlock guaranteeing that all peers/membersrvc are ready composition = compose.Composition(composeYamlFile) context.compose_containers = composition.containerDataList context.composition = composition