Skip to content

Commit 4278050

Browse files
author
Zhao Chaoyi
committed
[FAB-6280] Start node chaincode by npm start
Update peer to start node chaincode by npm start Change-Id: I101cfe0a125006de20230f33ab9d0714d7e4baf9 Signed-off-by: Zhao Chaoyi <cychaoz@cn.ibm.com>
1 parent 900850f commit 4278050

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/chaincode/chaincode_support.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func (chaincodeSupport *ChaincodeSupport) getLaunchConfigs(cccid *ccprovider.CCC
421421
case pb.ChaincodeSpec_JAVA:
422422
args = []string{"java", "-jar", "chaincode.jar", "--peerAddress", chaincodeSupport.peerAddress}
423423
case pb.ChaincodeSpec_NODE:
424-
args = []string{"/bin/sh", "-c", fmt.Sprintf("cd /usr/local/src; node chaincode.js --peer.address %s", chaincodeSupport.peerAddress)}
424+
args = []string{"/bin/sh", "-c", fmt.Sprintf("cd /usr/local/src; npm start -- --peer.address %s", chaincodeSupport.peerAddress)}
425425

426426
default:
427427
return nil, nil, nil, errors.Errorf("unknown chaincodeType: %s", cLang)

core/chaincode/chaincode_support_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ func getLaunchConfigs(t *testing.T, auth accesscontrol.Authenticator) {
674674
t.Fatalf("calling getLaunchConfigs() for node chaincode should have returned an array of 3 elements for Args, but got %v", args)
675675
}
676676

677-
if args[0] != "/bin/sh" || args[1] != "-c" || !strings.HasPrefix(args[2], "cd /usr/local/src; node chaincode.js --peer.address") {
677+
if args[0] != "/bin/sh" || args[1] != "-c" || !strings.HasPrefix(args[2], "cd /usr/local/src; npm start -- --peer.address") {
678678
t.Fatalf("calling getLaunchConfigs() should have returned the start command for node.js chaincode, but got %v", args)
679679
}
680680

0 commit comments

Comments
 (0)