2019-04-21 11:18:26 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Importing useful functions for cc testing
|
|
|
|
if [ -f ./func.sh ]; then
|
2021-03-04 06:06:06 +08:00
|
|
|
source ./func.sh
|
2019-04-21 11:18:26 +08:00
|
|
|
elif [ -f scripts/func.sh ]; then
|
2021-03-04 06:06:06 +08:00
|
|
|
source scripts/func.sh
|
2019-04-21 11:18:26 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
## Install chaincode on all peers
|
|
|
|
CC_NAME=${CC_NAME:-$CC_02_NAME}
|
|
|
|
CC_PATH=${CC_PATH:-$CC_02_PATH}
|
|
|
|
|
|
|
|
echo_b "=== Approve chaincode definition ${CC_NAME} on all organizations ... ==="
|
|
|
|
|
2021-03-04 06:06:06 +08:00
|
|
|
for org in "${ORGS[@]}"; do
|
|
|
|
t="\${ORG${org}_PEER0_URL}" && peer_url=$(eval echo $t)
|
|
|
|
t="\${ORG${org}_PEER0_TLS_ROOTCERT}" && peer_tls_rootcert=$(eval echo $t)
|
|
|
|
chaincodeApproveForMyOrg "$org" 0 ${peer_url} ${peer_tls_rootcert} ${ORDERER0_URL} ${ORDERER0_TLS_ROOTCERT} "${APP_CHANNEL}" ${CC_NAME} ${CC_INIT_VERSION}
|
2019-04-21 11:18:26 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
echo_g "=== Approve chaincode done ==="
|
|
|
|
|
|
|
|
echo
|