【问题标题】:Instantiate chaincode, sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT, Hyperledger Fabric, linux实例化链码,sendPeersProposal - 承诺被拒绝:错误:REQUEST_TIMEOUT,Hyperledger Fabric,linux
【发布时间】:2018-03-26 14:14:03
【问题描述】:

我在从 linux os 上的结构节点 sdk 实例化特定对等点上的链码时收到来自对等点的超时错误。

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

我可以使用现有设置创建频道、加入频道、安装链代码。在对等点上成功实例化链码缺少什么?

我的 docker compose 设置:

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

同行基础:

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/

对等体的网络配置:

"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"
            }
        }

什么是网络设置中的legging?任何可能的根本原因?

【问题讨论】:

  • 你在安装后最初是否调用了链码?
  • @nmanh 不。我的系列:创建频道 -> 加入频道 -> 安装链码。

标签: linux hyperledger-fabric blockchain hyperledger


【解决方案1】:

你对这个过程是正确的。如果所有的操作都很好,那么我认为docker文件是好的。但是您必须确保,您只能从安装链码的对等方实例化链码。因为链码安装不会改变通道配置。

【讨论】:

  • 是的,没错@wandy。我试图仅在特定对等设备上安装后实例化。
【解决方案2】:

经过几次调查后,我得到了答案。

1) 我的 docker 版本是 1.7。 Fabric node sdk 不再支持它。我必须更新我的 docker 版本。我的 Cent OS 版本是 7.0,它支持 docker 到 17.6。

2) 实例化响应大约需要 2 分钟的往返时间。默认超时为 45 秒,用于在节点 sdk 中实例化链码。将其更改为 3 分钟后,我可以成功运行整个应用程序。

【讨论】:

  • 嗨@kmadhu,你能分享一下如何以及在哪里将超时值从45秒更改为3分钟吗?我搜索了它,但没有找到任何东西......
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-27
  • 2019-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多