def step_impl(context, certAlias, ordererGenesisBlockName, ordererSystemChainIdName, composeFile, consensusType, consortiumsModPolicy): directory = bootstrap_util.getDirectory(context=context) 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_util.createGenesisBlock(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) bootstrap_util.OrdererGensisBlockCompositionCallback(context, genesisBlock) bootstrap_util.PeerCompositionCallback(context)
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)