【问题标题】:How to resolve to that discovery Service does not work: "failed constructing descriptor for chaincodes :<name:"txcc" >"如何解决该发现服务不起作用:“为链码构造描述符失败:<名称:”txcc“>”
【发布时间】:2020-03-09 00:09:51
【问题描述】:

当我使用 SDK 查询我的链码的背书时,出现错误

“获取通道 [mychannel] 的通道响应时出错:发现状态代码:(11) UNKNOWN。描述:从发现服务器收到错误:构建链码描述符失败:”

当我在终端执行以下命令时,出现“连接发现服务失败:无法创建新连接:超出上下文截止时间”

./bin/discover --configFile conf.yaml peers --channel mychannel  --server peer0.org1.example.com:7051

这是我的配置。

services:
    ca.org1.example.com:
        container_name: ca.org1.example.com
        image: hyperledger/fabric-ca
        environment:
            - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
            - FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
            - FABRIC_CA_SERVER_TLS_ENABLED=true
            - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
            - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${CA_PKEY}
            - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
            - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${CA_PKEY}
        ports:
            - "7054:7054"
        command: sh -c 'fabric-ca-server start --ca.certfile /ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/${CA_PKEY} -b admin:adminpw -d'
        volumes:
            - ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
        networks:
            default:
                aliases:
                    - ca.org1.example.com



    peer0.org1.example.com:
        container_name: peer0.org1.example.com
        image: hyperledger/fabric-peer
        environment:
            # - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
            #       # - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=172.31.159.129:5984
            - CORE_PEER_ID=peer0.org1.example.com
            - CORE_PEER_NETWORKID=aberic
            - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
            - CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052
            - CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
            - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
            - CORE_PEER_LOCALMSPID=Org1MSP
            - CORE_PEER_ADDRESSAUTODETECT=true

            - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
            - CORE_VM_DOCKER_ATTACHSTDOUT=true
              # 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=aberic_default
            - CORE_VM_DOCKER_TLS_ENABLED=true
              # - CORE_LOGGING_LEVEL=ERROR
            - CORE_LOGGING_LEVEL=DEBUG
            - CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
            - CORE_PEER_GOSSIP_USELEADERELECTION=true
            - CORE_PEER_GOSSIP_ORGLEADER=false
            - CORE_PEER_PROFILE_ENABLED=true
            - CORE_PEER_TLS_ENABLED=true
            - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
            - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
            - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
        volumes:
            - /var/run/:/host/var/run/
            - ../examples/chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
            - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
            - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
        command: peer node start
        ports:
            - 7051:7051
            - 7052:7052
            - 7053:7053
        networks:
            default:
                aliases:
                    - peer0.org1.example.com
        extra_hosts:
            - "orderer0.example.com:[A ip]"
            - "orderer1.example.com:[B ip]"
            - "orderer2.example.com:[B ip]"

    cli:
        container_name: cli
        image: hyperledger/fabric-tools
        tty: true
        environment:
            - GOPATH=/opt/gopath
            - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
              # - CORE_LOGGING_LEVEL=ERROR
            - CORE_LOGGING_LEVEL=DEBUG
            - CORE_PEER_ID=cli
            - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
            - CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
            - CORE_PEER_LOCALMSPID=Org1MSP
            - CORE_PEER_TLS_ENABLED=true
            - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
            - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
            - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
            - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
        volumes:
            - /var/run/:/host/var/run/
            - ../examples/chaincode/go/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
            - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
            - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
        depends_on:
            - peer0.org1.example.com
        extra_hosts:
            - "orderer0.example.com:[A ip]"
            - "orderer1.example.com:[B ip]"
            - "orderer2.example.com:[C ip]"
            - "peer0.org1.example.com:[A ip]"
            - "peer0.org2.example.com:[B ip]"
            - "peer0.org3.example.com:[C ip]"

【问题讨论】:

  • 我使用 Fabric-go-SDK
  • 谁能帮帮我!!!!!!
  • 可能合约名称不是部署中使用的合约定义。

标签: hyperledger-fabric hyperledger-fabric-sdk-go


【解决方案1】:

您在discover 命令中缺少--peerTLSCA tls/ca.crt。按照 this 链接获取文档

SDK_GO

  1. 您是否更新了anchor peers
  2. 如果您分享您的代码的 sn-p,那就太好了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-06-10
    • 2014-12-13
    • 2021-07-09
    • 1970-01-01
    • 1970-01-01
    • 2012-07-13
    • 1970-01-01
    • 2010-10-15
    相关资源
    最近更新 更多