The project website is here.
The project is curretly in development using frameworks and tools from Hyperledger, in particular Fabric and Composer
In a previous posting we focussed on deploying version 1 of the business network bforos-bnav1
onto a a multi-organization Hyperledger Fabric.
In this posting we will be deploying into a single-organization the same business network, start the rest-server and the user interfaces generated with Angular CLI version 1.0.1.
Follow steps one and two from the tutorial: 1-Starting a Hyperledger Fabric network; 2-Exploring the Hyperledger Fabric network.
In step three create a folder called certificates
and follow the instructions:
3-Building a connection profile and save to the folder connection.json
.
Follow step four to locate the certificate and private key for the Hyperledger Fabric administrator and copying these certificates in the file certificates
. Note that these certificates change every time we boostrap the fabric network.
Navigate to the folder you just created and follow step five, creating a business network card for the Hyperledger Fabric administrator:
composer card create -p connection.json -u PeerAdmin -c Admin@org1.example.com-cert.pem -k 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk -r PeerAdmin -r ChannelAdmin
Follow step six to import the business network card for the Hyperledger Fabric administrator,
composer card import -f PeerAdmin@fabric-network.card
In step seven we install the Hyperledger Composer business network onto the Hyperledger Fabric peer nodes. To do this we must firts get a copy of the business network bforos-bnav1
(defined in bna file, bforos-bnav1@0.0.1.bna
). This file is located in the Blockchain4openscience hyperledger repository.
composer network install -c PeerAdmin@fabric-network -a bforos-bnav1@0.0.1.bna
In step eight we start the blockchain business network
composer network start --networkName bforos-bnav1 --networkVersion 0.0.1 -A admin -S adminpw -c PeerAdmin@fabric-network
In step nine we import the business network card for the business network administrator
composer card import -f admin@bforos-bnav1.card
In step ten we test the connection to the blockchain business network
composer network ping -c admin@bforos-bnav1
To create the REST API run the following command:
composer-rest-server
use admin@bforos-bnav1
as the card name and select: never use namespaces; not to secure the generated API; yes to enable event publication; no to enable TLS security.
In order to build the user interfaces for this busness networ please clone the repository and follow the instructions
git clone https://github.com/Blockchain4openscience/bforos-frontend
Now navigate to the folder. Check that npm is installed by running
npm -v
otherwise run
npm install
Once the installation is complete run,
npm start
and navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build.
Run npm test
to execute the unit tests via Karma.
Run npm run e2e
to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via npm start
.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.