- Go to
utils/docker
and build the development container withmake build-dev
- Run the development container with
make run-dev
- Compile the chaincodes and clients by running
make
on the following folderscc/public
cc/private
clients/api
clients/ipfs_client
clients/violation_producer
- Run
export FPC_PATH=$(pwd)
on the top level folder. - In
cc/public/details.env
add the prefixPUBLIC
to all the variables (make sure you have the correct permissions to do that).
The next steps could be run in virtual terminals so they can survive a disconnect.
To start the network
- Add the environmental variables of the ccs by running
source
oncc/public/details.env
andcc/private/details.env
$FPC_PATH/samples/deployment/fabric-smart-client/the-simple-testing-network/env.sh Org1
to get credentials for the gateway- In
samples/deployment/fabric-smart-client/the-simple-testing-network
runmake run
.
To run the API
- On another terminal do step 6 and then also source the
Org1.env
file created in step 7. - Run
clients/api/api
To run the IPFS client
- On another terminal do step 6 and then also source the
Org1.env
file created in step 7. - Start IPFS by running
docker compose up -d
in theclients/ipfs_client
folder. - Run
clients/ipfs_client/ipfsclient
To test the deployment, you will need to have Postman (or a similar tool) installed to interact with the API. A Postman collection is found on the postman
folder.
The flow that needs to be followed is the following:
- Login as provider-user with the mnemonic created during api startup
- Create a new SLA, with examples from
test/slas
(Only Incident Resolution and Incident Response currently supported) - Approve given SLA
- Logout
- Login as client-user
- Approve SLA
- Now data from IPFS can start flowing in and violations to happen.
You can put data on IPFS using the producer
found in clients/violation_producer
.
When finished working with the network the following processes need to be stopped (mostly a Ctrl+C would suffice):
- IPFS: With
docker compose down
in theclients/ipfs_client
folder. - The ipfs_client
- The api
- The whole Hyperledger Fabric network