This repo contains example applications to demotrate fabric avalon in action
To run the test applications, docker 18.03 or newer and git are required.
curl -o ~/.local/bin/minifab -L https://tinyurl.com/twrt8zv && chmod +x ~/.local/bin/minifab
Minifabric is a tool to deploy fabric network in docker environment
git clone https://github.com/litong01/avalonapps.git
cd avalonapps && minifab up
This process will take awhile if this is the first time you are setting up a fabric network.
To shutdown the fabric network and restart the whole process, do the following:
minifab down && minifab up
To remove everything including the fabric network, do the following:
minifab cleanup
./getandinstall.sh
minifab install,approve,commit -n worker
You can install, approve and commit other Avalon chaincode by using different chaincode name with the same command.
Two applications were developed to test the go chaincode and connector python code. The program named consumer.py in apps directory is the program to listen to fabric events. The program named producer.py in apps was developed to submit transactions and query against fabric blockchain network.
./run.sh
This command starts a container which uses a container image includes Python 3.8, Hyperledger fabric python sdk and Fabric Avalon python connector.
docker exec -it avalon bash
cd /pysrc
python consumer.py 500
The above command runs the Avalon event listener and wait for workerRegister event. It will wait for 500 seconds, then quit. If you wish to listen for a shorter or longer period, you can change the value to your desired value. When there are workerRegistered events produced on Fabric network, this app will show the events.
docker exec -it avalon bash
cd /pysrc
python producer.py worker workerRegister
This command will register a new worker and produce one workerRegistered event.
Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.