def bootstrapped_impl(context, ordererType, database, tlsEnabled=False, timeout=120): assert ordererType in config_util.ORDERER_TYPES, "Unknown network type '%s'" % ordererType curpath = os.path.realpath('.') # Get the correct composition file context.composeFile = ["%s/docker-compose/docker-compose-%s.yml" % (curpath, ordererType)] if database.lower() != "leveldb": context.composeFile.append("%s/docker-compose/docker-compose-%s.yml" % (curpath, database.lower())) context.composeFile.append("%s/docker-compose/docker-compose-cli.yml" % (curpath)) for composeFile in context.composeFile: assert os.path.exists(composeFile), "The docker compose file does not exist: {0}".format(composeFile) # Should TLS be enabled context.tls = tlsEnabled common_util.enableTls(context, tlsEnabled) # Perform bootstrap process context.ordererProfile = config_util.PROFILE_TYPES.get(ordererType, "SampleInsecureSolo") channelID = context.interface.SYS_CHANNEL_ID if hasattr(context, "composition"): context.projectName = context.composition.projectName else: context.projectName = str(uuid.uuid1()).replace('-','') config_util.generateCrypto(context) config_util.generateConfig(context, channelID, config_util.CHANNEL_PROFILE, context.ordererProfile) compose_impl(context, context.composeFile, projectName=context.projectName) wait_for_bootstrap_completion(context, timeout)
def bootstrapped_impl(context, networkType): assert networkType in ORDERER_TYPES, "Unknown network type '%s'" % networkType curpath = os.path.realpath('.') context.composeFile = "%s/docker-compose/docker-compose-%s.yml" % (curpath, networkType) assert os.path.exists(context.composeFile), "The docker compose file does not exist: {0}".format(context.composeFile) context.ordererProfile = PROFILE_TYPES.get(networkType, "SampleInsecureSolo") channelID = endorser_util.SYS_CHANNEL_ID projectName = str(uuid.uuid1()).replace('-','') config_util.generateCrypto(projectName) config_util.generateConfig(channelID, config_util.CHANNEL_PROFILE, context.ordererProfile, projectName) compose_impl(context, context.composeFile, projectName=projectName)
def bootstrapped_impl(context, networkType): assert networkType in ORDERER_TYPES, "Unknown network type '%s'" % networkType curpath = os.path.realpath('.') context.composeFile = "%s/docker-compose/docker-compose-%s.yml" % (curpath, networkType) assert os.path.exists(context.composeFile), "The docker compose file does not exist: {0}".format(context.composeFile) context.ordererProfile = PROFILE_TYPES.get(networkType, "SampleInsecureSolo") channelID = endorser_util.SYS_CHANNEL_ID projectName = str(uuid.uuid1()).replace('-','') config_util.generateCrypto(projectName) config_util.generateConfig(channelID, config_util.CHANNEL_PROFILE, context.ordererProfile, projectName) compose_impl(context, context.composeFile, projectName=projectName)
def bootstrapped_impl(context, ordererType, database, tlsEnabled=False, timeout=300, ouEnabled=False, fca=False): assert ordererType in config_util.ORDERER_TYPES, "Unknown network type '%s'" % ordererType curpath = os.path.realpath('.') # Get the correct composition file context.composeFile = getCompositionFiles(context, curpath, ordererType, database, fca) # Should TLS be enabled context.tls = tlsEnabled compose_util.enableTls(context, tlsEnabled) # Perform bootstrap process context.ordererProfile = config_util.PROFILE_TYPES.get( ordererType, "SampleInsecureSolo") channelID = context.interface.SYS_CHANNEL_ID if hasattr(context, "composition"): context.projectName = context.composition.projectName elif not hasattr(context, "projectName"): context.projectName = str(uuid.uuid1()).replace('-', '') # Determine number of orderers numOrderers = 1 if ordererType == 'kafka': numOrderers = 3 # Get Configs setup if ouEnabled: config_util.buildCryptoFile(context, 2, 2, numOrderers, 2, ouEnable=ouEnabled) config_util.generateCrypto( context, "./configs/{0}/crypto.yaml".format(context.projectName)) else: config_util.generateCrypto(context) config_util.generateConfig(context, channelID, config_util.CHANNEL_PROFILE, context.ordererProfile) compose_impl(context, context.composeFile, projectName=context.projectName) wait_for_bootstrap_completion(context, timeout)