不能在Fabric中列出对等链码。

7

我在我的Mac上启动了一个面料样品网络,并在peer0.org1.example.com中安装了一个链码。

在操作后:

docker exec -it cli bash

现在我使用

peer chaincode -C myChannel list --instantiated

但是收到了错误消息:
Error: Error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [myChannel] creator org [Org1MSP]

我对这个错误一无所知。看起来好像是权限错误。如果你能帮我解决这个问题,我将不胜感激。


你使用的是哪个示例? - Gari Singh
1个回答

1
根据错误信息,来自文件msgvalidation.go,方法ValidateProposalMessage片段如下:
// validate the signature
err = checkSignatureFromCreator(shdr.Creator, signedProp.Signature, signedProp.ProposalBytes, chdr.ChannelId)
if err != nil {
    // log the exact message on the peer but return a generic error message to
    // avoid malicious users scanning for channels
    putilsLogger.Warningf("channel [%s]: %s", chdr.ChannelId, err)
    sId := &msp.SerializedIdentity{}
    err := proto.Unmarshal(shdr.Creator, sId)
    if err != nil {
        // log the error here as well but still only return the generic error
        err = errors.Wrap(err, "could not deserialize a SerializedIdentity")
        putilsLogger.Warningf("channel [%s]: %s", chdr.ChannelId, err)
    }
    return nil, nil, nil, errors.Errorf("access denied: channel [%s] creator org [%s]", chdr.ChannelId, sId.Mspid)
}

看起来你在这一步失败了:


err = checkSignatureFromCreator(shdr.Creator, signedProp.Signature, signedProp.ProposalBytes, chdr.ChannelId)

您的签名提案无效,

  1. 您是否正确指定了环境变量?
 export CORE_PEER_ADDRESS=peer.org1.example.com:17051

 export CORE_PEER_LOCALMSPID=Org1MSP

 export CORE_PEER_MSPCONFIGPATH=xxx/msp

2.您是否使用管理员证书发送此交易?

3.请提供更有用的信息,例如警告信息(从源代码中获取,警告信息可能更有帮助),而不仅仅是错误信息。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接