1

I am trying to setup hyperledger fabric blockchain network using amazon managed blockchain following this guide. In the step 6, to create the channel I have executed the following command,

docker exec cli peer channel create -c hrschannel -f /opt/home/hrschannel.pb -o orderer.n-zzzz.managedblockchain.us-east-1.amazonaws.com:30001 --cafile /opt/home/managedblockchain-tls-chain.pem --tls

But I am getting the following error,

Error: failed to create deliver client: orderer client failed to connect to orderer.n-zzzz.managedblockchain.us-east-1.amazonaws.com:30001: failed to create new connection: context deadline exceeded

Help me to fix this issue.

Edited: I asked the same question in reddit. One user replied that he added listenAddress environment variable in my configtx.yaml file. He did not say clear information about which listenAddress and where to add that address in configtx.yaml. Here is my configtx.yaml file.

################################################################################

#

# Section: Organizations

#

# - This section defines the different organizational identities which will

# be referenced later in the configuration.

#

################################################################################

Organizations:

- &Org1

# DefaultOrg defines the organization which is used in the sampleconfig

# of the fabric.git development environment

Name: m-CUB6HI

# ID to load the MSP definition as

ID: m-B6HI

MSPDir: /opt/home/admin-msp

# AnchorPeers defines the location of peers which can be used

# for cross org gossip communication. Note, this value is only

# encoded in the genesis block in the Application section context

AnchorPeers:

- Host:

Port:


################################################################################

#

# SECTION: Application

#

# - This section defines the values to encode into a config transaction or

# genesis block for application related parameters

#

################################################################################

Application: &ApplicationDefaults

# Organizations is the list of orgs which are defined as participants on

# the application side of the network

Organizations:


################################################################################

#

# Profile

#

# - Different configuration profiles may be encoded here to be specified

# as parameters to the configtxgen tool

#

################################################################################

Profiles:

OneOrgChannel:

Consortium: AWSSystemConsortium

Application:

<<: *ApplicationDefaults

Organizations:

- *Org1

Help me to fix this issue.

MonoThreaded
  • 11,429
  • 12
  • 71
  • 102
Gurunath
  • 341
  • 3
  • 17
  • Refer to the link and see if it works for you https://stackoverflow.com/questions/52583128/how-do-i-resolve-this-error-error-failed-to-create-deliver-client-failed-to-c – Kartik Chauhan Jul 23 '20 at 07:22
  • Also, check if you've specified the correct orderer name and port. Your peer is unable to communicate with the orderer that you've specified. – Kartik Chauhan Jul 23 '20 at 07:24
  • @KartikChauhan Thanks for your response. Same problem. I am using amazon managed blockchain. I did not download and run using container. And I am using correct orderer name and port. verified twice. – Gurunath Jul 23 '20 at 07:25
  • Are you using tls? If not, then remove tls flag from the command and see if it works. – Kartik Chauhan Jul 23 '20 at 07:31
  • checked. getting same error. – Gurunath Jul 23 '20 at 07:54
  • Can you post the logs of peer and orderer containers? Is your orderer even running? See this https://stackoverflow.com/questions/52142674/error-failed-to-create-deliver-client-orderer-client-failed-to-connect-to-orde/52143644 – Kartik Chauhan Jul 23 '20 at 07:59
  • I do not know how to get orderer logs in amazon managed blockchain. posted question here [https://stackoverflow.com/questions/63051944/how-to-get-orderer-logs-amazon-managed-blockchain] – Gurunath Jul 23 '20 at 18:43
  • Could you try and check if you can curl or telnet to the orderer container from your peer container. It'll help in narrowing down the problem. – Kartik Chauhan Jul 26 '20 at 03:14
  • @KartikChauhan There is no interface to get orderer logs in amazon managed blockchain. – Gurunath Jul 30 '20 at 17:18
  • Did you try curl or telnet to the orderer container? – Kartik Chauhan Jul 31 '20 at 01:41
  • @KartikChauhan Can you please tell the exact curl/telnet comment to see orderer logs? For example I am using `telnet CaEndpoint-Without-Port CaPort` or `curl https://CAEndpoint/cainfo -k` to verify CAEndpoint. And hope you are talking about hyperledger fabric setup in amazon managed blockchain. – Gurunath Jul 31 '20 at 06:48
  • The command you wrote is correct and I'm not asking for orderer's logs, since you mentioned orderer logs can not be viewed. I'm asking you to just check whether the orderer container is reachable from your peer container using the curl command. – Kartik Chauhan Jul 31 '20 at 07:35
  • @KartikChauhan I tired these commands `curl https://orderer.n-xxxx.managedblockchain.us-east-1.amazonaws.com:30001` and `telnet orderer.n-xxxxx.managedblockchain.us-east-1.amazonaws.com 30001` But it is not connected. – Gurunath Jul 31 '20 at 08:54
  • The issue can be due to multiple reasons. Either the orderer container is down, or there's some kind of firewall that is not letting your peer communicate with the orderer. Could be because of containers not being in the same VPC(which I highly doubt), different security groups etc. I haven't tried Amazon Managed Blockchain before, so can't help much you in this. It'd be better to ask someone from the AWS team if it's possible or post another question specific to the issue "Peer unable to communicate with orderer in AWS Managed Blockchain". – Kartik Chauhan Jul 31 '20 at 09:00
  • 1
    @KartikChauhan You are great. As you said, it is because of security group. After enabling port 30001. It is working. Please add as answer. I will accept it. – Gurunath Jul 31 '20 at 09:21

1 Answers1

1

One must check if the peer container is able to communicate with the orderer container. curl orderer.endpoint port can be used to check the connection. If the peer is unable to communicate then either the orderer container is down or could be due to different security groups.

Update: As OP mentioned in the comments, changing the port helped in resolving the issue. One must give it a try.

Kartik Chauhan
  • 2,779
  • 5
  • 28
  • 39