Home

Awesome

Install:

Install the dependencies:

Run the following command from your terminal:

curl -fsSL https://raw.githubusercontent.com/Kunstmaan/hyperledger-fabric-network-setup/master/scripts/install.sh?token=AG6ftlJwD7jEr7kZph_QEsqncTTeroBFks5aZc1pwA%3D%3D | bash

This repo depends on the fact that the chaincode repo you want to deploy has at least the chaincodes configuration in your package.json https://github.com/Kunstmaan/hyperledger-fabric-chaincode-dev-setup#initializing-new-project

Commands

With the following command you can get an overview of all the commands available:

kuma-hf-network -h

Boostrap a default network configuration

When you want to create a new network configuration, you can initialize a new network with the following command:

kuma-hf-network boostrap .

This will create a default aws configuration and network configuration at the provided path and generate all the artifacts based on this configuration.

Generate certificates, docker files, channel artifacts

kuma-hf-network generate <crypto_config>

Generates all the artifacts needed to bring the network up and configure the channels based on the provided crypto_config.

Generate a new user for a certain organisation

kuma-hf-network generate-user <name> <org> <crypto_config>

Generate al the crytographic material for a new user belonging to a certain organisation.

Generates all the artifacts needed to bring the network up and configure the channels based on the provided crypto_config.

Bring the network UP

kuma-hf-network network-up <crypto_config> <aws_config>

Create all the aws instances as provided in the aws_config and bring up all the fabric instances using the cryptographic material generated with the crypto_config. This will also output scripts for updating the hosts file with the DNS linking to the ip addresses on aws.

Bring the network DOWN

kuma-hf-network network-down <aws_config>

Bring the network back down.

Update the chaincodes on the current network

kuma-hf-network update-chaincodes

Upgrade the chaincodes on the network based on the version in the package.json of each chaincode. This script depends on the chaincodes being generated with the hyperledger-fabric-chaincode-dev-setup and the version inside the package.json will be used to see if a certain chaincode needs to be updated or not.

Update the current tool

kuma-hf-network update

Update the script to the latest version.

AWS Configuration

In the back we are using the aws cli utility, make sure this is configured correctly by running aws configure. And setting the following environment variables:

More information can be found here: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

Configuring your AWS EC2 Instances

First you need to configure your AWS account, make sure a VPC is created with a keypair to access it, it's own subnet and security-group. A detailed tutorial can be found here. When this is all configured you can start modifying the configuration file so that this script can bring the network up. Configuring the network can be done via the aws configuration file. This is the configuration file you need to provide when running kuma-hf-network network-up.

EC2 Instance configuration

You can create as many of ec2 instances as you want, for every instance you need to configure the following things:

An overview of the indiviual scripts:


Environment variables description:


The shared folder is shared to all hyperledger tools (CLI) docker containers. It will also be synced to all aws nodes

The shared/chaincode_tools/ folder contains code intended to run on the tools docker containers

Structure of the generated folder

This folder is created by running scripts/hyperledgerNetworkTool.py gen

It contains 6 folders (the sixth is generated when booting the network):

Cryptographic materials


Certificate settings

Signature Algorithm must be ecdsa-with-SHA1

The settings are given in the form CA - TLS

PropertyRootInterOrgPeerUser
X509v3 Key Usage
--- Digital SignatureV - VV - VV - VV - VV - V
--- Key EnciphermentV - VV - VV - VX - VX - V
--- CRL SignV - VV - VV - VX - XX - X
--- Certificate SignV - VV - VV - VX - XX - X
X509v3 Basic Constraints
--- CA:TRUEV - VV - VV - VX - XX - X
--- CA:FALSEX - XX - XX - XV - VV - V
X509v3 Authority Key IdentifierX - XV - VV - VV - VV - V
X509v3 Subject Key IdentifierV - VV - VV - VV - VV - V
X509v3 Extended Key Usage
--- TLS Web Server AuthenticationX - XX - XX - VX - VX - V
--- TLS Web Client AuthenticationX - XX - XX - VX - VX - V
--- 2.5.29.37.0V - VV - VV - XX - XX - X

AWS Configuration

Roadmap