Fablo is a tool that allows to setup a running Hyperledger Fabric network on the basis of a config file.
The main flow of the application is presented in the diagram below (for instance for the up command):
sequenceDiagram
actor User
User ->> fablo.sh: Call `up` command
fablo.sh ->> fablo-target: Verify if network files<br/>are generated
alt no network files
fablo.sh ->> Fablo Docker: Generate network files
Fablo Docker ->> fablo-target: Generate network files from `fablo-config.json`<br>using EJS templates and oclif
end
fablo.sh ->> fablo-target: Call `up` command
There are three important layers in this flow:
fablo.sh- this is our CLI. It accepts user commands, does some validation, and forwards them either to Fablo Docker container or generated network scripts infablo-targetdirectory.- Fablo Docker - is a Docker image that contains the oclif CLI framework and EJS templates used to generate the network files. When Fablo Docker is running, it has mounted the
fablo-config.jsonfile from the host and thefablo-targetdirectory. fablo-targetis a directory which contains generated Hyperledger Fabric network files (config files, helper scripts, temporary network files).
Notable files and directories:
./src- source code for oclif commands and the EJS templates they use../fablo.sh- Fablo CLI script../Dockerfile,./docker-entrypoint.sh,fablo-build.sh- files that define and are used to build the Fablo Docker image.e2e-network- directory that contains integration tests written in Bash scripts. Their goal is to setup sample networks with Fablo and verify them.e2e- directory that contains integration tests for generating network target files. Tey are mostly Jest snapshot tests.samples- directory with sample Fablo config JSON and YAML files.
See also Contributing Guidelines, where you can find some more instructions how to run Fablo from source code and useful hints what needs to be done while working with the code.