Track And Trace Application
A Sample Application Using STRATO's Bootstrapping Framework Tools
Track and Trace is a demo app that uses STRATO to track products through a supply chain using OAuth and Private chains.
- Make sure that you have set up at least one node on your STRATO network using the folloing parameters:
HTTP_PORT=8080 NODE_HOST=localhost:8080 OAUTH_JWT_VALIDATION_ENABLED=true OAUTH_STRATO42_FALLBACK=true OAUTH_JWT_USERNAME_PROPERTY=email OAUTH_JWT_VALIDATION_DISCOVERY_URL=https://keycloak.blockapps.net/auth/realms/track-and-trace/.well-known/openid-configuration
- Clone the demo application repository and update its submodules:
git clone https://github.com/blockapps/track-and-trace.git cd track-and-trace git submodule update --init --recursive
.env file and add all the tokens from the tokens section of the
README.md file for the Trace and Trace Demo
- Run the application using Docker
To run application against the STRATO node running locally (uses config
server/config/docker.config.yaml by default):
docker-compose up -d
To run application with the custom configuration - create the new config file at
server/config/mycustomconfig.config.yaml and run application as follows:
SERVER=mycustomconfig docker-compose up -d
This will make the application use
server/config/mycustomconfig.config.yaml configuration file instead of the default.
Wait for all containers to report healthy status in the output of
docker ps, then visit http://localhost
The tokens correspond to four different users in in four different roles:
- email@example.com in Manufacturer role : This user can create the original asset
- firstname.lastname@example.org in Distributor role : This user can bid on an asset after its creation
- email@example.com in Retailer role : Similar to the distributor role but could be expanded in the future.
- firstname.lastname@example.org in Regulator role: This user can see the audit history for all assets and bidding activity
- A manufacturer logs in and creates an asset
- Manufacturer makes asset available for bidding
- A Distributor can then bid on this asset. The bid is created on private chain (state channel) and the bid information can only be accessed by the asset owner (manufacturer), distributor and regulator
- The owner of the asset (manufacturer) can accept or reject the bid. If the bid is accepted, the owner of the asset changes to the user that placed the bid.
- This same process then repeats between the distributor and retailer.
Creating an asset
Placing a Bid
Accepting a Bid
Viewing Audit Logs