This document is a quick start guide for deploying the blockchain network from the beginning, in which most settings use the default or example values. For more information about the configurations, see the subsequent sections.

Limits

  • You must register an account and activate Container Service.
  • The container cluster and the NAS file system must be in the same region. Make sure the selected region supports both the Kubernetes cluster and the NAS file system (intersection of both). For the list of regions that support the NAS file system, see Products > Storage & CDN > NAS > > File System List.
  • The usage of a file system only applies to the development and test phases of blockchain applications and solutions. For deployment in the production environment, contact us to further discuss specific business and technical needs and determine the most suitable method.

Step 1. Create a Kubernetes cluster

  1. Log on to the Container Service console.
  2. Under Kubernetes, click Clusters in the left-side navigation pane. Click Create Kubernetes Cluster in the upper-right corner.


  3. Configure the basic information for the cluster. In this example, complete the configurations as follows:
    • Enter the Cluster Name. For example, k8s-blockchain.
    • Select China East 1 (Hangzhou) as the Region.
    • Select China East 1 Zone B as the Zone.
    • Select Auto Create to create a Virtual Private Cloud (VPC) together with the Kubernetes cluster, or Use Existing to use an existing VPC.
    • Configure the Logon Password and Confirm Password.
    • Configure instance specifications and quantity. The blockchain network deployment is resource-intensive. Therefore, we recommend that you use the default configurations.
    • Select the Enable SSH access for Internet check box.
    • Click Create Cluster. Wait a few minutes until the cluster is successfully created.
  4. On the Cluster List page, click Manage at the right of the created cluster (k8s-blockchain).


  5. On the Basic Information page of the cluster, record the Master node SSH IP address, which is an Internet address.


  6. On the Node List page, record the IP addresses (intranet addresses) of the cluster nodes (both master nodes and worker nodes).


Step 2. Bind an EIP to a worker node

  1. Log on to the Elastic IP Address (EIP) console.
  2. Click Elastic IP Addresses in the left-side navigation pane. Click Create EIP.
  3. Select the Region in which the cluster k8s-blockchain resides. Complete the other configurations as per your needs. Click Buy Now.
  4. After activating the EIP, wait until the purchased EIP is displayed in the list and then click Bind at the right of the EIP.


  5. Select ECS Instance from the Instance Type drop-down list and select a worker node (the instance name begins with node). Then, click OK.
  6. After binding the EIP to the worker node, record the IP address of the purchased EIP on the Elastic IP Addresses page.

Step 3. Create a file system and add a mount point

  1. Log on to the NAS console.
  2. Select China East 1 (Hangzhou) in the region list and click Create File System.


  3. Complete the configurations in the displayed Create File System dialog box.


    • Region: Select China East 1 (Hangzhou). Select the region in which the container cluster resides.
    • Storage Type: In this example, select Capacity-type.
    • Protocol Type: Select NFS.
    • Zone: Select China East 1 Zone B. Different zones in the same region are interconnected.
    • Click OK.
  4. Click Click to go in the displayed dialog box.


  5. Configure the NAS storage package.


    • Storage Type: Select Capacity-Type.
    • Order Duration: In this example, select one month. Select the duration as per your needs.
    • Click Buy Now.
  6. If Use Existing is selected in the VPC field when you create the Kubernetes cluster, skip this step. If Auto Create is selected in the VPC field when you create the Kubernetes cluster, go to the VPC console. Change the VPC instance name to one that is easy to identify, for example, blockchain_huadong1.


  7. Click Add Mount Point at the right of the created file system. Complete the configurations in the displayed Add Mount Point dialog box.


    • Mount Point Type: Select VPC.
    • VPC: Select the VPC used when creating the container cluster.
    • VSwitch: Select the VSwitch used when creating the container cluster.
    • Permission Group: Select VPC default permission group (allow all).
    • Click OK.
  8. On the File System List page, click Manage at the right of the file system. Record the Mount Address on the File System Details page.


Step 4. Configure and deploy blockchain network

  1. Under Kubernetes, click Store > App Catalog in the left-side navigation pane. Click ack-hyperledger-fabric , and select the region.


  2. Select the cluster in which the blockchain network is to be deployed from the Clusters drop-down list and enter the Release Name.


  3. Click the Values tab. View or modify the corresponding deployment parameters.
    • sharedStorage: Create a file system and add a NAS file system mount address recorded in the mount point (required, otherwise the deployment fails).
    • dockerImageRegistry: Enter the container image repository address in the annotations as the value according to the region in which the blockchain network is to be deployed (inside or outside China).
    • externalAddress: Enter the EIP bound to the worker node to generate the connection profile.


  4. Click Deploy.
    Note If sharedStorage is not configured, the spec. NFS. error for server: required value error is reported during the deployment process. When the error occurs, you must delete the corresponding publication name and then enter the sharedStorage parameter values, and redeploy.
  5. Enter the cluster dashboard. Check the status of the pods related to the blockchain network. Wait until the statuses of all the pods become Running.


The Kubernetes service of the container dashboard also supports deploying the blockchain network by using Helm. For more information, see Configure and deploy blockchain network.

Step 5. Test blockchain network by using CLI

  1. On a master node of the Kubernetes cluster, run the following command to enter the CLI container.
    kubectl exec -it <fabricNetwork>-fabric-cli bash
  2. Run the following command to start the CLI test.
    ./cli-test.sh
  3. During the test, press any key to continue.
  4. If no errors occur during the test and the following words are displayed, it indicates that the test is successfully completed.
      ===================== Query on PEER4 on channel 'bankchannel' is successful ===================== 
      Press any key to continue...
      ===================== All GOOD, End-2-End execution completed =====================

Step 6. Access blockchain explorer

  1. Log on to the Container Service console.
  2. Under the Kubernetes, click Application > Services in the left-side navigation pane. Select the target cluster and namespace, find the <Network name>-explorer service and access external endpoint.

    You can also run the kubectl get svc command on the master node of the Kubernetes cluster, or log on to the Container Service console. Then, go to the Kubernetes clusters, and click Services in the left-side navigation pane. Then view the EXTERNAL-IP (external endpoint) of the <Network name>-explorer service.



  3. Access the external endpoint in the browser.


Step 7.  Delete blockchain network

  1. Under the Kubernetes, click Application > Helm in the left-side navigation pane. Select the cluster from the Clusters drop-down list. Click Delete at the right of the release name of the blockchain network.


  2. Click OK in the displayed dialog box.


Then, the environment preparations, configuration and deployment, test, and deletion of the blockchain network are complete. For further development and testing, you can repeat the steps of blockchain configuration and deployment, blockchain testing, and blockchain deletion. You can also customize the network environment according to product instructions as needed.