mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
As pointed out in [FAB-8496], updating the orgs for the fabric-ca sample does not have an effect currently. This RC added the affiliation settings in env.sh script into the default config file. Change-Id: I3eaa601fc572f6880b15dec48a4be8a69d01eb4e Signed-off-by: Min Luo <luomin_tokyotech@hotmail.com>
31 lines
742 B
Bash
Executable file
31 lines
742 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Copyright IBM Corp. All Rights Reserved.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
source $(dirname "$0")/env.sh
|
|
initOrgVars $ORG
|
|
|
|
set -e
|
|
|
|
# Wait for the root CA to start
|
|
waitPort "root CA to start" 60 $ROOT_CA_LOGFILE $ROOT_CA_HOST 7054
|
|
|
|
# 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
|