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

尝试运行Hyperledger BYFN搭建首个网络时遭遇001错误求助

Hey there, let's work through those Hyperledger Fabric BYFN issues you're hitting—first that 001 error, then the channel creation failure. These are super common when you're starting out, so let's break it down step by step.

Troubleshooting Your BYFN Network Issues

First: Fixing the Initial 001 Error

That 001 error usually pops up because of leftover artifacts, mismatched dependencies, or incomplete image pulls. Let's tackle those first:

  • Wipe all old network data: If you've tried running BYFN before, old containers, volumes, or crypto files are probably conflicting. Run these commands to start fresh:
    ./byfn.sh down
    docker rm -f $(docker ps -aq)
    docker volume rm $(docker volume ls -q)
    docker network prune -f
    rm -rf crypto-config/ channel-artifacts/
    
  • Check your Docker versions: Fabric is picky about Docker and Docker Compose versions. Make sure you're running:
    • Docker 20.10.x or newer (verify with docker --version)
    • Docker Compose 1.29.x or newer (check with docker-compose --version)
      If they're out of date, update them before moving on.
  • Force-pull the required Fabric images: Sometimes the auto-pull in BYFN skips images or gets corrupted. Run this to make sure you have all the right ones:
    ./byfn.sh pull
    

Next: Fixing Channel Creation Failures

From the partial error log you shared, it looks like there's an issue with TLS certificate paths or truncated environment variables. Here's how to fix this:

  1. Regenerate crypto and channel artifacts: If your crypto-config or channel-artifacts folders are incomplete (or corrupted), regenerate them from scratch:
    ./byfn.sh generate
    
    Let this run all the way through—don't interrupt it halfway, that's a common cause of broken files.
  2. Verify TLS certificate paths exist: The error shows a truncated CORE_PEER_TLS_KEY_FILE path. Check that the full path points to a valid file. On your host, navigate to the crypto-config folder and run:
    ls crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/
    
    You should see ca.crt, server.crt, and server.key here. If any are missing, the generation step failed—rerun ./byfn.sh generate.
  3. Try creating the channel manually: Sometimes the BYFN script's auto-configured flags don't play nice. Run this command from the first-network directory to create the channel explicitly:
    export CHANNEL_NAME=mychannel
    peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -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
    
    This uses the full TLS certificate path for the orderer, which often fixes path-related errors.
  4. Dig into container logs for full error details: The truncated log you shared only tells part of the story. Check the orderer and peer logs to see the exact failure:
    docker logs orderer.example.com
    docker logs peer0.org1.example.com
    
    You'll find specifics here—like a certificate mismatch, connection timeout, or missing artifact file—that will point you straight to the fix.

Quick Pro Tips

  • Always run BYFN commands from the first-network directory—don't navigate away while the script is running.
  • If you're on Linux, make sure your user has Docker permissions: run sudo usermod -aG docker $USER, log out and back in, then try again.
  • Hold off on modifying the default configtx.yaml or crypto-config.yaml until you get the basic network working—customizations can introduce unexpected issues.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.27 04:20:50