After you complete the development and testing activities, clean up the blockchain environment if the deployed blockchain network is no longer in use or you must redeploy the blockchain network.
Delete blockchain network in Container Service console
- Log on to the Container Service console.
- Under Kubernetes, click Delete at the right of the release name of the blockchain network. . Select the cluster from the Clusters drop-down list. Click
- Click OK in the displayed dialog box.
Use Helm to delete blockchain network
- Use SSH to log on to a master node of the Kubernetes cluster as the root account.
- Run the helm list command to view the Helm release name of the blockchain network.
- Execute the helm delete --purge <Helm release name of the blockchain network> command to delete the blockchain network. For example, helm delete --purge blockchain-network01.
Depending on the number of nodes on the blockchain network, wait for several minutes until the helm delete command is completed and the result is returned. So far, the services and containers corresponding to all nodes on the blockchain network have been deleted from the Kubernetes cluster. The chaincode containers related to the blockchain network are also automatically deleted from all worker nodes.
Data directory of blockchain network
When the blockchain network is deleted, the data directory of the blockchain network in the shared file storage is automatically cleaned up for recreating the blockchain network. For security reasons, the data directory is cleaned up by adding the suffix -deleted-timestamp to the original directory name. For example, -deleted-2018-03-17-160332. In this way, you can reuse the data by deleting the suffix. To completely delete the data directory, manually use the rm command or use the automated script to release storage space with regular cleanup.
mkdir /data mount -t nfs -o vers=4.0 987a6543bc-abc12.cn-hangzhou.nas.aliyuncs.com:/ /data #Replace with your NAS mount address