bityoga / fabric_as_code

Easily Configurable and Customisable Hyperledger Fabric Cloud Deployment Toolkit
Apache License 2.0
4 stars 2 forks source link
blockchain blockchain-network blockchain-platform cloud docker-swarm hlf hlf-cluster hyperledger-fabric hyperledger-fabric-network

Fabric as Code

The current project enables provisioning of Hyperledger Fabric (HLF) [https://www.hyperledger.org/projects/fabric] cluster over a host of machines managed by Docker Swarm [https://docs.docker.com/engine/swarm/].

It offers an easily configurable mechanism for creating custom Hyperledger Fabric Blockchain deployment arcitecture.

Current Blockchain as a Service offerings from IBM, Amazon, Microsoft or others tie you and your consortium to their infrastructure and ecosystem. The presented solution is cloud agnostic and can be deployed over any cloud provider or private data centers. Each organization that part of your blockchain can therefore choose their own infrastructure provider and by using the fabric-as-code solution can seamlessly deply a Hyperledger Fabric Blockchain.

Currently it support the spinning up of HLF cluster for just one organization, however, we are worrking towards mechanism for easily adding new organization to an exisiting cluster.

Please see the Overview and TODO sections bellow

Overview

Todo

Pre-requisites:

ansible 2.9.1
config file = /Users/antorweep/Documents/dev/mysome_glusterfs/ansible.cfg
configured module search path = ['/Users/antorweep/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.7.4 (default, Jul  9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)]

ansible-semaphore Setup Instructions:

These instructions is to be used only when utilising ansible-semaphore for deployment.

Refer : ansible-semaphore-setup-instructions

For normal deployment process, ignore this and follow the instructions below.

Configuration

There are very few parameters to be configured currently. All configurations are made inside _groupvars/all.yml.

Defining the remote host machines

In order to set up hlf cluster we would need a set of host machines. Ansible will comunicate with these machines and setup your cluster.

Configuring connection to remote machine

[all:children]
swarm_manager_prime
swarm_managers
swarm_workers

[swarm_manager_prime]

[swarm_managers]

[swarm_workers]

hostname ansible_host=remote.machine1.ip.adress ansible_python_interpreter="/usr/bin/python3"

[all:children]
swarm_manager_prime
swarm_managers
swarm_workers

[swarm_manager_prime]
hlf0 ansible_host=147.182.121.59 ansible_python_interpreter=/usr/bin/python3

[swarm_managers]
hlf0 ansible_host=147.182.121.59 ansible_python_interpreter=/usr/bin/python3
hlf1 ansible_host=117.247.73.159 ansible_python_interpreter=/usr/bin/python3

[swarm_workers]
hlf2 ansible_host=157.245.79.195 ansible_python_interpreter=/usr/bin/python3
hlf3 ansible_host=157.78.79.201 ansible_python_interpreter=/usr/bin/python3
hlf4 ansible_host=157.190.65.188 ansible_python_interpreter=/usr/bin/python3

Setting up HLF

Setting up of hyperledger fabric cluster requires the following steps. Creating the infrastructure with all dependencies installed and starting the hlf services in all the host machines. Finally, there is also mounting the glusterfs point.

Sample Bank App Deployment

a) Deploying Demo Bank App Chaindode

b) Deploying Demo Bank App Application

RESTful API Deployment