title: Error join peer channel when using couchdb hyperledger fabric
body: <p>I'm using a simple basic network with two peers, and creating a channel. It's wotks fine, but when I try to add couch db functionality, returns the error:</p>
  
  <pre><code>Channel created, joining Org1...
  Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 172.22.0.5:7051: connect: connection refused"
  </code></pre>
  
  <p>This only happen when couch db is enabled, without couchdb, it creates the channel and joins it two peers.</p>
  
  <p>When I start the containers without couchdb I'm using:</p>
  
  <pre><code>docker-compose -f docker-compose-cli.yaml up -d
  </code></pre>
  
  <p>And with couchdb </p>
  
  <pre><code> docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d
  </code></pre>
  
  <p>The docker-compose-couch.yaml contains:</p>
  
  <pre><code>version: '2'
  
  networks:
    byfn:
  
  services:
    couchdb0:
      container_name: couchdb0
      image: hyperledger/fabric-couchdb
      # Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
      # for CouchDB.  This will prevent CouchDB from operating in an "Admin Party" mode.
      environment:
        - COUCHDB_USER=
        - COUCHDB_PASSWORD=
      # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service,
      # for example map it to utilize Fauxton User Interface in dev environments.
      ports:
        - "5984:5984"
      networks:
        - byfn
  
    peer0.org1.example.com:
      environment:
        - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
        - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
        # The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
        # provide the credentials for ledger to connect to CouchDB.  The username and password must
        # match the username and password set for the associated CouchDB.
        - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
        - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
      depends_on:
        - couchdb0
  
  
    couchdb1:
      container_name: couchdb1
      image: hyperledger/fabric-couchdb
      # Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
      # for CouchDB.  This will prevent CouchDB from operating in an "Admin Party" mode.
      environment:
        - COUCHDB_USER=
        - COUCHDB_PASSWORD=
      # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service,
      # for example map it to utilize Fauxton User Interface in dev environments.
      ports:
        - "7984:5984"
      networks:
        - byfn
  
    peer0.org2.example.com:
      environment:
        - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
        - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984
        # The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
        # provide the credentials for ledger to connect to CouchDB.  The username and password must
        # match the username and password set for the associated CouchDB.
        - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
        - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
      depends_on:
        - couchdb1
  </code></pre>
  
  <p>Any idea? Is there any reason to connect error when using couchdb?</p>
  
  <p>Thanks</p>