Deploy Client Application

In this last lesson, we will first see the folder structure of the application and then we will see how to run the environment.

Folder Structure for API #


Now lets look at important files inside the api folder.

  1. src/index.js:
    Creates an express.js server that exposes following endpoints.

    • EnrollAdmin
      • This will enroll the admin with CA using SDK and then store Admin’s credentials in a file-based wallet.
    • Query
      • This will query the blockchain using the landrec chaincode. It will use fabric node sdk to do so.
    • Invoke
      • This will invoke the createLand method in our landrec chaincode
  2. src/controllers/*.js:
    Implementation of all above endpoints in their respective files.

  3. src/controllers/wallet/:
    Directory in which user identities will be stored.

  4. src/network-connection/connection.json: Connection configuration file used by fabric node sdk to connect to the blockchain network.

Get hands-on with 1200+ tech skills courses.