Giter Site home page Giter Site logo

jwl1997 / is4302-hx-blockchain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theiansim/is4302-hx-blockchain

0.0 1.0 0.0 829 KB

Hx is a medical records Blockchain application built on top of the Linux foundation's Hyperledger Fabric and Composer and utilizing React and Java.

Java 43.96% HTML 1.34% CSS 8.11% JavaScript 46.59%

is4302-hx-blockchain's Introduction

Hx Blockchain Medical Record

About

Hx is a Blockchain-based medical records and archiving solution built on the permissioned Hyperledger Fabric blockchain framework to ensure security, privacy, provenance and immutability in the medical field. Hx was created as a project for IS4302 Blockchain and distributed ledger technologies and is built on Hyperledger Composer, React and Spring (Java backend).

Installation

Download the vagrant environment from https://github.com/suenchunhui/fabric-tutorial-vagrant. Ensure that ports 3001-3009 are mapped in the vagrantfile, if not, edit the vagrantfile to add the port mappings. Start vagrant with the command "vagrant up" in the directory with the vagrant file.

In the IDE available at "http://localhost:8181" (Username: "root" Password: "secret"), cd to ~/composer-playground and drop the hxblockchain.bna BNA file into the composer-playground folder. Then, use the console to copy the file into the composer-playground/mnt folder with the command "sudo cp hxblockchain.bna mnt"

run "./playground.sh -f docker-compose-deploy.yaml up"

Copy and paste the following commands to create a new admin: docker exec -it ca.org1.example.com fabric-ca-client enroll -M registrar -u http://admin:adminpw@localhost:7054

docker exec -it ca.org1.example.com fabric-ca-client register -M registrar -u http://localhost:7054 --id.name kenneth --id.affiliation org1 --id.attrs '"hf.Registrar.Roles=client"' --id.type user

Enter the CLI container using: docker exec -it cli bash

Using the password for the newly registered admin, deploy the network BNA using: composer network deploy --archiveFile /mnt/hxblockchain.bna -A kenneth -c PeerAdmin@hlfv1 -S

Import the created admin card using: composer card import -f [email protected]

Create a new terminal in the IDE and cd to composer-playground.Start the admin rest server with: ./start_rest_server.sh -i 1 -p 3001 -c kenneth@is4302-hx-network

In the java project, cd to the folder with pom.xml, run the project with "mvn spring-boot:run". Maven is required to run the back-end. When "Application started successfully!"appears, the server has created some static data in the blockchain and is running at http://localhost:9191

In the CLI container, run the following commands to create the identity cards of the users.

  • composer identity issue -c kenneth@is4302-hx-network -u PATIENT001 -a org.acme.model.Patient#PATIENT001
  • composer card import -f [email protected]
  • composer identity issue -c kenneth@is4302-hx-network -u PATIENT002 -a org.acme.model.Patient#PATIENT002
  • composer card import -f [email protected]
  • composer identity issue -c kenneth@is4302-hx-network -u DOCTOR001 -a org.acme.model.Practitioner#DOCTOR001
  • composer card import -f [email protected]
  • composer identity issue -c kenneth@is4302-hx-network -u EM001 -a org.acme.model.Employer#EM001
  • composer card import -f [email protected]
  • composer identity issue -c kenneth@is4302-hx-network -u PHARM001 -a org.acme.model.Pharmacy#PHARM001
  • composer card import -f [email protected]
  • composer identity issue -c kenneth@is4302-hx-network -u DOCTOR002 -a org.acme.model.Practitioner#DOCTOR002
  • composer card import -f [email protected]

In the terminal in composer-playground, run the following commands to start the rest server for each user identity.

  • ./start_rest_server.sh -i 2 -p 3002 -c PATIENT001@is4302-hx-network
  • ./start_rest_server.sh -i 3 -p 3003 -c PHARM001@is4302-hx-network
  • ./start_rest_server.sh -i 4 -p 3004 -c DOCTOR001@is4302-hx-network
  • ./start_rest_server.sh -i 6 -p 3006 -c EM001@is4302-hx-network
  • ./start_rest_server.sh -i 7 -p 3007 -c PATIENT002@is4302-hx-network
  • ./start_rest_server.sh -i 8 -p 3008 -c DOCTOR002@is4302-hx-network

In a new terminal in your host OS, start the front end server by going into the Hx-Blockchain-Frontend folder, then run "npm install" then "npm run build", followed by "npm start".

The HxBlockchain application can be accessed at http://localhost:3010

Usernames:

  • Doctor001
  • Doctor002
  • patient001
  • patient002
  • pharm001
  • emp001

Password is "pp" for all users.

is4302-hx-blockchain's People

Contributors

theiansim avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.