mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
This change adds: - shell scripts to start CAs for each org - optional flag (-c) to network.sh to start CAs - generate crypto material in the same format as cryptogen using the CAs - describe how to start the CAs using terminals Signed-off-by: Chris Elder <celder@chriss-mbp.raleigh.ibm.com>
39 lines
1.3 KiB
Bash
Executable file
39 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"${PATH}"
|
|
export FABRIC_CFG_PATH="${PWD}"/../config
|
|
|
|
#Configure the CA_NAME, CA_PORT, OPERATIONS_PORT and CSR_HOSTS for the CA
|
|
export CA_NAME=ordererca
|
|
export CA_PORT=7052
|
|
export OPERATIONS_PORT=9843
|
|
export CSR_HOSTS=ordererca,localhost,127.0.0.1
|
|
|
|
export CA_DIRECTORY="${PWD}"/data_ca/"${CA_NAME}"
|
|
export CA_HOME="${CA_DIRECTORY}"/ca
|
|
export TLSCA_HOME="${CA_DIRECTORY}"/tlsca
|
|
export DB_HOME="${CA_DIRECTORY}"/db
|
|
export TEMPLATE_DIR="${PWD}"/ca/ca_config
|
|
|
|
# Check to see if the CA directory exists
|
|
if [ ! -d "${CA_DIRECTORY}" ]; then
|
|
|
|
# Create the new CA directory
|
|
mkdir -p "${CA_HOME}"
|
|
mkdir -p "${TLSCA_HOME}"
|
|
mkdir -p "${DB_HOME}"
|
|
|
|
# Copy the CA template files
|
|
cp "${TEMPLATE_DIR}"/ca/fabric-ca-server-config.yaml "${CA_HOME}"/fabric-ca-server-config.yaml
|
|
cp "${TEMPLATE_DIR}"/tlsca/fabric-ca-server-config.yaml "${TLSCA_HOME}"/fabric-ca-server-config.yaml
|
|
|
|
fi
|
|
|
|
export FABRIC_CA_SERVER_TLS_ENABLED=true
|
|
export FABRIC_CA_SERVER_CSR_CN="${CA_NAME}"
|
|
export FABRIC_CA_SERVER_CSR_HOSTS="${CSR_HOSTS}"
|
|
export FABRIC_CA_SERVER_DEBUG=true
|
|
export FABRIC_CA_SERVER_OPERATIONS_LISTENADDRESS=localhost:"${OPERATIONS_PORT}"
|
|
fabric-ca-server start -d -b admin:adminpw --port "${CA_PORT}" --home "${CA_HOME}"
|