Hyperledger Fabric构建首个网络教程:通道创建与加入报错求助
Hey there, let's work through these two issues you're facing step by step to get your network up and running smoothly!
1. Fixing "Attempted to include a member which is not in the consortium" Error
That error popped up because you were trying to create a channel that already exists—your peer channel list output confirms that your peer is already joined to mychannel. Here's how to handle it:
- If you want to keep using the existing
mychannel, just skip the channel creation step entirely and move on to the next parts of the tutorial. - If you need to start fresh with a new channel:
- First, have your peer leave the existing channel:
peer channel leave -c mychannel - On your orderer node, delete the existing channel data (usually located at
/var/hyperledger/production/orderer/channels/mychannel/—remove all files in this directory). - Now you can re-run the channel creation command without hitting that error.
- First, have your peer leave the existing channel:
2. Fixing "No configtx file name supplied" Error When Updating Anchor Peers
This error happens because you forgot to specify the required anchor peer transaction file in your command. Here's what you need to do:
First, make sure you've generated the anchor peer transaction file
If you haven't already, use configtxgen to create the file for your organization (replace Org1MSP with your org ID if needed):
configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
Then run the correct channel update command
Use the -f flag to point to the transaction file you just generated (adjust the path if your file is in a different location):
peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx
Also, double-check that your terminal's environment variables (like CORE_PEER_ADDRESS, CORE_PEER_LOCALMSPID) are set correctly to target the right peer node for your organization.
内容的提问来源于stack exchange,提问作者Marcelo Azevedo

