Perform analytics on blockchain transactions
Use Db2 and SQL to implement analytics an blockchain
This code pattern uses IBM Db2 federation capabilities to perform SQL analytics on a sample blockchain insurance application using Hyperledger Fabric. This code pattern uses the sample blockchain insurance application. Apache Zeppelin notebook will be used to perform analytics by querying the blockchain using Db2 and SQL.
NOTE: This code pattern can either be run locally, or connected to the IBM Blockchain Platform.
This code pattern showcases the use of blockchain in insurance domain for claim processing. The pattern leverages IBM Db2 federation capabilities to perform SQL analytics on a sample blockchain insurance application using Hyperledger Fabric. The code pattern also uses Apache Zeppelin notebook which is used to perform analytics by querying the blockchain using IBM Db2 and SQL.
In this application, we have four participants: insurance, police, repair shop, and the shop. Furthermore, each participant will own its own peer node. The insurance peer is the insurance company providing the insurance for the products and it is responsible for processing the claims. Police peer is responsible for verifying the theft claims. Repair shop peer is responsible for repairs of the product while shop peer sells the products to consumer. The value of running this network on the IBM Blockchain Platform is that you can easily customize the network infrastructure as needed, whether that is the location of the nodes, the CPU and RAM of the hardware, the endorsement policy needed to reach consensus, or adding new organizations and members to the network.
After completing this code pattern, you’ll understand how to:
- Create a Kubernetes Cluster using the IBM Kubernetes Service.
- Create an IBM Blockchain service, and launch the service onto the Kubernetes cluster.
- Create a network, including all relevant components, such as Certificate Authority, MSP (Membership Service Providers), peers, orderers, and channels.
- Deploy a packaged smart contract onto the IBM Blockchain Platform by installing and instantiating it on the peers.
- Use the connection profile from IBM Blockchain Platform to create application admins, and submit transactions from our client application.
- Configure a Db2 Federated Server to Access the Blockchain.
- Query Blockchain via Zeppelin Notebooks using Db2 and SQL to perform analytics on blockchain transactions.
- The blockchain operator creates a IBM Kubernetes Service cluster (32CPU, 32RAM, 3 workers recommended) and an IBM Blockchain Platform 2.0 service.
- The IBM Blockchain Platform 2.0 creates a Hyperledger Fabric network on an IBM Kubernetes Service, and the operator installs and instantiates the smart contract on the network.
- The Node.js application server uses the Fabric SDK to interact with the deployed network on IBM Blockchain Platform 2.0.
- The React UI uses the Node.js application API to interact and submit transactions to the network.
- The user uses React UI to interact with the blockchain insurance application to create business transactions.
- To perform business queries on the blockchain, the user interacts with Zeppelin notebook as a front end to Db2 federation to perform SQL queries against blockchain network.
Get the detailed instructions in the README file. These steps will show you how to:
- Create IBM Cloud services
- Build a network – Certificate Authority
- Build a network – Create MSP Definitions
- Build a network – Create Peers
- Build a network – Create Orderer
- Build a network – Create and Join Channel
- Deploy Insurance Smart Contract on the network
- Connect application to the network
- Enroll App Admin Identities
- Run the application
- Create business transactions on blockchain application
- Configure Db2 Federation Server and Zeppelin Notebook
- Perform analytical SQL queries