build-blockchain-insurance-app | Sample insurance application using Hyperledger | Blockchain library
kandi X-RAY | build-blockchain-insurance-app Summary
kandi X-RAY | build-blockchain-insurance-app Summary
This project showcases the use of blockchain in insurance domain for claim processing. In this application, we have four participants, namely 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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of build-blockchain-insurance-app
build-blockchain-insurance-app Key Features
build-blockchain-insurance-app Examples and Code Snippets
Community Discussions
Trending Discussions on build-blockchain-insurance-app
QUESTION
I am trying to create a single org, single ca, single peer network, bootstrapped by the nodejs-sdk
. I have used this sample for reference.
When I try to instantiate()
the chaincode I get this error in the peer accessed by docker logs ax-peer
ANSWER
Answered 2020-Feb-04 at 09:10So as per the suggestion by Gari, I added the command in my peer-base.yaml
file. The code still did not work but in docker logs ax-peer
a more descriptive error popped up that said fabric-chaincode-node
not found. Upon inspection it seems apart from installing fabric-contract-api
, I also have to install fabric-shim
in the chaincode folder. This was added as a requirement in latest Fabric as per this document.
Since fabric-contract-api
extends fabric-shim
so I did not include it, now that I have the chaincode is being installed.
EDIT- 2020
The documents for nodejs SDK have shifted. The release notes and new dependencies for fabric-contract-api
can be found at this link which states the fabric-shim
is now fabric-shim-api
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install build-blockchain-insurance-app
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.
View transaction details on our channel from IBM Blockchain Platform.
We will build a network as provided by the IBM Blockchain Platform documentation. This will include creating a channel with a single peer organization with its own MSP and CA (Certificate Authority), and an orderer organization with its own MSP and CA. We will create the respective identities to deploy peers and operate nodes.
Create your insurance organization CA Click Add Certificate Authority. Click IBM Cloud under Create Certificate Authority and Next. Give it a Display name of Insurance CA. Specify an Admin ID of admin and Admin Secret of adminpw.
Create your shop organization CA (process is same as shown in gif above) Click Add Certificate Authority. Click IBM Cloud under Create Certificate Authority and Next. Give it a Display name of Shop CA. Specify an Admin ID of admin and Admin Secret of adminpw.
Create your repair shop organization CA (process is same as shown in gif above) Click Add Certificate Authority. Click IBM Cloud under Create Certificate Authority and Next. Give it a Display name of Repair Shop CA. Specify an Admin ID of admin and Admin Secret of adminpw.
Create your police organization CA (process is same as shown in gif above) Click Add Certificate Authority. Click IBM Cloud under Create Certificate Authority and Next. Give it a Display name of Police CA. Specify an Admin ID of admin and Admin Secret of adminpw.
Use your CA to register insurance identities Select the Insurance CA Certificate Authority that we created. First, we will register an admin for our Insurance Organization. Click on the Register User button. Give an Enroll ID of insuranceAdmin, and Enroll Secret of insuranceAdminpw. Click Next. Set the Type for this identity as client and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank. We will repeat the process to create an identity of the peer. Click on the Register User button. Give an Enroll ID of insurancePeer, and Enroll Secret of insurancePeerpw. Click Next. Set the Type for this identity as peer and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank.
Use your CA to register shop identities (process is same as shown in gif above) Select the Shop CA Certificate Authority that we created. First, we will register an admin for our Insurance Organization. Click on the Register User button. Give an Enroll ID of shopAdmin, and Enroll Secret of shopAdminpw. Click Next. Set the Type for this identity as client and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank. We will repeat the process to create an identity of the peer. Click on the Register User button. Give an Enroll ID of shopPeer, and Enroll Secret of shopPeerpw. Click Next. Set the Type for this identity as peer and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank.
Use your CA to register repair shop identities (process is same as shown in gif above) Select the Repair Shop CA Certificate Authority that we created. First, we will register an admin for our Insurance Organization. Click on the Register User button. Give an Enroll ID of repairShopAdmin, and Enroll Secret of repairShopAdminpw. Click Next. Set the Type for this identity as client and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank. We will repeat the process to create an identity of the peer. Click on the Register User button. Give an Enroll ID of repairShopPeer, and Enroll Secret of repairShopPeerpw. Click Next. Set the Type for this identity as peer and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank.
Use your CA to register police shop identities (process is same as shown in gif above) Select the Police CA Certificate Authority that we created. First, we will register an admin for our Insurance Organization. Click on the Register User button. Give an Enroll ID of policeAdmin, and Enroll Secret of policeAdminpw. Click Next. Set the Type for this identity as client and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank. We will repeat the process to create an identity of the peer. Click on the Register User button. Give an Enroll ID of policePeer, and Enroll Secret of policePeerpw. Click Next. Set the Type for this identity as peer and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank.
Create the insurance MSP definition Navigate to the Organizations tab in the left navigation and click Create MSP definition. Enter the MSP Display name as Insurance MSP and an MSP ID of insurancemsp. Under Root Certificate Authority details, specify the peer CA that we created Insurance CA as the root CA for the organization. Give the Enroll ID and Enroll secret for your organization admin, insuranceAdmin and insuranceAdminpw. Then, give the Identity name, Insurance Admin. Click the Generate button to enroll this identity as the admin of your organization and export the identity to the wallet. Click Export to export the admin certificates to your file system. Finally click Create MSP definition.
Create the shop MSP definition (same process as shown in gif above) Navigate to the Organizations tab in the left navigation and click Create MSP definition. Enter the MSP Display name as Shop MSP and an MSP ID of shopmsp. Under Root Certificate Authority details, specify the peer CA that we created Shop CA as the root CA for the organization. Give the Enroll ID and Enroll secret for your organization admin, shopAdmin and shopAdminpw. Then, give the Identity name, Shop Admin. Click the Generate button to enroll this identity as the admin of your organization and export the identity to the wallet. Click Export to export the admin certificates to your file system. Finally click Create MSP definition.
Create the repair shop MSP definition (same process as shown in gif above) Navigate to the Organizations tab in the left navigation and click Create MSP definition. Enter the MSP Display name as Repair Shop MSP and an MSP ID of repairshopmsp. Under Root Certificate Authority details, specify the peer CA that we created Repair Shop CA as the root CA for the organization. Give the Enroll ID and Enroll secret for your organization admin, repairShopAdmin and repairShopAdminpw. Then, give the Identity name, Repair Shop Admin. Click the Generate button to enroll this identity as the admin of your organization and export the identity to the wallet. Click Export to export the admin certificates to your file system. Finally click Create MSP definition.
Create the police MSP definition (same process as shown in gif above) Navigate to the Organizations tab in the left navigation and click Create MSP definition. Enter the MSP Display name as Police MSP and an MSP ID of policemsp. Under Root Certificate Authority details, specify the peer CA that we created Police CA as the root CA for the organization. Give the Enroll ID and Enroll secret for your organization admin, policeAdmin and policeAdminpw. Then, give the Identity name, Police Admin. Click the Generate button to enroll this identity as the admin of your organization and export the identity to the wallet. Click Export to export the admin certificates to your file system. Finally click Create MSP definition.
Create an insurance peer On the Nodes page, click Add peer. Click IBM Cloud under Create a new peer and Next. Give your peer a Display name of Insurance Peer. On the next screen, select Insurance CA as your Certificate Authority. Then, give the Enroll ID and Enroll secret for the peer identity that you created for your peer, insurancePeer, and insurancePeerpw. Then, select the Administrator Certificate (from MSP), Insurance MSP, from the drop-down list and click Next. Give the TLS Enroll ID, admin, and TLS Enroll secret, adminpw, the same values are the Enroll ID and Enroll secret that you gave when creating the CA. Leave the TLS CSR hostname blank. The last side panel will ask you to Associate an identity and make it the admin of your peer. Select your peer admin identity Insurance Admin. Review the summary and click Submit.
Create a shop peer (same process as shown in gif above) On the Nodes page, click Add peer. Click IBM Cloud under Create a new peer and Next. Give your peer a Display name of Shop Peer. On the next screen, select Shop CA as your Certificate Authority. Then, give the Enroll ID and Enroll secret for the peer identity that you created for your peer, shopPeer, and shopPeerpw. Then, select the Administrator Certificate (from MSP), Shop MSP, from the drop-down list and click Next. Give the TLS Enroll ID, admin, and TLS Enroll secret, adminpw, the same values are the Enroll ID and Enroll secret that you gave when creating the CA. Leave the TLS CSR hostname blank. The last side panel will ask you to Associate an identity and make it the admin of your peer. Select your peer admin identity Shop Admin. Review the summary and click Submit.
Create a repair shop peer (same process as shown in gif above) On the Nodes page, click Add peer. Click IBM Cloud under Create a new peer and Next. Give your peer a Display name of Repair Shop Peer. On the next screen, select Repair Shop CA as your Certificate Authority. Then, give the Enroll ID and Enroll secret for the peer identity that you created for your peer, repairShopPeer, and repairShopPeerpw. Then, select the Administrator Certificate (from MSP), Repair Shop MSP, from the drop-down list and click Next. Give the TLS Enroll ID, admin, and TLS Enroll secret, adminpw, the same values are the Enroll ID and Enroll secret that you gave when creating the CA. Leave the TLS CSR hostname blank. The last side panel will ask you to Associate an identity and make it the admin of your peer. Select your peer admin identity Repair Shop Admin. Review the summary and click Submit.
Create a police peer (same process as shown in gif above) On the Nodes page, click Add peer. Click IBM Cloud under Create a new peer and Next. Give your peer a Display name of Police Peer. On the next screen, select Police CA as your Certificate Authority. Then, give the Enroll ID and Enroll secret for the peer identity that you created for your peer, policePeer, and policePeerpw. Then, select the Administrator Certificate (from MSP), Police MSP, from the drop-down list and click Next. Give the TLS Enroll ID, admin, and TLS Enroll secret, adminpw, the same values are the Enroll ID and Enroll secret that you gave when creating the CA. Leave the TLS CSR hostname blank. The last side panel will ask you to Associate an identity and make it the admin of your peer. Select your peer admin identity Police Admin. Review the summary and click Submit.
Create your orderer organization CA Click Add Certificate Authority. Click IBM Cloud under Create Certificate Authority and Next. Give it a unique Display name of Orderer CA. Specify an Admin ID of admin and Admin Secret of adminpw.
Use your CA to register orderer and orderer admin identities (shown in gif above) In the Nodes tab, select the Orderer CA Certificate Authority that we created. First, we will register an admin for our organization. Click on the Register User button. Give an Enroll ID of ordereradmin, and Enroll Secret of ordereradminpw. Click Next. Set the Type for this identity as client and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank. We will repeat the process to create an identity of the orderer. Click on the Register User button. Give an Enroll ID of orderer1, and Enroll Secret of orderer1pw. Click Next. Set the Type for this identity as peer and select org1 from the affiliated organizations drop-down list. We will leave the Maximum enrollments and Add Attributes fields blank.
Create the orderer organization MSP definition Navigate to the Organizations tab in the left navigation and click Create MSP definition. Enter the MSP Display name as Orderer MSP and an MSP ID of orderermsp. Under Root Certificate Authority details, specify the peer CA that we created Orderer CA as the root CA for the organization. Give the Enroll ID and Enroll secret for your organization admin, ordereradmin and ordereradminpw. Then, give the Identity name, Orderer Admin. Click the Generate button to enroll this identity as the admin of your organization and export the identity to the wallet. Click Export to export the admin certificates to your file system. Finally click Create MSP definition.
Create an orderer On the Nodes page, click Add orderer. Click IBM Cloud and proceed with Next. Give your peer a Display name of Orderer. On the next screen, select Orderer CA as your Certificate Authority. Then, give the Enroll ID and Enroll secret for the peer identity that you created for your orderer, orderer1, and orderer1pw. Then, select the Administrator Certificate (from MSP), Orderer MSP, from the drop-down list and click Next. Give the TLS Enroll ID, admin, and TLS Enroll secret, adminpw, the same values are the Enroll ID and Enroll secret that you gave when creating the CA. Leave the TLS CSR hostname blank. The last side panel will ask to Associate an identity and make it the admin of your peer. Select your peer admin identity Orderer Admin. Review the summary and click Submit.
Add organizations as Consortium Member on the orderer to transact Navigate to the Nodes tab, and click on the Orderer that we created. Under Consortium Members, click Add organization. From the drop-down list, select Insurance MSP. Click Submit. Repeat the same steps, but add Shop MSP, Repair Shop MSP, and Police MSP as well.
Create the channel Navigate to the Channels tab in the left navigation. Click Create channel. Give the channel a name, mychannel. Select the orderer you created, Orderer from the orderers drop-down list. Select the MSP identifying the organization of the channel creator from the drop-down list. This should be Insurance MSP (insurancemsp). Associate available identity as Insurance Admin. Click Add next to the insurance organization. Make the insurance organization an Operator. Click Add next to the shop organization. Make the shop organization an Operator. Click Add next to the repair shop organization. Make the repair shop organization an Operator. Click Add next to the police organization. Make the insurance organpoliceization an Operator. Click Create.
Join your peer to the channel Click Join channel to launch the side panels. Select your Orderer and click Next. Enter the name of the channel you just created. mychannel and click Next. Select which peers you want to join the channel, click Insurance Peer, Shop Peer, Repair Shop Peer, and Police Peer. Click Submit.
Add anchor peers to the channel In order to communicate between organizations, we need to enroll anchor peers. From the channels tab, click on the channel you have created, mychannel. From the channel overview page, click on channel details. Scroll all the way down until you see Anchor peers. Click Add anchor peer and add the Insurance, Police, Repair Shop, and Shop peers. Select which peers you want to join the channel, click Insurance Peer, Shop Peer, Repair Shop Peer, and Police Peer. Click Add anchor peer. If all went well, your channel Anchor peers should look like below:
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page