A pharma supply chain network which helps to solve the problem of drug counterfeiting.
Note - The development was done on macOS. So, all the bin files for fabric network is for macOS. These bin files need to be replaced in case if the network is tested on other OS.
-
Download the project folder.
-
cd to /network path
cd network
-
Restart the network so that the crypto configs are not created again as its already available in network folder.
sh ./fabricNetwork.sh restart
-
Open 5 new tabs in new window each for manufacturer, distributor, retailer, transporter and consumer chaincode container and bash into the containers.
docker exec -it manufacturer.chaincode /bin/bash docker exec -it distributor.chaincode /bin/bash docker exec -it retailer.chaincode /bin/bash docker exec -it transporter.chaincode /bin/bash docker exec -it consumer.chaincode /bin/bash
-
Start the nodejs service in the respective chaincode container. a) In the manufacturer chaincode container -
npm install npm run start-manufacturer
b) In the distributor chaincode container -
npm install npm run start-distributor
c) In the retailer chaincode container -
npm install npm run start-retailer
d) In the transporter chaincode container -
npm install npm run start-transporter
e) In the consumer chaincode container -
npm install npm run start-consumer ```sh
-
Install and intantiate the chaincode from the /network directory
sh ./fabricNetwork.sh install
Note - The identity for all the entities are created for the admin user and are stored in identity folder at /app/identity. So, no need to re-trigger the /addToWallet api again.
- Open new tab and cd to /app directory in the folder.
cd app
- Start the nodejs service
npm install npm run start
- Open Postman app and import the collections available in test folder at path ./test
- Run the Initiation collection to register entities and drugs on the network with the delay of 1000 ms and check the save response in the configuration.
- Run the Supply Chain collection to create a supply drugs from manufacturer to the user via distributor, retailer and transporter. Add the the delay of 1000 ms and check the save response in the configuration.
- Run the History Track Down collection to know the history of transaction and the current state of the drug.