IBM-Blockchain-Starter-Kit / build-lib

Common scripts for use in Blockchain build pipelines
https://ibm-blockchain-starter-kit.github.io/
Apache License 2.0
4 stars 14 forks source link

Investigate multiple file alternatives for installing chaincode #67

Closed jt-nti closed 6 years ago

jt-nti commented 6 years ago

It looks like the curl command for /networks/{networkID}/chaincode/install is being called with multiple -F files[]=@ arguments which could potentially have globbing and word splitting issues.

According to the API...

Upload a single file. Swagger only allows one, but API allows array of files. Use zip format for multiple files.

Which would be worth investigating rather than uploading single files.

taborda commented 6 years ago

It looks like the current method being used to deploy the files doesn't allow the code to be structured with directories. All of the files seem to be deployed on the same folder.

For example in this case:

$ tree
.
├── foo
│   └── bar.js
├── main.js
├── package.json
└── start.sh

1 directory, 4 files

main.js:

const bar = require("./foo/bar");

When instantiating we get this error on the logs: Error: Cannot find module './foo/bar'

Uploading a zip file with the correct directory structure seems to work.

We definitely need this as an option on the deployment.

jorgedr94 commented 6 years ago

Part of this issue is now being addressed by Pull Request https://github.com/IBM-Blockchain-Starter-Kit/build-lib/pull/84

Will keep this issue opened so that we can enhance the capability by providing a way for the developer to configure the content of the zip file itself.

jt-nti commented 6 years ago

@jorgedr94 I've opened an issue in the new repo for the follow on work: blockchain-kit/build-lib#6

jt-nti commented 6 years ago

Closed by #84