2

I am new to hyperledger fabric and I am trying to create a sample blockchain network from scratch using hyperledger fabric. In order to do so, I configured "crypto-config.yaml" file, and generated the respective organization's certificates by running it against the "cryptogen" tool. I also generated the respective "channel-artifacts" by configuring the "configtx.yaml" file and running it against the configtxgen tool. I then modified the "docker-compose-cli.yaml" file and "docker-compose-base" file.

Now, in order to bootstrap the network, I ran the following docker command:

docker-compose -f docker-compose-cli.yaml up 

I then executed the following commands:

docker exec -it cli bash
export CHANNEL_NAME=testChannel
peer channel create -o orderer.example.com:7050 -c testChannel -f ./channel-artifacts/testChannel.tx

On executing the "peer channel create" command I received the following error:

Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded

I am not sure as to why this error is occurring. My configuration for the Address section in OrdererDefaults (in configtx.yaml file) is:

Ordertype:
     - solo

Addresses:
     - orderer.example.com:7050

Hence, please let me know if I am missing something in order to clear the "peer channel create" issue.

R Anand
  • 41
  • 2
  • 5
  • [Hope the answer helps, answer from another post](https://stackoverflow.com/questions/52142674/error-failed-to-create-deliver-client-orderer-client-failed-to-connect-to-orde/57520284#57520284#answer-57520284) – Burt Aug 16 '19 at 07:09

1 Answers1

0

do a docker ps and see if the orderer is up and running if not do a docker logs orderer.example.com and check orderers logs usually the orderer logs give clear clues on what has happened read the logs and fix the issue . that's what i did

and instead of creating a peer first going inside it and creating a channel ,i suggest you create the channel first and join the peer to it afterwards

Create the channel

docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.tracexyz.com/msp" peer0.org1.tracexyz.com peer channel create -o orderer.tracexyz.com:7050 -c cheeseproduction -f /etc/hyperledger/configtx/channel.tx

Add peer 0 to the channel

docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.tracexyz.com/msp" peer0.org1.tracexyz.com peer channel join -b cheeseproduction.block

Fetch from peer 1

docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.tracexyz.com/msp" peer1.org1.tracexyz.com peer channel fetch config -o orderer.tracexyz.com:7050 -c cheeseproduction

Join peer 1 also to the channel

docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.tracexyz.com/msp" -e "CORE_PEER_ADDRESS=peer1.org1.tracexyz.com:7061" peer0.org1.tracexyz.com peer channel join -b cheeseproduction.block

this is how i connected two peers to a single channel. my org name was tracexyz (tracexyz instead of example ) and my channel name was cheeseproduction

I guesss you can replace those with your own values

after doing these go inside the peer with

docker exec -it cli bash

it will take you inside the default peer which is peer0.org1

then do a peer channel list to see the channels to which peer0 has joined

you will see it will list cheeseproduction