title: Hyperledger Fabric v1 : Error connecting to orderer:7050 due to grpc: timed out when dialing
body: <p>I'm trying to test the latest version of Hyperledger Fabric, the v1 in incubation.  I have an issue with the latest version of Hyperledger Fabric.</p>
  
  <p>I'm following the instructions here to install Fabric:<br>
  <a href="https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup/" rel="nofollow noreferrer">https://hyperledger-fabric.readthedocs.io/en/latest/asset_setup/</a></p>
  
  <p>I'm using Docker to spawn network entities &amp; create/join a channel :</p>
  
  <p><code>sudo docker --version 
   Docker version 1.13.1, build 092cba3</code></p>
  
  <p><code>sudo docker-compose --version
   docker-compose version 1.11.2, build dfed245
  </code></p>
  
  <p>When I'm performing :</p>
  
  <pre><code>sudo docker-compose -f docker-compose-gettingstarted.yml up
  </code></pre>
  
  <p>My five containers are running :</p>
  
  <pre><code>CONTAINER ID        IMAGE                                                          COMMAND                  CREATED             STATUS              PORTS                                            NAMES
  f1b6d6128d43        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "sh -c './channel_..."   21 minutes ago      Up About a minute                                                    cli
  8f9df755c160        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "peer node start -..."   21 minutes ago      Up About a minute   0.0.0.0:8056-&gt;7051/tcp                           peer2
  2de6ee624d28        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "peer node start -..."   21 minutes ago      Up About a minute   0.0.0.0:8055-&gt;7051/tcp                           peer1
  31ac53b6e5db        sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0      "peer node start -..."   21 minutes ago      Up About a minute   0.0.0.0:8051-&gt;7051/tcp, 0.0.0.0:8053-&gt;7053/tcp   peer0
  d98fc2a8652f        sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57        "sh -c 'sleep 10; ..."   21 minutes ago      Up About a minute   0.0.0.0:8054-&gt;7054/tcp                           ca
  07dcfceb86cc        sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0   "orderer"                21 minutes ago      Up About a minute   0.0.0.0:8050-&gt;7050/tcp                           orderer
  </code></pre>
  
  <p>but I get this error on the last line : </p>
  
  <pre><code> 2017-03-01 14:55:32.183 UTC [msp] newIdentity -&gt; INFO 016 Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.270 UTC [peer] GetManagerForChain -&gt; INFO 017 Created new msp manager for chain testchainid
  cli               | 2017-03-01 14:55:32.270 UTC [msp] Setup -&gt; INFO 018 Setting up the MSP manager (1 msps)
  cli               | 2017-03-01 14:55:32.270 UTC [msp] Setup -&gt; INFO 019 Setting up MSP
  cli               | 2017-03-01 14:55:32.270 UTC [msp] NewBccspMsp -&gt; INFO 01a Creating BCCSP-based MSP instance
  cli               | 2017-03-01 14:55:32.270 UTC [msp] Setup -&gt; INFO 01b Setting up MSP instance DEFAULT
  cli               | 2017-03-01 14:55:32.270 UTC [msp] newIdentity -&gt; INFO 01c Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.270 UTC [msp] newIdentity -&gt; INFO 01d Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.271 UTC [msp] newIdentity -&gt; INFO 01e Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.271 UTC [msp] newIdentity -&gt; INFO 01f Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -&gt; INFO 020 Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -&gt; INFO 021 Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.275 UTC [msp] newIdentity -&gt; INFO 022 Creating identity instance for ID &amp;{DEFAULT IDENTITY}
  cli               | 2017-03-01 14:55:32.275 UTC [msp] Setup -&gt; INFO 023 MSP manager setup complete, setup 1 msps
  cli               | 2017-03-01 14:55:32.275 UTC [logging] InitFromViper -&gt; DEBU 024 Setting default logging level to DEBUG for command 'channel'
  cli               | 2017-03-01 14:55:32.275 UTC [peer] GetLocalMSP -&gt; INFO 025 Returning existing local MSP
  cli               | 2017-03-01 14:55:32.275 UTC [msp] GetDefaultSigningIdentity -&gt; INFO 026 Obtaining default signing identity
  cli               | Error: Error getting broadcast client: Error connecting to orderer:7050 due to grpc: timed out when dialing
  </code></pre>
  
  <p>How can I fix it ?</p>
  
  <p>And when I perform : </p>
  
  <pre><code>sudo docker exec -it cli bash
  [sudo] Mot de passe de blockchain : 
  root@f1b6d6128d43:/opt/gopath/src/github.com/hyperledger/fabric/peer# cat results.txt
  ERROR on CHANNEL CREATION
  </code></pre>
  
  <p>Here is my Docker_compose.yml :</p>
  
  <pre><code>version: '2'
  networks:
     bridge:
  
  services:
  
    ccenv_latest:
      container_name: ccenv_latest
      build: ./ccenv
      image: hyperledger/fabric-ccenv:latest
      volumes:
          - ./ccenv:/opt/gopath/src/github.com/hyperledger/fabric/orderer/ccenv
  
    ccenv_snapshot:
      container_name: ccenv_snapshot
      build: ./ccenv
      image: hyperledger/fabric-ccenv:x86_64-0.7.0-snapshot-c7b3fe0
      volumes:
          - ./ccenv:/opt/gopath/src/github.com/hyperledger/fabric/orderer/ccenv
  
    ca:
      image: sfhackfest22017/fabric-ca:x86_64-0.7.0-snapshot-6294c57
      ports:
        - 8054:7054
      environment:
        - CA_CERTIFICATE=peerOrg0_cert.pem
        - CA_KEY_CERTIFICATE=peerOrg0_pk.pem
      volumes:
          - ./tmp/ca:/.fabric-ca
      command: sh -c 'sleep 10; fabric-ca server start -ca /.fabric-ca/$$CA_CERTIFICATE -ca-key /.fabric-ca/$$CA_KEY_CERTIFICATE -config /etc/hyperledger/fabric-ca/server-config.json -address "0.0.0.0"'
      container_name: ca
  
  
    orderer:
      container_name: orderer
      image: sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0
      environment:
        - ORDERER_GENERAL_LEDGERTYPE=ram
        - ORDERER_GENERAL_BATCHTIMEOUT=10s
        - ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
        - ORDERER_GENERAL_MAXWINDOWSIZE=1000
        - ORDERER_GENERAL_ORDERERTYPE=solo
        - ORDERER_GENERAL_LOGLEVEL=debug
        - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
        - ORDERER_GENERAL_LISTENPORT=7050
        - ORDERER_RAMLEDGER_HISTORY_SIZE=100
      working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
      command: orderer
      ports:
        - 8050:7050
      networks:
        - bridge
  
    peer0:
      container_name: peer0
      image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
      environment:
        - CORE_PEER_ADDRESSAUTODETECT=true
        - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
        - CORE_LOGGING_LEVEL=DEBUG
        - CORE_PEER_NETWORKID=peer0
        - CORE_NEXT=true
        - CORE_PEER_ENDORSER_ENABLED=true
        - CORE_PEER_ID=peer0
        - CORE_PEER_PROFILE_ENABLED=true
        - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
        - CORE_PEER_GOSSIP_ORGLEADER=true
        - CORE_PEER_GOSSIP_IGNORESECURITY=true
  
      working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
  
      command: peer node start --peer-defaultchain=false
      ports:
        - 8051:7051
        - 8053:7053
      links:
        - orderer:orderer
      volumes:
          - /var/run/:/host/var/run/
          - ./tmp/peer0:/etc/hyperledger/fabric/msp/sampleconfig
      networks:
        - bridge
  
    peer1:
      container_name: peer1
      image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
      environment:
        - CORE_PEER_ADDRESSAUTODETECT=true
        - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
        - CORE_LOGGING_LEVEL=DEBUG
        - CORE_PEER_NETWORKID=peer0
        - CORE_NEXT=true
        - CORE_PEER_ENDORSER_ENABLED=true
        - CORE_PEER_ID=peer1
        - CORE_PEER_PROFILE_ENABLED=true
        - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
        - CORE_PEER_GOSSIP_ORGLEADER=true
        - CORE_PEER_GOSSIP_IGNORESECURITY=true
      working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
      ports:
        - 8055:7051
      command: peer node start --peer-defaultchain=false
      links:
        - orderer:orderer
        - peer0:peer0
      volumes:
          - /var/run/:/host/var/run/
          - ./tmp/peer1:/etc/hyperledger/fabric/msp/sampleconfig
      networks:
        - bridge
  
    peer2:
      container_name: peer2
      image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
      environment:
        - CORE_PEER_ADDRESSAUTODETECT=true
        - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
        - CORE_LOGGING_LEVEL=DEBUG
        - CORE_PEER_NETWORKID=peer0
        - CORE_NEXT=true
        - CORE_PEER_ENDORSER_ENABLED=true
        - CORE_PEER_ID=peer2
        - CORE_PEER_PROFILE_ENABLED=true
        - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
        - CORE_PEER_GOSSIP_ORGLEADER=true
        - CORE_PEER_GOSSIP_IGNORESECURITY=true
      working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
  
      ports:
        - 8056:7051
      command: peer node start --peer-defaultchain=false
      links:
        - orderer:orderer
        - peer0:peer0
        - peer1:peer1
      volumes:
          - /var/run/:/host/var/run/
          - ./tmp/peer2:/etc/hyperledger/fabric/msp/sampleconfig
      networks:
        - bridge
  
    cli:
      container_name: cli
      image: sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0
      tty: true
      environment:
        - GOPATH=/opt/gopath
        - CORE_PEER_ADDRESSAUTODETECT=true
        - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
        - CORE_LOGGING_LEVEL=DEBUG
        - CORE_NEXT=true
        - CORE_PEER_ID=cli
        - CORE_PEER_ENDORSER_ENABLED=true
        - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050
        - CORE_PEER_ADDRESS=peer0:7051
      working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
      command: sh -c './channel_test.sh; sleep 10000'
  #   command: /bin/sh
      links:
        - orderer:orderer
        - peer0:peer0
        - peer1:peer1
        - peer2:peer2
      volumes:
          - /var/run/:/host/var/run/
          #in the "- &lt;HOST&gt;:/opt/gopath/src/github.com/hyperledger/fabric/examples/" mapping below, the HOST part
          #should be modified to the path on the host. This will work as is in the Vagrant environment
          - ./src/github.com/example_cc/example_cc.go:/opt/gopath/src/github.com/hyperledger/fabric/examples/example_cc.go
          - ./tmp/peer3:/etc/hyperledger/fabric/msp/sampleconfig
          - ./channel_test.sh:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel_test.sh
      networks:
        - bridge
  </code></pre>
  
  <p>And this is my channel_test.sh : </p>
  
  <pre><code>#!/bin/sh
  
  # find address of peer0 in your network
  PEER0_IP_ADDRESS=`perl -e 'use Socket; $a = inet_ntoa(inet_aton("peer0")); print "$a\n";'`
  
  # create an anchor file
  cat&lt;&lt;EOF&gt;anchorPeer.txt
  $PEER0_IP_ADDRESS
  7051
  -----BEGIN CERTIFICATE-----
  MIICjDCCAjKgAwIBAgIUBEVwsSx0TmqdbzNwleNBBzoIT0wwCgYIKoZIzj0EAwIw
  fzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh
  biBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK
  BgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMTYxMTExMTcwNzAw
  WhcNMTcxMTExMTcwNzAwWjBjMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg
  Q2Fyb2xpbmExEDAOBgNVBAcTB1JhbGVpZ2gxGzAZBgNVBAoTEkh5cGVybGVkZ2Vy
  IEZhYnJpYzEMMAoGA1UECxMDQ09QMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
  HBuKsAO43hs4JGpFfiGMkB/xsILTsOvmN2WmwpsPHZNL6w8HWe3xCPQtdG/XJJvZ
  +C756KEsUBM3yw5PTfku8qOBpzCBpDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYw
  FAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFOFC
  dcUZ4es3ltiCgAVDoyLfVpPIMB8GA1UdIwQYMBaAFBdnQj2qnoI/xMUdn1vDmdG1
  nEgQMCUGA1UdEQQeMByCCm15aG9zdC5jb22CDnd3dy5teWhvc3QuY29tMAoGCCqG
  SM49BAMCA0gAMEUCIDf9Hbl4xn3z4EwNKmilM9lX2Fq4jWpAaRVB97OmVEeyAiEA
  25aDPQHGGq2AvhKT0wvt08cX1GTGCIbfmuLpMwKQj38=
  -----END CERTIFICATE-----
  EOF
  
  #create
  echo "Creating channel on Orderer"
  CORE_PEER_GOSSIP_IGNORESECURITY=true CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/sampleconfig CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 peer channel create -c myc1 -a anchorPeer.txt &gt;&gt;log.txt 2&gt;&amp;1
  cat log.txt
     grep -q "Exiting" log.txt
     if [ $? -ne 0 ]; then
        echo "ERROR on CHANNEL CREATION" &gt;&gt; results.txt
        exit 1
     fi
  echo "SUCCESSFUL CHANNEL CREATION" &gt;&gt; results.txt
  sleep 5
  TOTAL_PEERS=3
  i=0
  while test $i -lt $TOTAL_PEERS  
  do
  echo "###################################### Joining peer$i"
  CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 CORE_PEER_ADDRESS=peer$i:7051 peer channel join -b myc1.block &gt;&gt;log.txt 2&gt;&amp;1
  cat log.txt
  echo '-------------------------------------------------'
  grep -q "Join Result: " log.txt
     if [ $? -ne 0 ]; then
        echo "ERROR on JOIN CHANNEL" &gt;&gt; results.txt
        exit 1
     fi
  echo "SUCCESSFUL JOIN CHANNEL on PEER$i" &gt;&gt; results.txt
  echo "SUCCESSFUL JOIN CHANNEL on PEER$i"
  i=$((i+1))
  sleep 10
  done
  echo "Peer0 , Peer1 and Peer2 are added to the channel myc1"
  cat log.txt
  exit 0
  </code></pre>