Environment: Hyperledger Fabric v1.2
Fabric uses 'npm install --production' to build chaincode docker image.
(https://github.com/hyperledger/fabric/blob/release-1.2/core/chaincode/platforms/node/platform.go#L188)
And run CC by using 'npm start -- --peer.address'
(https://github.com/hyperledger/fabric/blob/release-1.2/core/chaincode/container_runtime.go#L147)
So, only following files are needed to be released
- javascript files
- package.json
- package-lock.json
In case of NodeJs, javascript files should be deployed to peer nodes. So, usually uglifying and optimization is required.
And webpack is most popular tool for this requirements.
And in case that all source codes are bundled to one file - bundle.js - then, releasing only three files are enough!
- bundle.js
- package.json
- package-lock.json
And 'npm start' may look like 'node bundle.js'.
'Domain > Blockchain-DLT' 카테고리의 다른 글
[HLF] Things to know to build your first network with docker-compose. (0) | 2019.05.03 |
---|---|
[DLT][HLF] Structure of ‘msp’ directory generated by ‘cryptogen’ tool (0) | 2019.05.03 |
[DLT] Review: Hyperledger Fabric (v1.2.x) (0) | 2019.05.03 |