This project contains the web app that we will be spinnnig and connecting to the Hyperledger Fabric network deployed on Chainstack.
This is a two-part project:
The contract is a sample JavaScript chaincode with 3 transactions:
optIn
optOut
querySSN
For details, see the chaincode tutorial.
- Linux or macOS
- Node.js 12.13.1 or higher
- NPM 6 or higher
From the project root directory, download the Hyperledger Fabric peer binaries by running:
- Linux
bash downloadPeerBinary.sh linux
- macOS
bash downloadPeerBinary.sh
Note that downloading the binaries will take some time.
In the webapp/server/.env
file, replace the ORDERER_NAME
, PEER_NAME
, and MSP_ID
variables with:
ORDERER_NAME
— the orderer name of the network you deployed your peer in. To access the orderer name, in the Chainstack platform, from Hyperledger Fabric network, select Service nodes tab and click on Orderer to access its details page. On the details page, copy the Orderer name value.PEER_NAME
— the name of the peer that you deployed. To access the peer name, in the Chainstack platform, from Hyperledger Fabric network, select Peer nodes tab, click on your peer name to access its details page. On the details page, copy the Peer name value.MSP_ID
— the Membership Service Provider identity (MSP ID). To access the MSP ID, in the Chainstack platform, from Hyperledger Fabric network, click Details link to open network details modal. On the details modal, copy the MSP ID value.
You are now ready for the bootcamp.
Additionally, you may want to prepare the web app client and server in advance—although this is not required, as this will be done during the bootcamp.
-
Export the required files from Chainstack platform.
-
Set up the web app client:
cd webapp/client npm i npm run build
-
Set up the web app server:
cd webapp/server npm i npm start
If you have any difficulties or have questions, talk to us on Gitter.
See also the web app tutorial.