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

Hyperledger Composer部署位置、通道及背书策略等技术问题咨询

Answers to Your Hyperledger Composer BNA Deployment Questions

Hey there! Let's break down your questions step by step since you've successfully deployed your BNA but need clarity on those key details.

First: Confirming BNA ↔ Chaincode Relationship

You’re absolutely right! In Hyperledger Composer v0.19.0 and later, a Business Network Archive (BNA) is indeed packaged into a Fabric chaincode when deployed. This was a major shift to align Composer more closely with the underlying Fabric architecture, so your understanding is spot-on.

Finding Deployment Location & Associated Channel

1. Using Composer Commands (Easiest Way)

Run this command to get full details about your deployed network:

composer network list -n <your-bna-name> -c <your-connection-profile-name>

This will output:

  • The channel name your BNA is deployed to (if you didn’t specify a channel during deployment, the default is composerchannel)
  • The chaincode name (derived from your BNA name and version)
  • Peer nodes hosting the chaincode

2. Checking Fabric Peer Node Directly

If you want to see the physical deployment location (inside the peer container):

  • First, exec into your peer container:
    docker exec -it <peer-container-name> bash
    
  • Navigate to the chaincode storage directory:
    cd /var/hyperledger/production/chaincodes/
    

You’ll see a .tar.gz file named like <your-bna-name>-<version>.tar.gz — that’s your packaged BNA/chaincode.

Setting Up Endorsement Policies

Endorsement policies define which peers must sign a transaction before it’s committed to the ledger. You can set this either during deployment or update an existing deployment:

1. Set Policy During Deployment

Use the -E flag with composer network deploy to specify your policy. For example, to require endorsement from either Org1 or Org2 members:

composer network deploy -a your-network.bna -c PeerAdmin@hlfv1 -E "OR('Org1MSP.member','Org2MSP.member')"

The policy syntax follows standard Fabric chaincode endorsement rules — you can use AND, OR, and nested conditions to match your network’s needs.

2. Update Policy for an Existing Deployment

If you need to change the endorsement policy after deployment:

  1. First, create or update your connection profile (.json) to include the new policy under the chaincodeEndorsementPolicy field for your channel/chaincode.
  2. Then run the update command:
    composer network update -a your-network.bna -c PeerAdmin@hlfv1 -E "NEW_POLICY_HERE"
    
    Note: You’ll need to use the same BNA package or a newer version if you’re making other changes alongside the policy update.

Pro Tip

Always test your endorsement policies in a development environment first to ensure they align with your network’s governance rules — misconfigurations can lead to transaction failures.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.22 09:56:43