Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattdean1/blockchain-supply-chain
⛓ Supply Chain on Hyperledger Fabric
https://github.com/mattdean1/blockchain-supply-chain
blockchain hyperledger hyperledger-composer hyperledger-fabric supply-chain
Last synced: 3 months ago
JSON representation
⛓ Supply Chain on Hyperledger Fabric
- Host: GitHub
- URL: https://github.com/mattdean1/blockchain-supply-chain
- Owner: mattdean1
- Created: 2018-01-29T19:20:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-16T10:40:08.000Z (over 4 years ago)
- Last Synced: 2024-11-08T14:39:15.440Z (3 months ago)
- Topics: blockchain, hyperledger, hyperledger-composer, hyperledger-fabric, supply-chain
- Language: JavaScript
- Homepage:
- Size: 22.6 MB
- Stars: 142
- Watchers: 10
- Forks: 50
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blockchain-supply-chain
A technical framework for improving traceability in supply chain systems using blockchain. Developed as part of my final year project at University. See [dissertation.pdf](/dissertation.pdf) for further discussion.
> Improving Supply chain systems offers benefits to quality, cost, and regulatory compliance, but
interoperability between organisations is an obstacle. This project addresses the issue of interoperability through the introduction of blockchain technology, implementing a complex supply chain model from literature on the Hyperledger platform.>The process of translating a supply chain network model to an implementation is described in
detail; coupled with the the complexity of the network model chosen, this allows the system to
be generalised well to a variety of supply chain use cases. The system includes infrastructure,
application and integration layers, providing an end-to-end reference implementation for creation
of supply chain systems in enterprise.# Prequisites
* Docker
* Postman
* Node.js / npm
* yarn# Install
## Download Fabric Docker images
```
curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0-rc1
```([docs](https://hyperledger-fabric.readthedocs.io/en/release-1.1/samples.html#binaries))
## Install Composer command line tools
```
npm i -g [email protected] [email protected] passport-github
```## Import sample participant identities
```
cd network
./importIdCards.sh
```## Enable authentication for API server
[Create a new OAuth application on GitHub](https://github.com/settings/applications/new)
* Application name: `composer-rest-server`
* Homepage URL: `http://localhost:3000/`
* Application description: `OAuth application for the multi-user mode of composer-rest-server`
* Authorization callback URL: `http://localhost:3000/auth/github/callback`# Run
## Start the network
```
# in 'network' directory
export COMPOSE_PROJECT_NAME=biswas
./deployNetwork.sh
```## Start the API server
```
export COMPOSER_PROVIDERS='{
"github": {
"provider": "github",
"module": "passport-github",
"clientID": "REPLACE_WITH_CLIENT_ID",
"clientSecret": "REPLACE_WITH_CLIENT_SECRET",
"authPath": "/auth/github",
"callbackURL": "/auth/github/callback",
"successRedirect": "/",
"failureRedirect": "/"
}
}'composer-rest-server -c grower-network-admin@biswas -a true -m true
```The API explorer is now located http://localhost:3000/explorer.
# Interacting with the network
## Import identities into API server
* Navigate to http://localhost:3000/auth/github and authenticate with GitHub
* Find the `/wallet/import` endpoint at the bottom of the list in the API explorer
* Import the admin identity card from `./network/fabric/id-cards/grower-network-admin/card` using the name `admin`
* Import the identity cards for the sample network participants from `./network/fabric/id-cards/users` using the same endpoint. The names should be the same as the name of the card, i.e. the file `distributor.card` should be imported as `distributor`## Add sample data using Postman
* Navigate to the [end-to-end test run documentation](https://documenter.getpostman.com/view/2277062/integration-tests/RVu2nAni) and click 'Run in Postman'
* Select the imported `sample-env` environment
* Display your OAuth access token in the explorer by clicking 'show'. Copy this into your Postman environment as the value for the key `accessToken`
* Run the requests using the collection runner## View traceability information
* Copy your OAuth access token into line 9 of `./frontend/src/controllers/api.js`
* Start the web application by running `yarn start` inside `./frontend`
* Copy the value of `bottleID` from the Postman environment
* Navigate to the frontend at http://localhost:3001/
* Search for the copied bottleID.# Development
## Unit tests
```
# in ./network/composer
npm t
```