Deploying a business network

We have tested the composer application in the playground, so next we will deploy it to the blockchain:

  1. Create a folder called insurance-claim-network, and navigate to the folder.
  2. Generate a business network project template, as follows:
      yo hyperledger-composer:businessnetwork

It will prompt a few questions. Enter insurance-claim-network as the network name and choose the empty template network, as shown in the following screenshot:

This will generate a few files with a default template. Replace the contents of com.packt.quickstart
.claim.cto
with our earlier tested model file.

Create a new folder called lib, under the lib folder, and copy the tested logic.js in here.
Replace permissions.acl with the tested acl file, as follows:

  1. Start Hyperledger Fabric, as follows:
      cd ~/fabric-devservers
export FABRIC_VERSION=hlfv12
./startFabric.sh
./createPeerAdminCard.sh

This will create PeerAdminCard, as shown in the following screenshot:

  1. Generate a business network archive. From the insurance-claim-network directory, run the following command:
      composer archive create -t dir -n 

This will generate [email protected].

  1. Install the business network. From the insurance-claim-network directory, run the following command:
      composer network install --card PeerAdmin@hlfv1 --archiveFile 
[email protected]
  1. Start the business network. From the insurance-claim-network directory, run the following command:
      composer network start --networkName insurance-claim-network --
networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret
adminpw --card PeerAdmin@hlfv1 --file networkadmin.card
  1. Import the network admin card. From the insurance-claim-network in directory, run the following command. This will import insurance-claim-network to the network:
      composer card import --file networkadmin.card
  1. Check if the business network has been deployed successfully. From the insurance-claim-network directory, run the following command:
      composer network ping --card admin@insurance-claim-network

The result should look as follows:

Checking if the business network been deployed successfully
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.57.126