Trace Fruits is a conceptual demo designed to visualize fruit supply chain events stored in an immutable ledger. It utilizes Splunk to analyze data generated from Hyperledger Fabric's blockchain ledgers.
This demo is inspired by the GS1 Global Traceability Standard, which provides guidelines for fresh fruit and vegetable traceability. The major supply chain events for traceability include:
- Harvesting - The producer harvests the crop and packs the products into cases.
- Packing/Repacking - The packer/repacker transforms ungraded commodities into retail-ready products.
- Shipping - The packer/repacker palletizes the cases of product.
- Transporting - The carrier arrives and loads the pallets onto the truck.
- Receiving - The pallets arrive at the retailer or foodservice operator's distribution center.
- Selling or Consumption - The products have arrived at the retail store and have been placed on the shelves.
By leveraging blockchain technology and data analysis, Trace Fruits aims to provide better transparency and traceability throughout the entire fruit supply chain process. harvesting-traceability event as stored in ledger
{
"_id": "0e8a4c14-02f2-42b5-939c-a8de8d2c7db6",
"_rev": "1-c1b69236a1b423ec7806837549c32c8c",
"attributes": {
"event-when": "2021-05-24 18:47:22.151667 +1000 AEST",
"event-where": "Johannesburg, South Africa",
"event-why": "harvesting-traceability",
"expiration-datetime": "2021-12-24 18:47:22.1515 +1000 AEST",
"fruit-name": "Apricots",
"fruit-type": "deciduous",
"quantity": 313,
"weight": 212
},
"header": {
"batch-lot": "AB-123",
"event-id": "0e8a4c14-02f2-42b5-939c-a8de8d2c7db6",
"gln": "9501101530911",
"gln-location-type": "planting",
"gtin": "09501101530003",
"gtin-trade-id-type": "crate-trade-id",
"trace-id": "11111111"
},
"metaInfo": {
"createdAt": "2021-06-26T18:45:04.140564684Z",
"docType": "harvesting"
},
"~version": "\u0000CgMBBAA="
}
A trace-id is unique for set of product's supply chain events.
https://tinyurl.com/trace-fruits-demo
-
At every logical step of the fruit supply chain, a fresh fruit supply chain event with a unique trace-id is inserted into the blockchain ledger (e.g., harvesting event or shipping event). This event contains crucial information to identify and verify the supply chain event.
-
The inserted unique trace-ids correspond to a batch of fruit products, and the trace-id is inserted for each event from start to finish for that batch of fruit products (e.g., from harvesting to retail).
-
A complete audit trail of events from start to finish can be queried from the ledger using the trace-id.
-
Individual events can also be queried from the ledger.
-
Events are inserted along the supply chain process.
Execute the command to pull down the binaries and images
curl -sSL http://bit.ly/2ysbOFE | bash -s -- 1.4.6 1.4.6 0.4.18
- hyperledger/fabric-baseos 0.4.18
- hyperledger/fabric-ca 1.4.6
- hyperledger/fabric-orderer 1.4.6
- hyperledger/fabric-peer 1.4.6
Inside this repo, call start shell script. It will setup necessary dockers images e.g. couch, Splunk, fabric network, orgs, peers, channels
./start.sh
./init_ledgers.sh
It will insert 18 supply events into the via trace_fruits_cc chaincode to the ledgers.
http://<ip address>:5984/_utils/
Click on databases Click on fruitsreceiver_trace_fruits_cc
./send_txns.sh
http://<ip-address>:8000/en-US/account/login
username : admin
Password : changeme
if local then ip address is 127.0.0.1
Open Splunk App for Hyperledger Fabric Click on Trace Fruits On the Side Bar
./stop.sh
.
- .checkpoints is an empty file -> ./.checkpoints:/usr/src/app/.checkpoints in docker-compose-splunk.yaml
- splunk-apps is an empty dir -> - ./splunk-apps:/opt/splunk/etc/apps in docker-compose-splunk.yaml
- trace-fruits-apps contains trace-fruits splunk app available tar.gz, and a regular folder
- trace-fruits chaincode available in trace-fruits-cc directory
- trace-fruits-splunk-app.tar.gz also available in s3 https://trace-fruits.s3.ap-southeast-2.amazonaws.com/trace-fruits-splunk-app.tar.gz
- Audit trail query is not implemented yet
- Tar file of Trace-Fruits-1 doesn't work if created from mac,