def step_impl(context, ordererSystemChainId, networkConfigPolicy, consensusType): genesisBlock = bootstrap_util.createGenesisBlock(context, ordererSystemChainId, networkConfigPolicy, consensusType) bootstrap_util.OrdererGensisBlockCompositionCallback(context, genesisBlock)
def step_impl(context, certAlias, ordererGenesisBlockName, ordererSystemChainIdName, networkConfigPolicy, consensusType): directory = bootstrap_util.getDirectory(context=context) ordererBootstrapAdmin = bootstrap_util.getOrdererBootstrapAdmin(context) ordererSystemChainIdGUUID = ordererBootstrapAdmin.tags[ ordererSystemChainIdName] # Now collect the named signed config items configGroups = [] for row in context.table.rows: configGroupName = row['ConfigGroup Names'] configGroups += ordererBootstrapAdmin.tags[configGroupName] # Concatenate signedConfigItems # Construct block nodeAdminTuple = ordererBootstrapAdmin.tags[certAlias] bootstrapCert = directory.findCertForNodeAdminTuple( nodeAdminTuple=nodeAdminTuple) (genesisBlock, envelope) = bootstrap_util.createGenesisBlock( context, ordererSystemChainIdGUUID, consensusType, nodeAdminTuple=nodeAdminTuple, signedConfigItems=configGroups) ordererBootstrapAdmin.setTagValue(ordererGenesisBlockName, genesisBlock) bootstrap_util.OrdererGensisBlockCompositionCallback(context, genesisBlock) bootstrap_util.PeerCompositionCallback(context)
def step_impl(context, ordererSystemChainIdName, networkConfigPolicy, consensusType): ordererBootstrapAdmin = bootstrap_util.getOrdererBootstrapAdmin(context) ordererSystemChainIdGUUID = ordererBootstrapAdmin.tags[ordererSystemChainIdName] # Now collect the named signed config items signedConfigItems =[] for row in context.table.rows: signedConfigItemName = row['SignedConfigItemsName'] signedConfigItems += ordererBootstrapAdmin.tags[signedConfigItemName] # Concatenate signedConfigItems # Construct block (genesisBlock,envelope) = bootstrap_util.createGenesisBlock(context, ordererSystemChainIdGUUID, consensusType, signedConfigItems=signedConfigItems) bootstrap_util.OrdererGensisBlockCompositionCallback(context, genesisBlock) bootstrap_util.PeerCompositionCallback(context)
def step_impl(context, ordererSystemChainId, networkConfigPolicy, consensusType, chainCreatorPolicyNames): ordererBootstrapAdmin = bootstrap_util.getOrdererBootstrapAdmin(context) # Retrieve the chainCreators config items required for now (tuple). chainCreatorsSignedConfigItems = ordererBootstrapAdmin.tags[ chainCreatorPolicyNames] ordererSystemChainIdGUUID = ordererBootstrapAdmin.tags[ ordererSystemChainId] (genesisBlock, envelope) = bootstrap_util.createGenesisBlock( context, ordererSystemChainIdGUUID, consensusType, signedConfigItems=list(chainCreatorsSignedConfigItems)) 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)