Basic network for a Hyperledger Fabric project development.
- Hyperledger Fabric v2.2
- Hyperledger Fabric CA v1.5
- Docker v20.10
- Docker-Compose v2.14.0
- NodeJS / TypeScript v16.13.0
- npm v9.2.0
The Hyperledger Fabric network consists of:
- One orderer
- orderer.example.com
- One organization
- MSPID: Org1MSP
- Two peers:
- peer0.org1.example.com
- peer1.org1.example.com
- One CouchDB state database deployment for each peer
- Fabric CA
- ca.org1.example.com
- Fabric CLI
-
Install Hyperledger Fabric latest docker images and binaries.
./install-fabric.sh
this will generate a
fabric-samples
folder inside the project directory.Note: The
fabric-samples
folder is not needed, as we will only be using the downloaded Docker images to deploy the network -
Generate the network artifacts.
cd network-files ./generate.sh
-
Deploy the network.
./start.sh
-
Teardown the network
./teardown.sh
A Web Application is made available using Nest.js
cd webapp/
npm install
npm start
Transactions can be submitted via the web application. The Nest.js webapp supports both invokes and queries to the blockchain.
The application listens on localhost:3000
and has two endpoints:
-
body:
{ "function": "FunctionName", "args": ["list", "of", "arguments"] }
As mentioned before, this chaincode needs to be initialized in order to use it. Therefore, the Initialize
function can be called via POSTMAN.
Furthermore, an Invoke
can be made via POSTMAN to Mint some tokens