1

I am getting timeout error from peers while instantiating chaincode on particular peers from fabric node sdk on linux os.

error: [Peer.js]: sendProposal - timed out after:90000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT

I am able to create channel, join channel, install chaincode with existing settings. What is missing for instantiating the chaincode on peers successfully?

My docker compose settings:

peer0.org1.example.com:
    container_name: peer0.org1.example.com
    extends:
      file:   base.yaml
      service: peer-base
    environment:
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
    ports:
      - 7051:7051
      - 7053:7053
    volumes:
        - ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/crypto/peer
    depends_on:
      - orderer.example.com

Peer base:

version: '2'
services:
  peer-base:
    image: hyperledger/fabric-peer
    environment:
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      # the following setting starts chaincode containers on the same
      # bridge network as the peers
      # https://docs.docker.com/compose/networking/
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=artifacts_default
      - CORE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_GOSSIP_USELEADERELECTION=true
      - CORE_PEER_GOSSIP_ORGLEADER=false
      # The following setting skips the gossip handshake since we are
      # are not doing mutual TLS
      - CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/crypto/peer/msp
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/crypto/peer/tls/server.key
      - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/crypto/peer/tls/server.crt
      - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/crypto/peer/tls/ca.crt
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: peer node start
    volumes:
        - /var/run/:/host/var/run/

network-config for peer:

"org1": {
            "name": "peerOrg1",
            "mspid": "Org1MSP",
            "ca": "https://localhost:7054",
            "peers": {
                "peer1": {
                    "requests": "grpcs://localhost:7051",
                    "events": "grpcs://localhost:7053",
                    "server-hostname": "peer0.org1.example.com",
                    "tls_cacerts": "../artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
                },
                "peer2": {
                    "requests": "grpcs://localhost:7056",
                    "events": "grpcs://localhost:7058",
                    "server-hostname": "peer1.org1.example.com",
                    "tls_cacerts": "../artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
                }   
            },
            "admin": {
                "key": "../artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
                "cert": "../artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
            }
        }

What is legging specifically in network setup? Any possible root cause?

2 Answers2

0

you are correct about the process. If all the operations are good, then I think the docker file is good. But you have to make sure, you can only instantiate the chain code from the peer in which the chain code is installed. Because the chain code installation will not change the channel config.

4t8dds
  • 565
  • 7
  • 19
0

I got an answer after couple of findings.

1) My docker version was 1.7. And its not supported by fabric node sdk anymore. I have to update my docker version. My Cent OS version is 7.0 and its support docker upto 17.6.

2) The instantiation response takes around 2 mins of round trip time. Default timeout is 45 secs for instantiating the chaincode in node sdk. After changing it to 3 mins I can successfully run the whole application.

  • Hi @kmadhu, Can you please share how & where to change the timeout value from 45 secs to 3 mins? I searched for it but did not find anything... – Ajay Jadhav Jun 06 '18 at 13:38