首页 > 解决方案 > Fabric 错误中的 BNA 创建

问题描述

我正在将我的 .BNA 文件部署到结构,我已经成功地在 bluemix 操场上对其进行了测试和原型设计,但是,当我尝试将网络应用程序安装到结构时,我得到了错误。

> Error: Error trying install business network. 

>Error: No valid responses from any peers.
>Response from attempted peer comms was an error: 
>Error: 14 UNAVAILABLE: Connect Failed
Command failed

**This is the steps I took** 

 1. Launch your Fabric network
> ./startFabric.sh

2.) Create the peer admin card

> ./createPeerAdminCard.sh

3.) Install the network application to fabric

> composer network install -a dist/bna.bna -c PeerAdmin@hlfv1

**This step is where I get the error**



      ✖ Installing business network. This may take a minute...
    Error: Error trying install business network. Error: No valid responses from any peers.
    Response from attempted peer comms was an error: Error: 14 UNAVAILABLE: Connect Failed
    Command failed
**Details of my env**

    Node Version: v8.11.3
    Docker version: 18.03
    Composer version: v0.19.12

Docker PS:
[Docker PS Screen shot][1]



  [1]: https://i.stack.imgur.com/HQGBf.png


Any help is really appreciated.

更新 hlfv1 的 Connection.json

    {
  "name": "hlfv1",
  "x-type": "hlfv1",
  "x-commitTimeout": 300,
  "version": "1.0.0",
  "client": {
    "organization": "Org1",
    "connection": {
      "timeout": {
        "peer": {
          "endorser": "300",
          "eventHub": "300",
          "eventReg": "300"
        },
        "orderer": "300"
      }
    }
  },
  "channels": {
    "composerchannel": {
      "orderers": [
        "orderer.example.com"
      ],
      "peers": {
        "peer0.org1.example.com": {}
      }
    }
  },
  "organizations": {
    "Org1": {
      "mspid": "Org1MSP",
      "peers": [
        "peer0.org1.example.com"
      ],
      "certificateAuthorities": [
        "ca.org1.example.com"
      ]
    }
  },
  "orderers": {
    "orderer.example.com": {
      "url": "grpc://localhost:7050"
    }
  },
  "peers": {
    "peer0.org1.example.com": {
      "url": "grpc://localhost:7051",
      "eventUrl": "grpc://localhost:7053"
    }
  },
  "certificateAuthorities": {
    "ca.org1.example.com": {
      "url": "http://localhost:7054",
      "caName": "ca.org1.example.com"
    }
  }
}

Hlfv11 vs HLFv1 我注意到当我查看织物文件时,有两个组件 hlfv11 和 hlfv1。

面料工具截图

当我启动 startfabric 时,我得到了 fabric 假设它是 "hlfv11" 而不是 hlfv1 的行在此处输入图像描述

任何帮助,将不胜感激。

docker inspect peer0.org1.example.com
[
    {
        "Id": "6caa83b2a8a5ee976c9066d0bbd98475e5bff885736ec9931606c33f06ccd9ac",
        "Created": "2018-07-20T22:49:51.238208735Z",
        "Path": "peer",
        "Args": [
            "node",
            "start"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 7506,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-07-20T22:49:51.543106588Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:b023f9be07714e495e6d41849d7e916434e85580754423ece145866468ad29a9",
        "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/6caa83b2a8a5ee976c9066d0bbd98475e5bff885736ec9931606c33f06ccd9ac/resolv.conf",
        "HostnamePath": "/mnt/sda1/var/lib/docker/containers/6caa83b2a8a5ee976c9066d0bbd98475e5bff885736ec9931606c33f06ccd9ac/hostname",
        "HostsPath": "/mnt/sda1/var/lib/docker/containers/6caa83b2a8a5ee976c9066d0bbd98475e5bff885736ec9931606c33f06ccd9ac/hosts",
        "LogPath": "/mnt/sda1/var/lib/docker/containers/6caa83b2a8a5ee976c9066d0bbd98475e5bff885736ec9931606c33f06ccd9ac/6caa83b2a8a5ee976c9066d0bbd98475e5bff885736ec9931606c33f06ccd9ac-json.log",
        "Name": "/peer0.org1.example.com",
        "RestartCount": 0,
        "Driver": "aufs",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/var/run:/host/var/run:rw",
                "/Users/wppa/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users:rw",
                "/Users/wppa/fabric-dev-servers/fabric-scripts/hlfv11/composer:/etc/hyperledger/configtx:rw",
                "/Users/wppa/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/peer/msp:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "composer_default",
            "PortBindings": {
                "7051/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "7051"
                    }
                ],
                "7053/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "7053"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/var/run",
                "Destination": "/host/var/run",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/Users/wppa/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users",
                "Destination": "/etc/hyperledger/msp/users",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/Users/wppa/fabric-dev-servers/fabric-scripts/hlfv11/composer",
                "Destination": "/etc/hyperledger/configtx",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/Users/wppa/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp",
                "Destination": "/etc/hyperledger/peer/msp",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "6caa83b2a8a5",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "7051/tcp": {},
                "7053/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "CORE_LOGGING_LEVEL=debug",
                "CORE_CHAINCODE_LOGGING_LEVEL=DEBUG",
                "CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock",
                "CORE_PEER_ID=peer0.org1.example.com",
                "CORE_PEER_ADDRESS=peer0.org1.example.com:7051",
                "CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=composer_default",
                "CORE_PEER_LOCALMSPID=Org1MSP",
                "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/peer/msp",
                "CORE_LEDGER_STATE_STATEDATABASE=CouchDB",
                "CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "FABRIC_CFG_PATH=/etc/hyperledger/fabric"
            ],
            "Cmd": [
                "peer",
                "node",
                "start"
            ],
            "Image": "hyperledger/fabric-peer:x86_64-1.1.0",
            "Volumes": {
                "/etc/hyperledger/configtx": {},
                "/etc/hyperledger/msp/users": {},
                "/etc/hyperledger/peer/msp": {},
                "/host/var/run": {}
            },
            "WorkingDir": "/opt/gopath/src/github.com/hyperledger/fabric",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "d44983248579bb25822020f82382fba01b891c3338b2fe91bb17ac3936126c69",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "composer",
                "com.docker.compose.service": "peer0.org1.example.com",
                "com.docker.compose.version": "1.21.1",
                "org.hyperledger.fabric.base.version": "0.4.6",
                "org.hyperledger.fabric.version": "1.1.0"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "5645c1988100b53fa9a8c2d13adc40c43f3995cb808b3eda28771176033b26b4",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "7051/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "7051"
                    }
                ],
                "7053/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "7053"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/5645c1988100",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "composer_default": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "peer0.org1.example.com",
                        "6caa83b2a8a5"
                    ],
                    "NetworkID": "d4f496b7b3aeae87d1b1461523bc8620ac34b54d9b3b9f8d31c6cfa7be4da024",
                    "EndpointID": "a19687702d04e166dc0291dc9ce1130caf5eccf484ece4fd988c13cc2660c8fb",
                    "Gateway": "172.19.0.1",
                    "IPAddress": "172.19.0.5",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:13:00:05",
                    "DriverOpts": null
                }
            }
        }
    }
]

已修复:需要重新安装 Hyperledger Fabric、composer、node、npm 和 docker。并且需要设置 "unset ${!DOCKER*}" 似乎是一个 docker 问题。

标签: hyperledger-fabrichyperledger-composer

解决方案


ERROR 14 表示您的作曲家无法找到对等方。你的问题在这里:

  "peers": {
    "peer0.org1.example.com": {}
  }

您需要编写如下内容:

"peers": {
    "peer0.org1.example.com": {
        "url": "grpc://localhost:7051",
        "eventUrl": "grpc://localhost:7053"
    }
}

修复:我卸载了 docker、node、npm,并重新安装了一切,并确保在首次为 Mac OS 安装 docker 时使用 unset ${!DOCKER*}


推荐阅读