A Hyperledger Fabric prototype as a solution to overcome the problems of traditional records management in hospital/medical system such as accesibility, transfer of records and control of one's own record.
Follow the instructions given in the link to install necessary tools and to configure the system: https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
Follow the instructions to successfully setup the hospital network.
- Clone / Download the repository
$ git clone https://github.com/Shubham-Girdhar/hyperledger-fabric-patient-data-management.git
-
Before starting with the network is set-up start the docker.
-
Run the following command to install the binaries and images.
$ curl -sSL https://bit.ly/2ysbOFE | bash -s
- Change the working directory to /fabric-samples/pdm-network
$ cd ../fabric-samples/pdm-network
- Use the following command to start the network, with 2 organization hospital1 and hospital2 with one peer each (peer0) and an Orderer node.
$ ./network.sh createChannel -ca -s couchdb
- Deploy the chaincode. Note: If default channel name is not used then the following command applies, else remove the channel arguments (-c) and run the command.
$ ./network.sh deployCC -ccn custom -ccp ../pdm-custom/chaincode-javascript -ccl javascript
This command will deploy a javascript chaincode on mychannel
- Use this command to bring the network down
$ ./network.sh down
Reguister the admins by excuting the regesisterHospital1Admin.js and regesisterHospital2Admin.js in th sdk directory
$ cd ..
$ cd sdk
$ node regesisterHospital1Admin.js
$ node regesisterHospital2Admin.js
Move to the client directory and execute the client.js
$ cd ..
$ cd client
$ node client.js
Change to the directory pdm
$ cd ..
$ cd pdm
Then excute the following commands
$ ng serve -o
Incase if any of the commands fail due to configurations or the network was not brought down properly use the following commands to clear the corrupted docker images and fix the issue.
- Stop the containers.
$docker stop $(docker ps -a -q)
- Remove the containers
$docker rm -f $(docker ps -aq)
- Remove all unused images not just dangling ones
$docker system prune -a
- Remove all unused local volumes
$docker volume prune
-
Restart the docker.
-
Once the docker is up ,open a new terminal and download the images. (same as Step 3 in Bring up the network section)
$ curl -sSL https://bit.ly/2ysbOFE | bash -s