@@ -61,6 +61,41 @@ waitForContainer "peer0.org1.example.com" "Membership view has changed. peers we
6161waitForContainer " peer1.org1.example.com" " Learning about the configured anchor peers of Org1MSP for channel my-channel1"
6262waitForContainer " peer1.org1.example.com" " Membership view has changed. peers went online:.*peer0.org1.example.com:7041"
6363
64+ # Gateway client test
65+ GATEWAY_CLIENT_DIR=" $FABLO_HOME /samples/gateway/node"
66+ GATEWAY_CLIENT_OUTPUT_FILE=" $TEST_LOGS /gateway_client.log"
67+ echo " Testing Node.js Gateway client..."
68+
69+ echo " Installing gateway client dependencies..."
70+ (cd " $GATEWAY_CLIENT_DIR " && npm install --silent --no-progress)
71+
72+ echo " Running Node.js Gateway client and checking output..."
73+ (
74+ cd " $GATEWAY_CLIENT_DIR " &&
75+ export \
76+ CHANNEL_NAME=" my-channel1" \
77+ CONTRACT_NAME=" chaincode1" \
78+ MSP_ID=" Org1MSP" \
79+ PEER_ORG_NAME=" peer0.org1.example.com" \
80+ PEER_GATEWAY_URL=" localhost:7041" \
81+ TLS_ROOT_CERT=" $TEST_TMP /fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" \
82+ CREDENTIALS=" $TEST_TMP /fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem" \
83+ PRIVATE_KEY_PEM=" $TEST_TMP /fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv-key.pem" &&
84+ node server.js > " $GATEWAY_CLIENT_OUTPUT_FILE " 2>&1
85+ )
86+ GATEWAY_EXIT_CODE=$?
87+
88+ if [ $GATEWAY_EXIT_CODE -ne 0 ]; then
89+ echo " ❌ failed: Node.js Gateway client script failed with exit code $GATEWAY_EXIT_CODE ."
90+ cat " $GATEWAY_CLIENT_OUTPUT_FILE "
91+ exit 1
92+ fi
93+
94+ expectCommand " cat \" $GATEWAY_CLIENT_OUTPUT_FILE \" " " \" success\" :\" OK\" "
95+
96+ echo " 🎉 Node.js Gateway client test complete 🎉"
97+
98+
6499# Test simple chaincode
65100expectInvoke " peer0.org1.example.com" " my-channel1" " chaincode1" \
66101 ' {"Args":["KVContract:put", "name", "Willy Wonka"]}' \
0 commit comments