Deploying the DocsApp smart contract

We need to set up a new chaincode directory for our contract. In your Hyperledger Fabric fabric-samples directory, navigate to the chaincode directory. It will be at the following location by default:

/fabric-samples/chaincode/

We will use the following steps to deploy our DocsApp smart contract:

  1. In the chaincode folder, create a new folder with the name docsapp.
  2. In the docsapp folder, create an index.js file with the following values:
/* * SPDX-License-Identifier: Apache-2.0 */'use strict';const docsapp = require('./lib/docsapp');module.exports.docsapp = docsapp;module.exports.contracts = [ docsapp ];

This will declare the docsapp object, which will be used by our peer chaincode install and peer chaincode ...

Get Blockchain Development for Finance Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.