Skip to content

DockerFabric Wizard is a Hyperledger Fabric setup and installation network wizard running on Docker

License

Notifications You must be signed in to change notification settings

hectordufau/dockerfabricwizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Fabric Wizard

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.

Table of Contents

Overview

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.

Prerequisites

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.

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/hectordufau/dockerfabricwizard.git
    cd dockerfabricwizard
    
  2. Install the required dependencies using pip:

    pip install -r requirements.txt
    

Usage

  1. Navigate to the project directory.

  2. Run the script by executing the following command:

    python main.py
    
  3. Follow the prompts to provide the necessary network structure details.

  4. The Docker Fabric Wizard will generate and configure Docker containers based on your inputs.

  5. Once the installation is complete, you will have a Hyperledger Fabric network up and running within Docker containers.

  6. 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

How to deploy a chaincode (Chaincode as a Service - CCAAS)

  1. Put your whole chaincode code folder inside chaincodes folder (dockerfilewizard/chaincodes). You can use Asset Transfer Basic Typescript or Java for testing.

  2. Your chaincode folder must to have a Dockerfile file inside.

  3. 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
  1. Select an existing network (Main menu - option "S"). This network need to be started before.

  2. Select a network - options by numbers.

  3. Select "Add chaincode" (option "A")

  4. If your chaincode folder was inside chaincodes, you see its name with a number as option. Select it.

  5. Set other chaincode definitions like if it need to invoke an initial function, name of initial function and connection port.

  6. Watch the magic happens...

Fixing docker permissions

  1. 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"
    
  2. Edit docker service file

    sudo nano /usr/lib/systemd/system/docker.service
    
  3. Append the following lines to the bottom of the Service section:

    [Service]
    ...
    SupplementaryGroups=docker
    ExecStartPost=/bin/chmod 666 /var/run/docker.sock
    
    
  4. Restart Docker Engine

    sudo service docker restart
    

Screenshots

Main Menu
Main menu
New Network
New network
Adding a new organization
New organization
New organization added
New organization
Adding a new peer
New peer
New peer added
New peer
Select a chaincode
chaincode
Chaincode deployed
deployed
FireFly Dashboard
FireFly Dashboard
FireFly API
FireFly API

Thanks to Lazydocker.

Contributing

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?

Buy Me A Coffee

Development Status

Todo

  • Remove chaincode

In Progress

  • Improving FireFly (reviews & adjustments)

Done ✓

  • 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

License

This project is licensed under the MIT License.

About

DockerFabric Wizard is a Hyperledger Fabric setup and installation network wizard running on Docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages