You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Composer 0.19.0:Playground网络更新:非Deploy changes方式及仅更新容器内网络

Hey there, let's break down your two questions about Hyperledger Composer Playground and container management step by step!

1. Alternative ways to update your network in Playground (without clicking "Deploy changes")

In the Composer Playground UI, the "Deploy changes" button is the go-to built-in option for pushing updates after modifying your network files directly in the editor. But if you're looking for an alternative within Playground itself, here's what you can do:

  • Export and re-import your updated network:
    1. If you made changes right in Playground's Define tab, click the "Export" button to download a BNA file of your modified network.
    2. Head back to the "My Business Networks" page.
    3. Locate your existing network, click the three-dot menu next to it, and select "Update".
    4. Upload the BNA file you just exported (or a locally packaged BNA if you made changes outside Playground) and follow the prompts to complete the update.

This approach skips the "Deploy changes" button but achieves the same result of updating your network.

2. How to update the network inside an existing container (Composer 0.19.0)

The behavior you're seeing—new Docker images and containers being created every time you click "Deploy changes"—is a known quirk in Composer 0.19.0. The Playground's deploy flow in this version doesn't perform a chaincode upgrade; instead, it deploys an entirely new instance of your business network as a separate chaincode. Each new deployment spins up a fresh container, and old ones aren't automatically cleaned up, leading to the backlog you're dealing with.

Here are two solutions to fix this:

This method updates the existing chaincode instance without spinning up new containers:

  1. Package your updated network: Navigate to your network project directory in the terminal and run:
    composer archive create -t dir -n .
    
    This generates a BNA file (e.g., my-network@0.0.1.bna) containing your modified files.
  2. Upgrade the deployed network: Run the upgrade command, replacing the placeholders with your specific details:
    composer network upgrade -c admin@<your-network-name> -a <path-to-your-updated.bna>
    
    This will update the chaincode running in your existing container, no new containers will be created.

Option 2: Clean up old containers manually

If you already have a pile of unused Composer containers cluttering your Docker environment, you can prune them with these commands:

  • Stop all Composer-related containers:
    docker stop $(docker ps -a | grep composer | awk '{print $1}')
    
  • Delete the stopped containers:
    docker rm $(docker ps -a | grep composer | awk '{print $1}')
    
  • To free up additional space, you can also remove unused Composer images:
    docker rmi $(docker images | grep composer | awk '{print $3}')
    
    Note: Be cautious with these commands—they will remove all Composer-related containers and images, so ensure you don't need any of them before executing.

内容的提问来源于stack exchange,提问作者T_murder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:04:21