Let's look at the procedure for developing chaincode in Node.js:
- Create a Node.js file using the fabric-shim package
- Create a package.json file with the details of the Node.js file and dependencies, if any
- Package all the files in a ZIP file including package.json, the main Node.js file, and other JavaScript or config files or dependencies, if any
- Deploy the package under the Chaincode tab in OBP (refer to the Chaincode deployment section)
Note: You are only required to create a package.json file; there's no need to run npm commands to install node_modules, as the OBP does this for you internally.
Sample Node.js file named education.js.
Create a Node.js file using the fabric-shim package:
const shim = require('fabric-shim'); ...