Status: Closed (View Workflow)
What's the format of the chaincode source?
- chaincode should be written as CommonJS modules and be launch-able with the node.js engine
How does the chaincode get discovered and loaded into the node.js app?
- a package.json must accompany is chaincode sources, in the root folder of the "chaincodePath" parameter during chaincode install. The package.json is critically important for two purposes:
- specifies any dependencies, including the fabric-shim package itself which is needed by all JS chaincodes, and any other external dependencies
- using the "scripts" section to specify how the chaincode should be launched:
Do we allow JS chaincodes to have other source dependencies? in other words can a JS chaincode by broken up into multiple modules?
- yes definitely
How do we ensure multiple install operations produce the same binary from npm install?
- use best practices with shrinkwrap.json