fabric-samples icon indicating copy to clipboard operation
fabric-samples copied to clipboard

Deploying Typescript Chaincodes Fail using DeployCC.sh In CLI Container for Test Network

Open jonmchan opened this issue 3 years ago • 3 comments

Using the deployCC.sh script (https://github.com/hyperledger/fabric-samples/blob/main/test-network/scripts/deployCC.sh) from the cli container errors out because npm is not installed. Simple fix - apk add npm.

This fails at:

https://github.com/hyperledger/fabric-samples/blob/main/test-network/scripts/deployCC.sh#L82

Compiling TypeScript code into JavaScript...
/opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode-ts /peer
./scripts/deployCC.sh: line 72: npm: command not found
./scripts/deployCC.sh: line 73: npm: command not found
/peer
Finished compiling TypeScript code into JavaScript

Without this the chaincode is deployed improperly and you can easily miss the error message because I believe it tries to package up an empty chaincode package. Another feature that would be useful if the compile fails, the script should halt and not try to continue to publish a bad chaincode package.

jonmchan avatar Jan 21 '22 19:01 jonmchan

This isn't only applicable to typescript, it also applies to Go and Java chaincode as well which require GoLang/Java to be installed otherwise deployment will fail.

It's not only an issue with the deploy script but also there is no mention of this in the docs or README for samples or test-network

davidkel avatar Feb 03 '22 17:02 davidkel

Hey, @davidkel if faced the same while compiling the project on my local machine. I know where what changes are required. Can you assign me this issue? I have a past experience of writing articles.

AyushRaj8271 avatar Mar 27 '22 10:03 AyushRaj8271

@AyushRaj8271 I've assigned to you, thanks for working on a PR!

denyeart avatar Mar 28 '22 05:03 denyeart