Get the code
View the demo
by Ashutosh Nath Agarwal, Raheel Zubairy | Published April 5, 2019
This code pattern is for developers looking to start building blockchain applications with Hyperledger Fabric and IBM Blockchain extension for VS Code. Learn how to set up a Hyperledger Fabric customer rewards program network on a local Fabric network, install and instantiate a smart contract through IBM Blockchain extension for VS Code, and develop a Node.js web application with the Hyperledger Fabric SDK to interact with the deployed network.
Customer loyalty programs allow companies to reward customers who frequently make purchases. Program members earn points on purchases, which translate into some type of reward, such as a discount, freebie, or special customer treatment. The members work toward a certain amount of points to redeem rewards. These programs can have multiple companies as partners to cater to a customer base. However, current loyalty program systems put restraints on the relations between partners and can hamper visibility for members. These restraints can be removed by creating the customer loyalty program on a blockchain network. This blockchain model for a customer loyalty program enhances the value of points to loyalty program members and brings new value to the partners with trusted transactions. Participants in this network have a more level relationship with one another, and points are in the centric position to connect all participants.
This developer code pattern shows you how to create a customer loyalty program as a blockchain web application using Hyperledger Fabric and Node.js. The application allows members to register on the network where they create their accounts. They are identified on the network with their account numbers and create an access key, which they use to sign in. This access key is used as the card ID for making transactions and querying records. A member, once signed in, can make transactions to earn and redeem points from the partners on the network. They can view their transactions as part of the blockchain ledger. This code pattern illustrates the use of permissions as part of the network where members can only view their own transactions.
Similarly for the partners, they register by creating their identity on the network and get access keys to view their records. Partners are allowed to view only transactions they were part of, so they can keep track of all their transactions where they allocated or redeemed points. The web application shows a basic dashboard for the partner, displaying the total points allocated and redeemed to members. As transactions get more complex, partners can perform analyses on their transactions to create informative dashboards.
This code pattern is for developers looking to start building blockchain applications with Hyperledger Fabric and IBM Blockchain extension for VS Code. When you have completed this code pattern, you will understand how to:
Note: The blockchain network will have multiple members and partners.
Ready to get started? See the README for all the details.
July 15, 2019
June 8, 2019
Get the Code »
Back to top