This example uses the Open-source Flogo to implement a Hyperledger Fabric sample chaincode marbles02. The sample demonstrates basic features of the Hyperledger Fabric, including creeation and update of states and composite-keys, as well as different types of queries for state and history with pagination. The chaincode is extended to illustrate Attribute-Based Access Control (ABAC), and it is implemented visually by using Flogo Web UI.
Set up development environment by following the Getting Started instructions in README.md.
The Flogo model marble.json is the chaincode implementation. In a terminal console, type the command make
, which will perform the following steps:
- Build a deployable chaincode package marble_cc_1.0.tar.gz for the model file marble.json.
- Deploy the package and test scripts to the Fabric test-network that was installed during the prerequisite setup.
Execute following steps to start the Fabric test-network and invoke the marble_cc chaincode:
# start Fabric test-network
make start
# install marble_cc
make cc-init
# invoke transactions of marble_cc
make cc-test
After successful test, you may shutdown the Fabric test-network:
make shutdown
You can view and edit the chaincode implementation in a web-browser. First, start the Flogo Web UI:
docker run -it -p 3303:3303 yxuco/flogo-ui eula-accept
Open the Flogo Web UI in a web-browser by using the URL: http://localhost:3303
. Then import the app by selecting the model file marble.json.
For problems of importing the model, refer the troubleshoot instructions here.