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

执行./network.sh up createChannel命令出错:Hyperledger Fabric v2.2示例>test-network通道创建失败

Fixing ./network.sh up createChannel Error in Hyperledger Fabric v2.2 Test-Network

Hey there, let's troubleshoot this error you're facing when creating a channel with the Fabric v2.2 test-network. Since you've confirmed all binaries and module versions are up to spec, let's walk through the most common fixes and checks:

  • Verify Docker Container Health
    First, check if all required Fabric containers are running properly. Run this command:

    docker ps -a
    

    Look for containers like orderer.example.com, peer0.org1.example.com, peer0.org2.example.com, and cli. If any container has exited, pull its logs to pinpoint the issue:

    docker logs <container-name>
    

    A frequent culprit here is port conflicts (e.g., ports 7050/7051 being used by other processes). If that's the case, either kill the conflicting process or adjust port mappings in the test-network's docker-compose files.

  • Validate Channel Artifacts
    The network.sh script generates critical channel files in the channel-artifacts directory, including channel.tx and genesis.block. If these files are missing or corrupted, channel creation will fail.
    Regenerate these artifacts manually and retry:

    ./network.sh generate
    ./network.sh up createChannel
    

    Make sure the generate step completes without errors.

  • Debug with Direct CLI Commands
    The wrapper script can sometimes mask detailed error messages. Try creating the channel manually inside the CLI container to get a clearer picture:

    1. Enter the CLI container:
      docker exec -it cli bash
      
    2. Run the channel creation command directly:
      peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
      

    The output here will give you specific details about why the channel creation is failing (e.g., TLS certificate issues, connection timeouts to orderer).

  • Clean Up Residual Resources
    Old network artifacts, containers, or chaincode images can cause unexpected conflicts. Do a full cleanup before restarting:

    ./network.sh down
    rm -rf channel-artifacts organizations
    

    Then re-run the network setup command:

    ./network.sh up createChannel
    

    This ensures you're starting with a fresh state, eliminating any leftover issues from previous tests.

  • Check TLS Certificate Generation
    Fabric v2.2 uses TLS by default, so invalid or missing TLS certificates will break peer-orderer communication. Verify that certificates exist in the organizations directory:

    • For orderer: organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    • For peers: organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
      If certificates are missing, regenerate them manually:
    cryptogen generate --config=./organizations/cryptogen/crypto-config.yaml
    

    Then retry the network setup.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.01 00:22:50