docker-compose-files/hyperledger_fabric/latest/scripts/gen_cryptoArtifacts.sh

38 lines
922 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2018-10-11 22:29:09 +08:00
# use /tmp/crypto-config.yaml to generate /tmp/crypto-config
# use /tmp/org3/crypto-config.yaml to generate /tmp/org3/crypto-config
cd /tmp # we use /tmp as the base working path
# The crypto-config will be used by channel artifacts generation later
2018-10-11 22:29:09 +08:00
CRYPTO_CONFIG=crypto-config
echo "Generating crypto-config for org1 and org2..."
2018-10-11 22:29:09 +08:00
ls -l ${CRYPTO_CONFIG}
cryptogen generate \
--config=crypto-config.yaml \
2018-10-11 22:29:09 +08:00
--output ${CRYPTO_CONFIG}
2019-04-01 16:21:22 +08:00
#cryptogen extend \
# --input ${CRYPTO_CONFIG} \
# --config=crypto-config.yaml
if [ $? -ne 0 ]; then
2018-10-11 22:29:09 +08:00
echo "Failed to generate certificates for org1 and org2..."
exit 1
fi
echo "Generating crypto-config for org3..."
cryptogen generate \
--config=org3/crypto-config.yaml \
--output org3/${CRYPTO_CONFIG}
if [ $? -ne 0 ]; then
echo_r "Failed to generate certificates for org3..."
exit 1
fi
2018-10-11 22:29:09 +08:00
echo "Generated credential files and saved to ${CRYPTO_CONFIG}."