The first network in hyperrecker

I am trying to work on my first network in Hyperledger Fabric. Using the following documentation http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html

I finished setting up to http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#create-join-channel

but when i run

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

      

I got error like

Error: Unexpected status received: BAD_REQUEST

Searching for the problem I am facing http://hyperledgerdocs.readthedocs.io/en/latest/asset_trouble.html

Hence, I tried using the new channel name as given (old channel name = mychannel), I tried below cmds

CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1

CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer.example.com:7050 peer channel create -c myc1

CORE_PEER_COMMITTER_LEDGER_ORDERER=172.18.0.2:7050 peer channel create -c myc1

For all three I get the error

Error: order service endpoint is invalid or missing Usage: peer channel create [flags]

Also I tried to skip it, assuming the channel has already been created. hence,

peer channel join -b ./mychannel.block

      

But got

Error: sentence failed (error: error rpc: code = Unknown desc = network code error (status: 500, message: unable to create register from genesis block, because LedgerID already exists))

My OS is Ubuntu 16.04

Docker ps Docker ps output Please help

+3


source to share


1 answer


Try to make sure you have followed all the steps in the docs .

  • First of all, you need to edit the file docker-compose-cli.yaml

    in the cli section to comment out the line responsible for the automatic channel creation flow and join:

    command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'
    
          

eg.



# command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'

      

  1. The following is the name of the export channel you are working with:

    export CHANNEL_NAME=mychannel

  2. Start the network (use the default 60s timeout):

    CHANNEL_NAME=$CHANNEL_NAME docker-compose -f docker-compose-cli.yaml up -d

  3. Enter the cli container:

    docker exec -it cli bash

  4. Exporting environment variables:

    export CHANNEL_NAME=mychannel

  5. Create a channel:

    peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    
          

  6. Join the channel:

    peer channel join -b mychannel.block
    
          

+2


source







All Articles