hyperledger-fabrichyperledger-chaincodehyperledger-fabric-sdk-js

Can we able to use npm modules in chaincode other than fabric-shim and fabric-contract-api?


Can we able to use NPM modules other than fabric-shim and fabric-contract-api in chaincode?

If so how the packages will install while instantiating?


Solution

  • Yes you can, just add the dependency to your package.json and require or import the dependency in your code as you would do normally. For your node.js chaincode during instantiation as part of building the chaincode image, npm install --production is done.