Hyperledger Fabric and Convector run on Linux, although it can be run on a Mac or Windows computer (using Windows Subsystem for Linux). Any production instance of the blockchain should be running on dedicated Linux servers.
You can follow the installation instructions in the Readme on the repository:
Install on Ubuntu 18
Here we provide detailed instruction for installation on Ubuntu 18 (.04 or .10 are fine). You can use any cloud provider, using a box with at least 2 GB of ram.
We tested the steps below on Digital Ocean using a 2 GB / 2 CPU Droplet. Our demo is running on a 4 GB / 2 CPU Droplet.
NOTE: Do not install Node using the root user. In the directions below we create a new user and install Node using nvm.
Step 0 – Connect to your Server
SSH into your server. On Digital Ocean, boxes default to log in with root using certificates. You can use Putty on Windows or the Terminal on Mac.
Step 1 – Make sure software is up to date
If you are logged in as root sudo will not require a password. If you are logged in with another user it may require a password to run.
sudo apt-get update sudo apt-get upgrade
Step 2 – Install Components Required for Hyperledger
sudo apt-get install curl git docker.io docker-compose golang python
Step 3 – Create User
We created a user called “blockchain” but you can feel free to rename it.
sudo useradd -m -d /home/blockchain blockchain
Step 4 – Start Docker
sudo usermod -a -G docker blockchain sudo systemctl start docker sudo systemctl enable docker
Step 5- Install Node and npm under blockchain user
cd changes directory so you are not in root’s directory. Then change to blockchain user. We then user bash to execute commands
sudo su blockchain cd bash curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh bash install_nvm.sh source ~/.profile nvm install 8.11.4 node -v
You should see v8.11.4 when running node -v.
Step 6 – Install Fabric as root
Type exit twice in order to exit the blockchain user session (once for bash and once for user shell)
exit exit curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.4.0
Step 7 – Change Back to Blockchain User
sudo su blockchain cd bash
Step 8 – Clone Repo
git clone https://github.com/instamed/healthcare-payments-blockchain.git cd healthcare-payments-blockchain
Step 9 – Install and Start the project
These will take awhile to run, especially npm start when it runs the first time.
npm install npm start
Step 10 – Run mock data
This step is required for our frontend demo app to work without modification. If you do not want this data, you can skip this step.
npm run mockData
Step 11 – Run the Server
When you run the server below, it will be running on port 8080. You can test the API by going to (yourIP):8080/api/organization. Replace (yourIP) with your IP address.
npm run server:start
Step 12 – Install Byzantine Browser
The Byzantine Browser runs a backend service and a frontend website that allows you to inspect the blocks. The demo app uses the backend service to query the block numbers.
You need to run the Byzantine Browser in a separate session. The easiest way is to open a second terminal, log in, and run the following:
sudo su blockchain cd bash
You should now have another session running as the blockchain user. Now run:
git clone https://github.com/worldsibu/byzantine-browser.git cd byzantine-browser npm install cd ui npm install npm run build cd ..
Step 13 – Set up Byzantine Browser
Copy the keys from the hyperledger-fabric-network directory. We’re assuming here you have installed the byzantine-browser in that same parent directory as the blockchain.
cp $HOME/hyperledger-fabric-network/.hfc-org1/* ./hfc-key-store
Replace the `.env` in the root of the Byzantine Browser folder (or create it if it doesn’t exist) with the information below.
USERID=user1 NETWORK_URL=grpc://localhost:7051 EVENT_URL=grpc://localhost:7052
Use your favorite text editor or use Nano
nano .env (copy text from above and right click to paste into terminal) control-O control-X
Step 14 – Run the Byzantine Server
Step 15 – Test the Demo App and API
Open a browser to (yourIP):8080 and you should see the demo app. Test creating a claim and ensure it works properly. It will not work if you skipped the mock data step above.
You can also open Fhir Financial.postman_collection.json in Postman and test out some API queries.
Step 16 – Rejoice!
Congratulations! You made it! Enjoy blockchaining!