2017-12-06 22:30:57 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Importing useful functions for cc testing
|
|
|
|
if [ -f ./func.sh ]; then
|
|
|
|
source ./func.sh
|
|
|
|
elif [ -f scripts/func.sh ]; then
|
|
|
|
source scripts/func.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Install chaincode on all peers
|
2018-03-05 14:10:16 +08:00
|
|
|
CC_NAME=${CC_NAME:-$CC_02_NAME}
|
|
|
|
CC_PATH=${CC_PATH:-$CC_02_PATH}
|
|
|
|
|
2018-01-30 15:54:49 +08:00
|
|
|
echo_b "=== Installing chaincode ${CC_NAME} on all 4 peers... ==="
|
2017-12-06 22:30:57 +08:00
|
|
|
|
2018-01-30 15:54:49 +08:00
|
|
|
for org in "${ORGS[@]}"
|
|
|
|
do
|
|
|
|
for peer in "${PEERS[@]}"
|
|
|
|
do
|
2019-04-21 11:18:26 +08:00
|
|
|
t="\${ORG${org}_PEER${peer}_URL}" && peer_url=`eval echo $t`
|
|
|
|
t="\${ORG${org}_PEER${peer}_TLS_ROOTCERT}" && peer_tls_rootcert=`eval echo $t`
|
|
|
|
chaincodeInstall $org $peer "${peer_url}" "${peer_tls_rootcert}" ${CC_NAME} ${CC_INIT_VERSION} ${CC_PATH}
|
2018-01-30 15:54:49 +08:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
echo_g "=== Install chaincode done ==="
|
|
|
|
|
|
|
|
echo
|