Skip to content

Latest commit

 

History

History
 
 

Blockchain

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Contents

.
├── [email protected]
│   ├── lib
│   ├── models
│   ├── packages.json
│   ├── permissions.acl
│   ├── queries.qry
│   └── README.md
├── [email protected]
├── README.md
└── test_report.html

The [email protected] is the core file needed by the Hyperledger Composer. It was made up with the files in the [email protected] directory. The lib folder contains a logic.js file, which defined the functions of the network. The model folder includes a [email protected] file, which defined the architecture and logic of the blockchain network. The queries.qry priovides the query service. The packages.jason provides the information of this package, and the permission.acl is for access control.

The test_report.html is the performance test report generated by Hyperledger Caliper.

Installition

  • Environment: Ubuntu 18.04

  • Download and install the dependences:

    curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh
    
    chmod u+x prereqs-ubuntu.sh
    
    sudo ./prereqs-ubuntu.sh
    
  • Install the development environment

    1. Install the hyperledger component:

      npm install -g [email protected]
      
      npm install -g [email protected]
      
      npm install -g [email protected]
      
      npm install -g yo
      
      npm install -g [email protected]
      
    2. Install the VSCode IDE

    3. Install Hyperledger Fabric

      mkdir ~/fabric-dev-servers && cd ~/fabric-dev-servers
      
      curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz
      
      tar -xvf fabric-dev-servers.tar.gz
      
      cd ~/fabric-dev-servers
      export FABRIC_VERSION=hlfv12
      ./downloadFabric.sh
      
      
    4. Starting Hyperledger Fabric

      cd ~/fabric-dev-servers
      export FABRIC_VERSION=hlfv12
      ./startFabric.sh
      ./createPeerAdminCard.sh
      
    5. Start the web app "Playground"(optional)

      composer-playground
      
    6. Deploy the "Assay-tracking-network"

      1. Install the network

        composer network install --card PeerAdmin@hlfv1 --archiveFile [email protected] 
        
      2. Start the network

        composer network start --networkName assay-tracking-network --networkVersion 0.0.2-deploy.28 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card 
        

        You might meet the error "manifest for hyperledger/fabric-ccenv:latest not found", that is because the Hyperledger Composer project has been deprecated and the tag "latest" no longer exist. This can be fixed with following commonds:

        docker pull hyperledger/fabric-ccenv:1.4.0
        
        docker tag hyperledger/fabric-ccenv:1.4.0 hyperledger/fabric-ccenv:latest
        
      3. Import the network administrator card and check the connection

        composer card import --file networkadmin.card
        
        composer network ping --card admin@tutorial-network
        
    7. Create the REST server

      composer-rest-server -c admin_analys@assay-tracking-network -n never -d n -w true 
      

The installation steps above are only for running our "Assay-tracking-network". If you want to make your own network more details can be found here.

User Guide

The Hyperledger composer supports REST API which allows normal HTTP requests. You can easily send request from the "Playground" App from https://localhost:8080 (default url), the REST API page https://localhost:3000 (default url) or using the Android App we developed.

This step is a dependency for the Android App component in this repository.