大理石,无法在本地网络上安装链码 - 错误"此身份不是管理员"

时间:2018-03-29 01:51:43

标签: hyperledger-fabric

我正在关注指南并使用本地网络 我通过fabric-sample / fabcar的3个脚本创建了admin证书,它运行正常。 但是当我尝试安装链代码时,它会给出以下错误消息。

info: [fcw] Going to enroll with admin cert!  peer_urls=[grpc://localhost:7051], channel_id=mychannel, uuid=marblesDockerComposeNetworkmychannelOrg1MSPfabricpeerorg1, orderer_url=grpc://localhost:7050, msp_id=Org1MSP
debug: added peer grpc://localhost:7051
debug: [fcw] Successfully got enrollment marblesDockerComposeNetworkmychannelOrg1MSPfabricpeerorg1
---------------------------------------
info: Now we install
---------------------------------------
debug: [fcw] Installing Chaincode
debug: [fcw] Sending install req targets=[grpc.http2.keepalive_time=300, grpc.keepalive_time_ms=300000, grpc.http2.keepalive_timeout=35, grpc.keepalive_timeout_ms=3500, grpc.max_receive_message_length=-1, grpc.max_send_message_length=-1, grpc.primary_user_agent=grpc-node/1.10.0, _url=grpc://localhost:7051, addr=localhost:7051, , _request_timeout=90000, , _name=null], chaincodePath=marbles, chaincodeId=marbles, chaincodeVersion=v4
info: [packager/Golang.js]: packaging GOLANG from marbles
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 2 UNKNOWN: chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
    at new createStatusError (/Volumes/dev/qukuailian/marbles-master/node_modules/grpc/src/client.js:64:15)
    at /Volumes/dev/qukuailian/marbles-master/node_modules/grpc/src/client.js:583:15
error: [fcw] Failed to obtain endorsement for transaction. code=2, , details=chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
error: [fcw] Error in install catch block object code=2, , details=chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
---------------------------------------
info: Install done. Errors: parsed=Blockchain network error - [This identity is not an admin])), raw=[code=2, , details=chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))]

connection_profile_local.json配置如下

{
    "name": "Docker Compose Network",
    "x-networkId": "not-important",
    "x-type": "hlfv1",
    "description": "Connection Profile for an Hyperledger Fabric network on a local machine",
    "version": "1.0.0",
    "client": {
        "organization": "Org1MSP",
        "credentialStore": {
            "path": "/Volumes/dev/qukuailian2/fabric-samples/fabcar/hfc-key-store"
        }
    },
    "channels": {
        "mychannel": {
            "orderers": [
                "fabric-orderer"
            ],
            "peers": {
                "fabric-peer-org1": {
                    "endorsingPeer": true,
                    "chaincodeQuery": true,
                    "ledgerQuery": true,
                    "eventSource": true
                }
            },
            "chaincodes": [
                "marbles:v4"
            ],
            "x-blockDelay": 10000
        }
    },
    "organizations": {
        "Org1MSP": {
            "mspid": "Org1MSP",
            "peers": [
                "fabric-peer-org1"
            ],
            "certificateAuthorities": [
                "fabric-ca"
            ],
            "x-certJson": {
                "path": "/Volumes/dev/qukuailian2/fabric-samples/fabcar/hfc-key-store/user1"
            }
        }
    },
    "orderers": {
        "fabric-orderer": {
            "url": "grpc://localhost:7050"
        }
    },
    "peers": {
        "fabric-peer-org1": {
            "url": "grpc://localhost:7051",
            "eventUrl": "grpc://localhost:7053"
        }
    },
    "certificateAuthorities": {
        "fabric-ca": {
            "url": "http://localhost:7054",
            "httpOptions": {
                "verify": true
            },
            "registrar": [
                {
                    "enrollId": "admin",
                    "enrollSecret": "adminpw"
                }
            ],
            "caName": null
        }
    }
}

我的frbric示例版本是v1.0.4,大理石版本是4.0

1 个答案:

答案 0 :(得分:0)

本地对等方的msp文件夹中的admincerts文件夹应包含一个管理成员之一的证书(通常为msp / signcerts / cert.pem)。