.
├── [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.
-
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
-
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]
-
Install the VSCode IDE
-
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
-
Starting Hyperledger Fabric
cd ~/fabric-dev-servers export FABRIC_VERSION=hlfv12 ./startFabric.sh ./createPeerAdminCard.sh
-
Start the web app "Playground"(optional)
composer-playground
-
Deploy the "Assay-tracking-network"
-
Install the network
composer network install --card PeerAdmin@hlfv1 --archiveFile [email protected]
-
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
-
Import the network administrator card and check the connection
composer card import --file networkadmin.card composer network ping --card admin@tutorial-network
-
-
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.
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.