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.
- 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 .
- 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
- Log on to the Container Service console.
- Under Kubernetes, click Clusters in the left-side navigation pane. Click Create Kubernetes Cluster in the upper-right corner.
- 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.
- On the Cluster List page, click Manage at the right of the created cluster (k8s-blockchain).
- On the Basic Information page of the cluster, record the Master node SSH IP address, which is an Internet address.
- 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
- Log on to the Elastic IP Address (EIP) console.
- Click Elastic IP Addresses in the left-side navigation pane. Click Create EIP.
- Select the Region in which the cluster k8s-blockchain resides. Complete the other configurations as per your needs. Click Buy Now.
- After activating the EIP, wait until the purchased EIP is displayed in the list and then click Bind at the right of the EIP.
- Select ECS Instance from the Instance Type drop-down list and select a worker node (the instance name begins with node). Then, click OK.
- 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
- Log on to the NAS console.
- Select China East 1 (Hangzhou) in the region list and click Create File System.
- 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.
- Click Click to go in the displayed dialog box.
- 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.
- 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.
- 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.
- 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
- Under Kubernetes, click ack-hyperledger-fabric , and select the region.
in the left-side navigation pane. Click
- Select the cluster in which the blockchain network is to be deployed from the Clusters drop-down list and enter the Release Name.
- 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.
- 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.
- 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
- On a master node of the Kubernetes cluster, run the following command to enter the CLI container.
kubectl exec -it <fabricNetwork>-fabric-cli bash
- Run the following command to start the CLI test.
- During the test, press any key to continue.
- 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
- Log on to the Container Service console.
- Under the Kubernetes, click
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.
in the left-side navigation pane. Select the target cluster and namespace, find the <Network name>-explorer service and access external endpoint.
- Access the external endpoint in the browser.
Step 7. Delete blockchain network
- Under the Kubernetes, click Delete at the right of the release name of the blockchain network. in the left-side navigation pane. Select the cluster from the Clusters drop-down list. Click
- 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.