linux - 实例化链码,sendPeersProposal - Promise 被拒绝 : Error: REQUEST_TIMEOUT, Hyperledger Fabric,linux

标签 linux hyperledger-fabric blockchain hyperledger

我在 linux 操作系统上从 fabric 节点 sdk 在特定对等点上实例化链代码时收到来自对等点的超时错误。

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

我能够创建 channel 、加入 channel 、使用现有设置安装链代码。在节点上成功实例化链代码缺少什么?

我的 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 是什么?任何可能的根本原因?

最佳答案

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

关于linux - 实例化链码,sendPeersProposal - Promise 被拒绝 : Error: REQUEST_TIMEOUT, Hyperledger Fabric,linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49493581/

相关文章:

hyperledger-fabric - 如何捕获 Hyperledger Fabric 上的交易生成的事件?

Javascript 二进制字符串,转十六进制,转base58,转回十六进制,转回字符串,随机错误

linux - 更改目录中满足某些条件的文件列表的权限?

linux - 为了获得ELF二进制文件的大小,size和ls有什么区别?

linux - 子域重定向到 haproxy 中的同一后端

linux - 列出目录中的文件名并将输出放在文本文件中

node.js - 从 Hyperledger Fabric Node SDK 中的函数 InvokeChaincode() 获取链码调用者 ID

javascript - Hyperledger Composer 查询 Assets 参数

javascript - 向本地托管的 ganache 服务器发出curl 请求

cryptography - 发送和传输仅适用于应付地址类型的对象,不适用于地址类型的对象。