【问题标题】:failed constructing descriptor for chaincodes为链码构造描述符失败
【发布时间】:2020-10-20 20:48:50
【问题描述】:

我正在尝试从用户那里进行交易,但是当我尝试获取频道时,我收到了这个错误:

微服务日志:

error: [DiscoveryService]: send[mychannel] - Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"mychannel" >
createTransaction Error: Cannot do transaction in blockchain: DiscoveryService: mychannel error: failed constructing descriptor for chaincodes:<name:"mychannel" >
at FabricRepository.<anonymous> (/app/microservice/dist/services/blockchain-client.js:235:23)
at Generator.throw (<anonymous>)
at rejected (/app/microservice/dist/services/blockchain-client.js:6:65)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
POST /fabric-service/createTransaction 997.103

对等日志:

2020-10-20 20:23:54.218 UTC [discovery.endorsement] func1 -> DEBU d98 Endpoint: peer0.org2.com:7052, InternalEndpoint: , PKI-ID: 82f87b1ae00364c30ce6293dd804af5f81462b137b8e4d151580b9fcafa9b4c9, Metadata:  satisfies principal principal:"\n\013Org2MSP\020\003" 
2020-10-20 20:23:54.218 UTC [discovery.endorsement] func1 -> DEBU d99 Endpoint: peer0.org2.com:7052, InternalEndpoint: , PKI-ID: 82f87b1ae00364c30ce6293dd804af5f81462b137b8e4d151580b9fcafa9b4c9, Metadata:  doesn't satisfy principal principal:"\n\007Org2MSP\020\003"  : the identity is a member of a different MSP (expected Org1MSP, got Org2MSP)
2020-10-20 20:23:54.218 UTC [discovery] chaincodeQuery -> ERRO d9a Failed constructing descriptor for chaincode chaincodes:<name:"mychannel" > ,: no peer combination can satisfy the endorsement policy

配置:

    mychannel:
        Consortium: MyConsortium
        <<: *ChannelDefaults
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org1
                - *Org2
            Capabilities:
                <<: *ApplicationCapabilities

总的来说,如果我从 org1 Peer 执行相同的事务,我会在对等端收到类似的错误,两者都失败了。如果我从联盟中删除一个组织,它正在从该组织工作,但当两者都存在时则不是

知道如何解决这个问题吗?

【问题讨论】:

  • 您要执行什么交易?您是否已正确配置您的客户以使用组织的凭据?两个组织都加入频道了吗?智能合约实例化了吗?
  • 客户端配置为仅使用 org2,是的,两个 orgs 都已加入,并且在通道上提交了正确的链码(这得到了他们俩的批准)。

标签: hyperledger-fabric hyperledger-fabric-sdk-js


【解决方案1】:

一般情况下,如果交易中使用的链码名称与将链码部署到网络时使用的名称不匹配,则会出现此错误。

如果链码未实例化或未在通道中定义,有时会发生这种情况。最好检查 Docker 容器以了解此错误背后的原因并确保链代码名称相同(注意大小写) 如果您正在运行 FB 测试网络,您可以使用

./monitordocker.sh fabric_test

【讨论】:

    【解决方案2】:

    所以问题在于为组织创建锚点对等点的脚本,错误通过 bash 泄漏。在为两个组织添加锚节点后,事情就解决了,我可以进行交易了。

    【讨论】:

    • 如何为 Orgs 添加锚节点?
    【解决方案3】:

    问题可能来自configtx.yaml,你必须正确放置所有“MSPDir”,当你发出命令时,你必须根据那个“MSPDir”设置环境变量。

    【讨论】:

    • 正确设置了 MSP 目录。如果您仔细观察,二分之一满足校长
    猜你喜欢
    • 2020-03-09
    • 2022-06-10
    • 2021-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-04
    相关资源
    最近更新 更多