Setting up a DLT/Blockchain network¶
To create a Production DLT/Blockchain network, ensure you have the following:
- One running Kubernetes Cluster and the Config file (kubeconfig.yaml) per Organization.
- One running Hashicorp Vault server per Organization. Unsealed and configured as per guidance here.
- Domain Name(s) configured as per guidance here.
- Private key file per Organization for GitOps with write-access to the Git repo as per guidance here.
- Git user details per Organization as per pre-requisites.
- Ansible controller configured as per guidance here.
NOTE: All commands are executed from the
blockchain-automation-framework directory which is the default directory created when you clone our Git repo.
Prepare build folder¶
If not already done, clone the git repository on your Ansible controller.
git clone https://github.com/<your username>/blockchain-automation-framework.git
Create a folder called
cd blockchain-automation-framework mkdir build
Copy the following files inside
- All the Kubernetes config files (kubeconfig.yaml).
- All the private key files.
Edit the configuration file¶
Depending on your choice of DLT/Blockchain Platform, select a network.yaml and copy it to
# 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.
Platform-specific configuration files¶
In summary, you will need to update the following:
dockerurl, username and password.
external_url_suffixdepending on your Domain Name(s).
- All DNS addresses depending on your Domain Name(s).
k8ssection depending on your Kubernetes zone/cluster name/config filepath.
gitopssection depending on your git username, tokens and private key filepath.
Executing provisioning script¶
After all the configurations are updated in the
network.yaml, execute the following to create the DLT network
# Run the provisioning scripts ansible-playbook platforms/shared/configuration/site.yaml -e "@./build/network.yaml"
site.yaml playbook, in turn calls various playbooks depending on the configuration file and sets up your DLT/Blockchain network.
Verify successful configuration of DLT/Blockchain network¶
To verify if the network is successfully configured or not check if all the kubernetes pods are up and running or not. Below are some commands to check the pod’s status:
Kubectl get pods --all-namespaces: To get list of all the pods and their status across all the namespaces. It will look as below -
Kubectl get pods -n xxxxx: To check status of pods of a single namespace mentioned in place of xxxxx. Example
Kubectl logs -f <PODNAME> -n <NAMESPACE>: To check logs of a pod by giving required pod name and namespace in the command. Example-
For a successful setup of DLT Network all the pods should be in running state.
Deleting an existing DLT/Blockchain 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:
ansible-playbook platforms/shared/configuration/site.yaml -e "@./build/network.yaml" -e "reset=true"