diff --git a/fabcar/startFabric.sh b/fabcar/startFabric.sh index be6c1c4867..5035875812 100755 --- a/fabcar/startFabric.sh +++ b/fabcar/startFabric.sh @@ -174,7 +174,7 @@ ${PEER0_ORG1} lifecycle chaincode commit \ --tlsRootCertFiles ${ORG2_TLS_ROOTCERT_FILE} echo "Submitting initLedger transaction to smart contract on mychannel" -echo "The transaction is sent to all of the peers so that chaincode is built before receiving the following requests" +# echo "The transaction is sent to all of the peers so that chaincode is built before receiving the following requests" ${PEER0_ORG1} chaincode invoke \ -C mychannel \ -n fabcar \ @@ -182,12 +182,23 @@ ${PEER0_ORG1} chaincode invoke \ --waitForEvent \ --waitForEventTimeout 300s \ --peerAddresses peer0.org1.example.com:7051 \ - --peerAddresses peer1.org1.example.com:8051 \ --peerAddresses peer0.org2.example.com:9051 \ - --peerAddresses peer1.org2.example.com:10051 \ - --tlsRootCertFiles ${ORG1_TLS_ROOTCERT_FILE} \ --tlsRootCertFiles ${ORG1_TLS_ROOTCERT_FILE} \ - --tlsRootCertFiles ${ORG2_TLS_ROOTCERT_FILE} \ + --tlsRootCertFiles ${ORG2_TLS_ROOTCERT_FILE} + +# Temporary workaround (see FAB-15897) - cannot invoke across all four peers at the same time, so use a query to build +# the chaincode across the remaining peers. +${PEER1_ORG1} chaincode query \ + -C mychannel \ + -n fabcar \ + -c '{"function":"queryAllCars","Args":[]}' \ + --peerAddresses peer1.org1.example.com:8051 \ + --tlsRootCertFiles ${ORG1_TLS_ROOTCERT_FILE} +${PEER1_ORG2} chaincode query \ + -C mychannel \ + -n fabcar \ + -c '{"function":"queryAllCars","Args":[]}' \ + --peerAddresses peer1.org2.example.com:10051 \ --tlsRootCertFiles ${ORG2_TLS_ROOTCERT_FILE} cat <& $WORKSPACE/$CONTAINER-$1.log - echo -done -# Write couchdb container logs into couchdb.log file -docker logs couchdb >& couchdb.log - + LOG_DIRECTORY=$WORKSPACE/fabcar/$1 + mkdir -p ${LOG_DIRECTORY} + CONTAINER_LIST=$(docker ps -a --format '{{.Names}}') + for CONTAINER in ${CONTAINER_LIST}; do + docker logs ${CONTAINER} > ${LOG_DIRECTORY}/${CONTAINER}.log 2>&1 + done } copy_logs() { @@ -65,5 +60,7 @@ for LANGUAGE in ${LANGUAGES}; do fi docker ps -aq | xargs docker rm -f docker rmi -f $(docker images -aq dev-*) + docker volume prune -f + docker network prune -f echo -e "\033[32m finished fabcar test (${LANGUAGE})" "\033[0m" done