FABRIC returns Error: Got unexpected status: BAD_REQUEST

前端 未结 8 1472
谎友^
谎友^ 2021-01-05 08:47

From fabric document create-join-channel, when I execute the command

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/         


        
相关标签:
8条回答
  • 2021-01-05 08:55

    Try adding a entry in the /etc/hosts for the domain in use (usually example.com)

    go to terminal: type "sudo /etc/hosts" in the top add in "127.0.0.1 example.com" press ctrl+o to save, confirm with 'y', press ctrl+x to exit.

    try again.. should work.

    0 讨论(0)
  • 2021-01-05 08:58
    ./byfn.sh -m restart -c mychannel
    
    0 讨论(0)
  • 2021-01-05 09:04

    The reason you're getting this is probably because the docker-compose-cli.yaml file is still running the script.sh script. Comment out the line that invokes the script and it will run fine. Example:

    # Comment out the line like the example below by adding a #
    # command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME} ${DELAY} ${LANG}; sleep $TIMEOUT'```
    

    I am suggesting a documentation change to fix this.

    0 讨论(0)
  • 2021-01-05 09:08

    I had similar error. There seems to be a issue with the way CHANNEL_NAME variable is set within the docker-compose (I guess?). I ran this command with a slight modification as below [changed flag '-c $CHANNEL_NAME' to '-c mychannel']:

    peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls --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 worked.

    0 讨论(0)
  • 2021-01-05 09:09

    The same thing happens to me but I just down the network and then done all procedure again like generate genesis block again and then up my network I got up a network.

    0 讨论(0)
  • 2021-01-05 09:15

    As @Phil said, you should comment out that line before you start the network. As documentation says :

    If left uncommented, that script will exercise all of the CLI commands when the network is started, as we describe in the What’s happening behind the scenes? section. However, we want to go through the commands manually in order to expose the syntax and functionality of each call.

    see the doc

    0 讨论(0)
提交回复
热议问题