Taxonomy Icon

Blockchain

Create a fair-trade supply network

Get the code

Summary

The journey from mountaintop to countertop is long. Gaps in accountability and transparency open the door to delays and fraud. Enter IBM Blockchain. In this developer code pattern, we will create a blockchain app that increases visibility and efficiency in the supply chain of a coffee retailer, giving you a taste of a traceable, trackable coffee trade. See how blockchain can help farmers, roasters, and everyone in between bring you a fresher, fairer cup.

Description

Have you been interested in learning about creating applications that mimic a food trust supply chain with Hyperledger Composer? This developer code pattern can help you do just that.

Learn how to create a blockchain app that increases visibility and efficiency in the supply chain of a coffee retailer. The private keys and credentials of the blockchain application will be stored on a Cloudant® database. We will use different transactions to show different possible actions for the different participants in the supply chain. This sample application will record all transactions on the IBM Blockchain Starter Kit and enable a coffee retailer to assure the customer that the coffee is organic and fair-trade.

When you have completed this code pattern, you will understand how to:

  • Interact with IBM Blockchain Starter Kit.
  • Build a blockchain back end using Hyperledger Composer.
  • Create and use Cloudant NoSQL Database.
  • Deploy a Cloud Foundry application that writes and queries to the ledger.

Flow

flow

  1. The user deploys the app in IBM Cloud. The user submits transactions.
  2. The transaction is submitted to the blockchain.
  3. When the transaction conforms to the business logic, the data is written to the ledger.
  4. A block is appended to our chain on the IBM Blockchain Starter Kit for the specific channel.
  5. The user queries the blockchain to retrieve relevant details about their transaction.

Instructions

Find the detailed steps for this pattern in the README. The steps will show you how to:

  1. Create the toolchain
  2. Clone the repo
  3. Use Yeoman to scaffold your project
  4. Push smart contract code
  5. Deploy smart contract to IBM Blockchain Starter Plan
  6. Post transactions and query the Composer REST Server (Swagger UI))
  7. Launch IBM Blockchain Starter Plan
  8. Inspect blocks on IBM Blockchain Starter Plan
  9. Submit fair trade supply data