The client application is based on Node.js. We use an expressjs REST API to interact with the ledger and provide a public react frontend.
First install the required node_modules.
# make sure you are in the backend folder
pwd
# > /root/fabric/fabricStarterKit/backend
# have a look into the package.json file if you are interested
npm install
The client application needs a user to interact with the ledger. We can use [email protected] which was created during the boot process.
The second step is to add this user to the clients local filesystem wallet. We can do that with the following command.
node cli/addToWallet.js
# > done
# check the wallet
tree wallet
# you should see the following output
wallet
└── [email protected]
# feel free to inspect that file
cat wallet/[email protected] | jq .
We can install some global and common helper tools.
npm install nodemon mocha -g
We need another tmux panel.
Create a new panel horizontally
CTRL + b " (double-quots)
Start expressjs.
nodemon start index.js
We need another tmux panel.
Create a new panel horizontally
CTRL + b " (double-quots)
# call a specific test with mocha
# possible values ['api','setData','getData','delAsset','getAllAssets','getHistory']
mocha -g "getAllAssets" cli/commands.js