Hyper Fabric: Error: CONNECTION_FAILED. Description: dialing connection timed out

0 votes

 This is my code:

    ctxCh := sdk.ChannelContext("mychannel", fabsdk.WithUser("user1"))
    chClient, err := channel.New(ctxCh)
    if err != nil {
        log.Fatalln("error from New channel", err)
    }

    req := channel.Request{
        ChaincodeID: "fabcar",
        Fcn:         "createCar",
        Args:        [][]byte{[]byte("CAR10"), []byte("Honda"), []byte("Accord"), []byte("Black"), []byte("Tom")},
    }
    resp, err := chClient.Execute(req)
    if err != nil {
        log.Fatalln("error from Execute =", err)
    }

I get this error:

calling orderer 'orderer.example.com:7050' failed: Orderer Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection timed out [orderer.example.com:7050]

my config.yaml

channels:
  # name of the channel
  mychannel:
    orderers:
      - orderer.example.com

orderers:
  orderer.example.com:
    url: grpc://localhost:7050

    # these are standard properties defined by the gRPC library
    # they will be passed in as-is to gRPC client constructor
    grpcOptions:
      ssl-target-name-override: orderer.example.com

    tlsCACerts:
      # Certificate location absolute path
      path: ./crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem

Any ideas?

Nov 9, 2018 in Blockchain by digger
• 26,550 points
334 views

1 answer to this question.

0 votes

The mapping is not set up right. Add to config.yaml

entityMatchers:
 orderer:
   - pattern: (\w+).example.(\w+)
     urlSubstitutionExp: grpc://localhost:7050
     sslTargetOverrideUrlSubstitutionExp: orderer.example.com
     mappedHost: orderer.example.com

to map grpc://localhost:7050 to orderer.example.com

answered Nov 9, 2018 by Omkar
• 67,660 points

Related Questions In Blockchain

0 votes
1 answer

sendProposal - timed out after:45000, sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT

You could simply replace --net=bridge with --net=artifacts_default in your DockerFile.  I used ...READ MORE

answered Jul 26, 2018 in Blockchain by Perry
• 17,020 points
388 views
0 votes
1 answer
+2 votes
4 answers

"failed to create new connection context deadline exceeded." error in Hyperledger Fabric

Try remove previous docker containers(have mentioned the ...READ MORE

answered Apr 23 in Blockchain by Kiran
3,470 views
0 votes
1 answer

Error while running make command using Fabric 1.0.6

It's a known issue in go 1.9.4: https://github.com/golang/go/issues/23739 While ...READ MORE

answered Jun 26, 2018 in Blockchain by Perry
• 17,020 points
120 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
85 views
+1 vote
1 answer
+2 votes
3 answers

Hyperledger Fabric: Peer Connection error: Failed obtaining connection: Could not connect to any of the endpoints.

 You can extend your /etc/hosts file and make orderer.example.com domain name ...READ MORE

answered Nov 13, 2018 in Blockchain by Omkar
• 67,660 points
989 views