title: Hyperledger 2.1 with Node SDK: Can't invoke the chaincode
body: <p>I am using Hyperledger Fabric 2.1 container in server-1 and node SDK in server-2. My <code>connection-org.json</code> file is given as:</p>
  <pre><code>{
      &quot;name&quot;: &quot;first-network-org2&quot;,
      &quot;version&quot;: &quot;1.0.0&quot;,
      &quot;client&quot;: {
          &quot;organization&quot;: &quot;Org2&quot;,
          &quot;connection&quot;: {
              &quot;timeout&quot;: {
                  &quot;peer&quot;: {
                      &quot;endorser&quot;: &quot;300&quot;
                  }
              }
          }
      },
      &quot;organizations&quot;: {
          &quot;Org2&quot;: {
              &quot;mspid&quot;: &quot;Org2MSP&quot;,
              &quot;peers&quot;: [
                  &quot;peer0.org2.example.com&quot;,
                  &quot;peer1.org2.example.com&quot;
              ],
              &quot;certificateAuthorities&quot;: [
                  &quot;ca.org2.example.com&quot;
              ]
          }
      },
      &quot;peers&quot;: {
          &quot;peer0.org2.example.com&quot;: {
              &quot;url&quot;: &quot;grpcs://192.168.43.233:9051&quot;,
              &quot;tlsCACerts&quot;: {
                  &quot;pem&quot;: &quot;pen file here&quot;
              },
              &quot;grpcOptions&quot;: {
                  &quot;ssl-target-name-override&quot;: &quot;peer0.org2.example.com&quot;,
                  &quot;hostnameOverride&quot;: &quot;peer0.org2.example.com&quot;
              }
          },
          &quot;peer1.org2.example.com&quot;: {
              &quot;url&quot;: &quot;grpcs://192.168.43.233:10051&quot;,
              &quot;tlsCACerts&quot;: {
                  &quot;pem&quot;: &quot;pemfile here&quot;
              },
              &quot;grpcOptions&quot;: {
                  &quot;ssl-target-name-override&quot;: &quot;peer1.org2.example.com&quot;,
                  &quot;hostnameOverride&quot;: &quot;peer1.org2.example.com&quot;
              }
          }
      },
      &quot;certificateAuthorities&quot;: {
          &quot;ca.org2.example.com&quot;: {
              &quot;url&quot;: &quot;https://192.168.43.233:8054&quot;,
              &quot;caName&quot;: &quot;ca.org2.example.com&quot;,
              &quot;tlsCACerts&quot;: {
                  &quot;pem&quot;: &quot;pem file here&quot;
              },
              &quot;httpOptions&quot;: {
                  &quot;verify&quot;: false
              }
          }
      }
  }
  </code></pre>
  <p>When I try to invoke the chaincode from Fabric Node SDK, I get the error below:</p>
  <pre><code>2020-07-09T13:12:19.615Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer0.org2.example.com:9051, url:grpcs://peer0.org2.example.com:9051
  2020-07-09T13:12:19.615Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer0.org2.example.com:9051 url:grpcs://peer0.org2.example.com:9051 timeout:3000
  2020-07-09T13:12:19.615Z - error: [DiscoveryService]: _buildPeer[verificationchannel] - Unable to connect to the discovered peer peer0.org2.example.com:9051 due to Error: Failed to connect before the deadline on Endorser- name: peer0.org2.example.com:9051, url:grpcs://peer0.org2.example.com:9051
  </code></pre>
  <p>What can I do to be able to invoke the chaincode? Is there something that should be changed in the docker-compose configuration?</p>