title: Hyperledger Fabric Node.js client application deployed on different server
body: <p>I am struggling with Node.js Hyperledger Fabric client library on this particular error:</p>
  
  <p>I've got my blockchain network (Hyperledger Fabric 1.4) deployed on one server with IP and all needed ports visible from another server. All the examples / samples available in documentation are referring to network via localhost.</p>
  
  <p>How it's possible to start the client application and point it to the IP address of the network instead of localhost or peer container names (e.g. peer0.org1.example.com)?</p>
  
  <p>Does each client application have to enroll admin and user into its local persistence store or it can be done only once by the network itself (and probably mounted from network to application in later stage)? We talk here about Dockerized network on one host and client application (Dockerized as well) on another.</p>
  
  <p>And also, how to start the application and connect to e.g. ordered via GRCPS if it requires the .pem certificate file being present when calling <code>createPeer</code> method?</p>
  
  <p>I will be very thankful for any help provided here.</p>
  
  <p><strong>EDIT, 12.03.2020:</strong></p>
  
  <p>I am using the basic-network sample with changes to my network to create 3 organizations with 3 peers each and 5 Raft orderers. I've copied the connection-org1.json file, changed localhost to my external server IP and I got the following error:</p>
  
  <pre><code>2020-03-12T12:45:31.503Z - error: [SingleQueryHandler]: evaluate: message=No peers available to query. Errors: ["14 UNAVAILABLE: DNS resolution failed","14 UNAVAILABLE: DNS resolution failed","14 UNAVAILABLE: DNS resolution failed"], stack=FabricError: No peers available to query. Errors: ["14 UNAVAILABLE: DNS resolution failed","14 UNAVAILABLE: DNS resolution failed","14 UNAVAILABLE: DNS resolution failed"]
      at SingleQueryHandler.evaluate ((...)/network_files/javascript/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:44:17), name=FabricError
  Failed to evaluate transaction: FabricError: No peers available to query. Errors: ["14 UNAVAILABLE: DNS resolution failed","14 UNAVAILABLE: DNS resolution failed","14 UNAVAILABLE: DNS resolution failed"]
  </code></pre>
  
  <p>I was able to successfully enroll and register admin and user on my local machine using the network hosted on external IP. But I cannot query the chaincode with the connection profile.</p>
  
  <p>Here's my connection profile:</p>
  
  <pre><code>{
      "name": "first-network-org1",
      "version": "1.0.0",
      "client": {
          "organization": "Org1",
          "connection": {
              "timeout": {
                  "peer": {
                      "endorser": "300"
                  }
              }
          }
      },
      "organizations": {
          "Org1": {
              "mspid": "Org1MSP",
              "peers": [
                  "peer0.org1.example.com",
                  "peer1.org1.example.com",
                  "peer2.org1.example.com"
              ],
              "certificateAuthorities": [
                  "ca.org1.example.com"
              ]
          }
      },
      "peers": {
          "peer0.org1.example.com": {
              "url": "grpcs://&lt;IP&gt;:7051",
              "tlsCACerts": {
                  "pem": "&lt;CERT&gt;"
              },
              "grpcOptions": {
                  "ssl-target-name-override": "peer0.org1.example.com",
                  "hostnameOverride": "peer0.org1.example.com"
              },
              "endorsingPeer": true,
              "chaincodeQuery": true,
              "ledgerQuery": true,
              "eventSource": true
          },
          "peer1.org1.example.com": {
              "url": "grpcs://&lt;IP&gt;:8051",
              "tlsCACerts": {
                  "pem": "&lt;CERT&gt;"
              },
              "grpcOptions": {
                  "ssl-target-name-override": "peer1.org1.example.com",
                  "hostnameOverride": "peer1.org1.example.com"
              }
          },
          "peer2.org1.example.com": {
              "url": "grpcs://&lt;IP&gt;:9051",
              "tlsCACerts": {
                  "pem": "&lt;CERT&gt;"
              },
              "grpcOptions": {
                  "ssl-target-name-override": "peer2.org1.example.com",
                  "hostnameOverride": "peer2.org1.example.com"
              }
          }
      },
      "certificateAuthorities": {
          "ca.org1.example.com": {
              "url": "https://&lt;IP&gt;:7054",
              "caName": "ca-org1",
              "tlsCACerts": {
                  "pem": "&lt;CERT&gt;"
              },
              "httpOptions": {
                  "verify": false
              }
          }
      }
  }
  </code></pre>