This repository defines the source code for a Hyperledger Composer Business Network Definition. The network models a consortium of engine manufacturers and merchants which trace the production, sale and installation of car engines into cars of end customers.
Initial and final versions are stored in two separate branches to guide developers throw the process of developing a Business Network Definition for Composer. This repository was created to demo the engine supplychain application in a German article for Informatik Aktuell.
In the branch initial
you will find unfinished application skeleton. It can be started but contains no application code, yet.
git checkout initial
In the master
branch you will find the final solution application. It contains implementations that fulfill a simple engine supplychain show case.
git checkout master
There are different roles/personas: Manufacturer
, Merchant
and the interests of a Customer
by tracing cars by unique legal identifiers of real cars.
- As a
Manufacturer
I want to be able to create produced motors with a unique serial number in order to track further history of it and prove uniqueness. - As a
Manufacturer
I want to be able to transfer ownership of inserted motors to aMerchant
in order to model a sell proccess to it. - As a
Merchant
I want to be able to transfer an owned motor to aCustomer
in order to model a sell process/installation process into his car.
These are further ideas but did not have been implemented yet.
- As a
Customer
I want to claim the two-year warranty by help of aMerchant
at aManufacturer
in order to get a motors' damage repaired or refunded. - As a
Customer
orMerchant
orManufacturer
I want to report a stolen motor in order to let everyone know that its serial number now resolves to a stolen item.
Pre-requisites:
- Install pre-requisites for Hyperledger Fabric
- Install pre-requisites for Hyperledger Composer
- Install Composer and its (dev) tools
The source code is implemented in JavaScript ES6 so it can make use of nice language features such as async
and await
, spread/destruct operators and so on.
Working with the repo:
- Install dependencies and dev-dependencies:
npm install
- Run ESlint:
npm run lint
- Run unit tests:
npm test
- Compile this repository to a
.bna
file:npm run createArchive
For more information on Fabric and Composer and how to deploy .bna
files to Fabric Networks, please read their development and operations documentation.