All Projects → Capgemini-AIE → blockchain-insurance

Capgemini-AIE / blockchain-insurance

Licence: other
Blockchain Car Insurance with Smart Contracts on Hyperledger

Programming Languages

javascript
184084 projects - #8 most used programming language
go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to blockchain-insurance

byzantine-browser
KHS Blockchain Browser
Stars: ✭ 19 (-73.61%)
Mutual labels:  hyperledger, chaincode
hlfabric-k8scc
Chaincode builder and launcher for Hyperledger Fabric on Kubernetes
Stars: ✭ 21 (-70.83%)
Mutual labels:  hyperledger, chaincode
hlf-operator
Hyperledger Fabric Kubernetes operator - Hyperledger Fabric operator for Kubernetes (v2.2+)
Stars: ✭ 112 (+55.56%)
Mutual labels:  hyperledger, chaincode
Contracts
All WiBX blockchain chain code
Stars: ✭ 20 (-72.22%)
Mutual labels:  hyperledger, chaincode
readme
The Blockchain Bible,a collections for blockchain tech,bitcoin,ethereum,crypto currencies,cryptography,decentralized solutions,business scenarios,hyperledger tech,meetups,区块链,数字货币,加密货币,比特币,以太坊,密码学,去中心化,超级账本
Stars: ✭ 46 (-36.11%)
Mutual labels:  hyperledger
techdocs
Accord Project Documentation
Stars: ✭ 48 (-33.33%)
Mutual labels:  hyperledger
Heroes Service
Short tutorial to build a blockchain application in Go with Hyperledger Fabric
Stars: ✭ 248 (+244.44%)
Mutual labels:  hyperledger
fabric
这是基于fabric 1.4.1 版本国密改造项目
Stars: ✭ 62 (-13.89%)
Mutual labels:  hyperledger
composer-atom-plugin
⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
Stars: ✭ 14 (-80.56%)
Mutual labels:  hyperledger
Composer Sample Networks
⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
Stars: ✭ 226 (+213.89%)
Mutual labels:  hyperledger
snak
Snak is a Hyperledger Burrow’s tools, which provides some facilities to compile, deploy and test smart contracts and send transactions to the Burrow. With Snack you can easily install and uninstall Burrow (currently only for Darwin and Ubuntu 16.04 amd64) and easily launch a Burrow test network.(Updated for Hyperledger Burrow v0.18.0)
Stars: ✭ 14 (-80.56%)
Mutual labels:  hyperledger
OpenTender
E-portal for government tender process using Hyperledger (Blockchain) technology.
Stars: ✭ 18 (-75%)
Mutual labels:  hyperledger
blockchain-hackathon
An electronic health record (EHR) system built on Hyperledger Composer blockchain
Stars: ✭ 67 (-6.94%)
Mutual labels:  hyperledger
composer-sample-models
⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
Stars: ✭ 30 (-58.33%)
Mutual labels:  hyperledger
docker-hyperledger-fabric-peer
Docker image for Hyperledger Fabric Peer
Stars: ✭ 25 (-65.28%)
Mutual labels:  hyperledger
Awesome Blockchain Kor
<블록체인의 정석>, <하이퍼레저 블록체인 개발> 소스코드 및 참고자료 저장소
Stars: ✭ 243 (+237.5%)
Mutual labels:  hyperledger
blockchain-in-node
This is an afternoon-project, a blockchain built in node, supporting PoW.
Stars: ✭ 20 (-72.22%)
Mutual labels:  chaincode
Blockchain
Recently started working on Blockchain technologies. This repo contains material related to Blockchain technologies. My current focus on dAPP development using Hyperledger.
Stars: ✭ 21 (-70.83%)
Mutual labels:  hyperledger
hurley
The development environment toolset for blockchain projects
Stars: ✭ 79 (+9.72%)
Mutual labels:  hyperledger
hyperledger-fabric-graphql-boilerplate
Hyperledger Fabric GraphQL Boilerplate
Stars: ✭ 44 (-38.89%)
Mutual labels:  hyperledger

Blockchain Insurance

A proof of concept Blockchain project around Car Insurance.

Deploy this to Bluemix

Deploy to Bluemix

To deploy to Bluemix:

  1. Hit the button above.

  2. Open the created pipeline, inspect the 'credentials' step & add missing environment property values.

    APIKEY=EDMUNDS API KEY (sign up for one), GCM_KEY=Google cloud messaging key for webpush.

  3. Open 'deploy' and add a basic CF deploy job.

  4. Run the pipeline from the start.

  5. If errors occur, bind an instance of IBM's blockchain service to the application & restage.

Development Environment

We're building on the docker-compose from https://github.com/IBM-Blockchain/fabric-images.

See also these instructions for using a local hyperledger network.

To run a single node network using Docker Compose -

docker-compose -f docker-compose/single-peer-ca.yaml up -d

For a four node + CA network:

docker-compose -f four-peer-ca.yaml up -d

To test it is up and running properly hit http://localhost:7050/chain

Configuring users in local (dev mode) docker instance

Execute the following commands after running docker-compose (from the docker-compose folder)

docker cp membersrvc/membersrvc.yaml dockercompose_membersrvc_1:/opt/gopath/src/github.com/hyperledger/fabric/membersrvc
docker exec -i -t dockercompose_membersrvc_1 /bin/bash
rm -rf /var/hyperledger/production
exit
docker restart dockercompose_membersrvc_1
docker exec -i -t dockercompose_vp0_1 /bin/bash
rm -rf /var/hyperledger/production
exit
docker restart dockercompose_vp0_1

7 users will then be created:

claimant1
claimant2
garage1
garage2
insurer1
insurer2
superuser

In order for the correct username/role to be established within the chaincode (in dev mode), an attributes value has to be added to the REST request. Example:

curl -H "Content-Type: application/json" -X POST -d '{
     "jsonrpc": "2.0",
     "method": "query",
     "params": {
         "type": 1,
         "chaincodeID": {
             "name": "insurance"
         },
         "ctorMsg": {
             "function": "retrieveAllPolicies"
         },
         "secureContext": "claimant2",
				 "attributes": ["username","claimant2","role","policyholder"]
     },
     "id": 4
 }' http://localhost:7050/chaincode

Deploying chaincode for development (Only currently working in the 4 peer environment)

To run chaincode locally without having to deploy from a github url:

  1. Build your chaincode
go build ./
  1. Register the chaincode with a peer
CORE_CHAINCODE_ID_NAME=insurance CORE_PEER_ADDRESS=0.0.0.0:7051 ./insurance_main
  1. Send a REST request to enroll a user
POST: http://localhost:7050/registrar
{
  "enrollId": "bob",
  "enrollSecret": "NOE63pEQbL25"
}
  1. Send a REST deploy request
POST: http://localhost:7050/chaincode
{
  "jsonrpc": "2.0",
  "method": "deploy",
  "params": {
    "type": 1,
    "chaincodeID":{
        "name": "insurance"
    },
    "ctorMsg": {
        "function":"init"
    },
    "secureContext": "bob"
  },
  "id": 1
}
  1. The chaincode should now be deployed and ready to accept INVOKE or QUERY requests.

Running Blockchain Explorer

If you want to view your blockchian locally you can use the blockchain explorer.

To build the Docker image, run -

git clone https://github.com/hyperledger/blockchain-explorer.git
cd blockchain-explorer/explorer_1
docker build -t hyperledger/blockchain-explorer .

To run it first you will need to find out which network your hyperledger fabric peers are running on. To do this run:

docker network ls

Grab the Docker Compose network name and use it below:

docker run -p 9090:9090 -itd --network=dockercompose_default -e HYP_REST_ENDPOINT=http://vp0:7050 hyperledger/blockchain-explorer

The explorer should then be available on http://localhost:9090.

Configuring the vehicle value oracle

In order to use the car value oracle to obtain actual vehicle values from Edmunds you must:

  1. Obtain an Edmunds api key and set the env variable. (Note: this step can be skipped, and the oracle service will then just callback with a hardcoded value.)
EDMUNDS_API_KEY
  1. Deploy the chain code with an init argument specifying the host address of the oracle service (including port)

  2. Configure the node app with the correct blockchain settings (in default.json).

  3. Run the app.js node app

npm install
node app.js
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].