title: Unable to connect peer to channel in hyperledger fabric
body: <p>I am following below link to setup my first network on Hyperledger Fabric
  <a href="http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html" rel="nofollow noreferrer">http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html</a></p>
  
  <p>Whatever steps are mentioned in this setup i am pretty much able to do all.
  The issue is than when I try to join other peers to the channel, using below instruction</p>
  
  <blockquote>
    <p>You can make other peers join the channel as necessary by making
    appropriate changes in the four environment variables.</p>
  </blockquote>
  
  <p>I export following variables </p>
  
  <pre><code>export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
  export CORE_PEER_ADDRESS=peer1.org1.example.com:8051
  export CORE_PEER_LOCALMSPID="Org1MSP"
  export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
  </code></pre>
  
  <p>and then I run </p>
  
  <pre><code>peer channel join -b mychannel.block
  </code></pre>
  
  <p>I get below error</p>
  
  <pre><code>2017-08-02 06:38:12.375 UTC [msp] GetLocalMSP -&gt; DEBU 001 Returning existing local MSP
  2017-08-02 06:38:12.376 UTC [msp] GetDefaultSigningIdentity -&gt; DEBU 002 Obtaining default signing identity
  2017-08-02 06:38:12.379 UTC [grpc] Printf -&gt; DEBU 003 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.19.0.2:8051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:8051 &lt;nil&gt;}
  2017-08-02 06:38:13.379 UTC [grpc] Printf -&gt; DEBU 004 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.19.0.2:8051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:8051 &lt;nil&gt;}
  2017-08-02 06:38:15.085 UTC [grpc] Printf -&gt; DEBU 005 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.19.0.2:8051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:8051 &lt;nil&gt;}
  Error: Error getting endorser client channel: PER:404 - Error trying to connect to local peer
  /opt/gopath/src/github.com/hyperledger/fabric/peer/common/common.go:116 github.com/hyperledger/fabric/peer/common.GetEndorserClient
  /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/channel.go:149 github.com/hyperledger/fabric/peer/channel.InitCmdFactory
  /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/join.go:138 github.com/hyperledger/fabric/peer/channel.join
  /opt/gopath/src/github.com/hyperledger/fabric/peer/channel/join.go:42 github.com/hyperledger/fabric/peer/channel.joinCmd.func1
  /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:599 github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute
  /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:689 github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC
  /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:648 github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute
  /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:118 main.main
  /opt/go/src/runtime/proc.go:192 runtime.main
  /opt/go/src/runtime/asm_amd64.s:2087 runtime.goexit
  Caused by: context deadline exceeded
  Usage:
    peer channel join [flags]
  
  Flags:
    -b, --blockpath string   Path to file containing genesis block
  </code></pre>
  
  <p>org1 peer0 I was able to connect but not other nodes</p>
  
  <p>Docker ps output </p>
  
  <p><a href="https://i.stack.imgur.com/tCWak.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tCWak.png" alt="enter image description here"></a></p>