#!/bin/bash # Copyright 2018-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # source $(dirname "$0")/env.sh initOrgVars $ORG set -e # Initialize the intermediate CA fabric-ca-server init -b $BOOTSTRAP_USER_PASS -u $PARENT_URL # Copy the intermediate CA's certificate chain to the data directory to be used by others cp $FABRIC_CA_SERVER_HOME/ca-chain.pem $TARGET_CHAINFILE # Add the custom orgs for o in $FABRIC_ORGS; do aff=$aff"\n $o: []" done aff="${aff#\\n }" sed -i "/affiliations:/a \\ $aff" \ $FABRIC_CA_SERVER_HOME/fabric-ca-server-config.yaml # Start the intermediate CA fabric-ca-server start