Welcome to Docker Fabric Wizard, a tool designed to simplify the automated installation of Hyperledger Fabric using Docker containers. This tool is aimed at professionals and students interested in blockchain technology.
Warning This project is under development, however you can use it to build your Hyperledger Fabric network from scratch. It is also not an official Hyperledger Fabric tool.
- Overview
- Prerequisites
- Installation
- Usage
- Chaincode Deploy
- Screenshots
- Contributing
- Development Status
- License
Docker Fabric Wizard streamlines the process of setting up a Hyperledger Fabric network by utilizing Docker containers. It offers an automated installation process based on user-provided network structure details. The tool generates and configures the necessary Docker containers, allowing you to quickly deploy a Hyperledger Fabric network for development, testing, or educational purposes.
Before you begin, make sure you have the following prerequisites:
- Linux OS (don't use Windows/WSL2 - if your OS is Micro$oft Window$, install and use any VM manager, like VirtualBox or Vagrant)
- Docker
- Python (version 3.10 minimal).
- Git (sure!)
- Basic understanding of Docker and Hyperledger Fabric concepts.
-
Clone this repository to your local machine:
git clone https://github.com/hectordufau/dockerfabricwizard.git cd dockerfabricwizard
-
Install the required dependencies using pip:
pip install -r requirements.txt
-
Navigate to the project directory.
-
Run the script by executing the following command:
python main.py
-
Follow the prompts to provide the necessary network structure details.
-
The Docker Fabric Wizard will generate and configure Docker containers based on your inputs.
-
Once the installation is complete, you will have a Hyperledger Fabric network up and running within Docker containers.
-
If you only want build config files (docker composer and HLF config files), just copy all files and folders inside
domain/<domainname>
folder and use them for your own
-
Put your whole chaincode code folder inside chaincodes folder (dockerfilewizard/chaincodes). You can use Asset Transfer Basic Typescript or Java for testing.
-
Your chaincode folder must to have a Dockerfile file inside.
-
Your chaincode must to have the following environment variables references which will receive values when external chaincode container runs:
- CC_SERVER_PORT
- CORE_CHAINCODE_ID_NAME
- CHAINCODE_SERVER_ADDRESS
-
Select an existing network (Main menu - option "S"). This network need to be started before.
-
Select a network - options by numbers.
-
Select "Add chaincode" (option "A")
-
If your chaincode folder was inside chaincodes, you see its name with a number as option. Select it.
-
Set other chaincode definitions like if it need to invoke an initial function, name of initial function and connection port.
-
Watch the magic happens...
-
Enable non-root user access
sudo groupadd -f docker sudo usermod -aG docker $USER newgrp docker sudo chown root:docker /var/run/docker.sock sudo chown -R "$USER":"$USER" $HOME/.docker sudo chmod -R g+rw "$HOME/.docker"
-
Edit docker service file
sudo nano /usr/lib/systemd/system/docker.service
-
Append the following lines to the bottom of the Service section:
[Service] ... SupplementaryGroups=docker ExecStartPost=/bin/chmod 666 /var/run/docker.sock
-
Restart Docker Engine
sudo service docker restart
Main Menu |
New Network |
Adding a new organization |
New organization added |
Adding a new peer |
New peer added |
Select a chaincode |
Chaincode deployed |
FireFly Dashboard |
FireFly API |
Thanks to Lazydocker.
Contributions are welcome! If you have any improvements, bug fixes, or new features to propose, feel free to open an issue or submit a pull request. Please make sure to follow the existing coding style and conventions.
Would you like to contribute with a donation?
- Remove chaincode
- Improving FireFly (reviews & adjustments)
- Main menu
- Questions
- Config files folder structure
- Building network CAs (fabric-ca)
- Identities
- Enrolling CA admin
- Orderer and Peers registering
- Certificates and MSP
- Building Orderer
- Building Peers
- Building CouchDBs
- Volumes
- Starting network containers
- Genesis block
- Channel
- Orderer and Peers channel joining
- Selected network menu options
- Network status
- Start network
- Stop network
- Clean docker
- Delete network configs
- Add organization
- Add peer
- Restore network from config file
- Chaincode as a Service installer (external chaincode - without TLS)
- Typescript chaincode
- Java chaincode
- Go chaincode
- Set external chaincode invoke initial function name
- Set external chaincode port use
- Reinstall chaincode
- Code Improving and Refactoring
- FireFly
- Connection Profile
- Fabconnect API
- Shared Storage
- Data Exchange
- Database
- Core
This project is licensed under the MIT License.