mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-19 16:15:09 +00:00
[FAB-15649]Fix Fabcar to install Chaincode on all peers
CI Fabcar javascript test fails because a query proposal is sent to a peer which does not have Chaincode. The query handler in fabric-network does not consider if Chaincode is installed on target peers. As a workaround, this CR adds steps installing Chaincode on all peers during the setup. Signed-off-by: Simon Stone <sstone1@uk.ibm.com> Change-Id: I771e3bae0abd2d6a3b3b7d295efdf6417c3c1c21
This commit is contained in:
parent
62fa4f8bc0
commit
36ef140439
1 changed files with 31 additions and 0 deletions
|
|
@ -66,6 +66,19 @@ docker exec \
|
|||
-p "$CC_SRC_PATH" \
|
||||
-l "$CC_RUNTIME_LANGUAGE"
|
||||
|
||||
echo "Installing smart contract on peer1.org1.example.com"
|
||||
docker exec \
|
||||
-e CORE_PEER_LOCALMSPID=Org1MSP \
|
||||
-e CORE_PEER_ADDRESS=peer1.org1.example.com:8051 \
|
||||
-e CORE_PEER_MSPCONFIGPATH=${ORG1_MSPCONFIGPATH} \
|
||||
-e CORE_PEER_TLS_ROOTCERT_FILE=${ORG1_TLS_ROOTCERT_FILE} \
|
||||
cli \
|
||||
peer chaincode install \
|
||||
-n fabcar \
|
||||
-v 1.0 \
|
||||
-p "$CC_SRC_PATH" \
|
||||
-l "$CC_RUNTIME_LANGUAGE"
|
||||
|
||||
echo "Installing smart contract on peer0.org2.example.com"
|
||||
docker exec \
|
||||
-e CORE_PEER_LOCALMSPID=Org2MSP \
|
||||
|
|
@ -79,6 +92,19 @@ docker exec \
|
|||
-p "$CC_SRC_PATH" \
|
||||
-l "$CC_RUNTIME_LANGUAGE"
|
||||
|
||||
echo "Installing smart contract on peer1.org2.example.com"
|
||||
docker exec \
|
||||
-e CORE_PEER_LOCALMSPID=Org2MSP \
|
||||
-e CORE_PEER_ADDRESS=peer1.org2.example.com:10051 \
|
||||
-e CORE_PEER_MSPCONFIGPATH=${ORG2_MSPCONFIGPATH} \
|
||||
-e CORE_PEER_TLS_ROOTCERT_FILE=${ORG2_TLS_ROOTCERT_FILE} \
|
||||
cli \
|
||||
peer chaincode install \
|
||||
-n fabcar \
|
||||
-v 1.0 \
|
||||
-p "$CC_SRC_PATH" \
|
||||
-l "$CC_RUNTIME_LANGUAGE"
|
||||
|
||||
echo "Instantiating smart contract on mychannel"
|
||||
docker exec \
|
||||
-e CORE_PEER_LOCALMSPID=Org1MSP \
|
||||
|
|
@ -101,6 +127,7 @@ echo "Waiting for instantiation request to be committed ..."
|
|||
sleep 10
|
||||
|
||||
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"
|
||||
docker exec \
|
||||
-e CORE_PEER_LOCALMSPID=Org1MSP \
|
||||
-e CORE_PEER_MSPCONFIGPATH=${ORG1_MSPCONFIGPATH} \
|
||||
|
|
@ -114,8 +141,12 @@ docker exec \
|
|||
--tls \
|
||||
--cafile ${ORDERER_TLS_ROOTCERT_FILE} \
|
||||
--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}
|
||||
set +x
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue