Skip to content

DLT Blockchain Network deployment using Docker

Important

Hyperledger Bevel is targeted for Production systems, but for quick developer deployments, you can use the containerized Ansible controller to deploy the dev DLT/Blockchain network.

Pre-requisites

Follow instructions to install and configure common pre-requisites. In summary, you should have details of the following:

  1. A machine (aka host machine) on which you can run docker commands i.e. which has docker command line installed and is connected to a docker daemon.
  2. At least one Kubernetes cluster (with connectivity to the host machine).
  3. At least one Hashicorp Vault server (with connectivity to the host machine).
  4. Read-write access to the Git repo (either ssh private key or https access token).

Prepare build folder

Clone the git repository on host machine, call this the project folder.

git clone https://github.com/<your username>/bevel
Create a folder called build inside bevel.
cd bevel
mkdir build
Copy the following files into the build folder:

  • The Kubernetes config file for your cluster (config).
  • The private key file (gitops, if using SSH for git).

Edit the configuration file

Depending on your chosen DLT platform, select a sample network.yaml (e.g. For Fabric, choose from this sample) and copy to build folder.

# eg for Fabric
cp platforms/hyperledger-fabric/configuration/samples/network-fabricv2.yaml build/network.yaml

Open and update the network.yaml according to the following Platform specific guides.

In summary, you will need to update the following:

  1. docker url, username and password.
  2. external_url_suffix depending on your Domain Name(s).
  3. All DNS addresses depending on your Domain Name(s).
  4. cloud_provider
  5. k8s section depending on your Kubernetes zone/cluster name/config filepath.
  6. vault
  7. gitops section depending on your git username, tokens and private key filepath.

Now, the build folder should have the following files:

  • K8s config file as config.
  • Network specific configuration file as network.yaml.
  • If using SSH for Gitops, private key file which has write-access to the git repo.

Screen shot of the folder structure is below:

Execute provisioning script

Run the following command to run the provisioning scripts, the command needs to be run from the bevel folder. The command also binds and mounts a volume, in this case it binds the repository

cd bevel

docker run -it -v $(pwd):/home/bevel/ --network="host" ghcr.io/hyperledger/bevel-build:latest

# For Corda use jdk8 version
docker run -it -v $(pwd):/home/bevel/ --network="host" ghcr.io/hyperledger/bevel-build:jdk8-latest

In case you have failures and need to debug, login to the bash shell

docker run -it -v $(pwd):/home/bevel/ --network="host" ghcr.io/hyperledger/bevel-build:latest bash

# go to bevel directory
cd bevel
# Run the provisioning scripts
ansible-playbook  platforms/shared/configuration/site.yaml -e "@./build/network.yaml" 

Verify successful configuration

For instructions on how to verify or troubleshoot network, read How to debug a Bevel deployment.

Deleting an existing network

The above mentioned playbook site.yaml (ReadMe) can be run to reset the network using the network configuration file having the specifications which was used to setup the network using the following command:

docker run -it -v $(pwd):/home/bevel/ --network="host" ghcr.io/hyperledger/bevel-build:latest bash
cd bevel
ansible-playbook platforms/shared/configuration/site.yaml -e "@./build/network.yaml" -e "reset=true"