Client side

As for the backend, we'll use bitcore in the client side, therefore we need to install the frontend component. For that, create a bower.json file in the views/ folder with the following content:

{  "dependencies": {    "bitcore-lib": "^0.15.0",    "bitcore-payment-protocol": "1.2.2"  }}

Then run the following command (inside the views/ folder):

bower install   

Next, we need to install a QR code library in the views/ directory:

git clone https://github.com/davidshimjs/qrcodejs 

Then create two files – index.html and main.js – in the views/ directory. In the first of these files, paste the following code:

<html><head>  <script src="bower_components/bitcore-lib/bitcore-lib.js"></script> <script src="bower_components/bitcore-payment-protocol/bitcore-payment-protocol.min.js"> ...

Get Blockchain By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.