首页 > 解决方案 > 尝试 ping 时出错。错误:2 UNKNOWN:找不到带有名称的链码

问题描述

这是我尝试做的事情:

如果我使用 server1 和仅包含 orderer、CA 和Peer1的连接配置文件创建卡,则该卡能够 ping 网络。如果我使用 server2 和仅包含 orderer、CA 和Peer2的连接配置文件创建卡,我可以创建卡但无法使用此卡 ping 网络。更多信息 :

1)我的虚拟机能够在任何端口上进行通信。互联网链接不是pb。

2) 如果我使用包含 Ca、Orderer、Peer1 和 Peer0 的 connection.json,则在 VM2 上创建的卡正在工作。

任何想法 ?

您可以询问是否需要更多信息。

谢谢

VM1 上的 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://<IP1>:7050"
    }
},
"peers": {
    "peer0.org1.example.com": {
        "url": "grpc://<IP1>:7051",
        "eventUrl": "grpc://<IP1>:7053"
    }
},
"certificateAuthorities": {
    "ca.org1.example.com": {
        "url": "http://<IP1>:7054",
        "caName": "ca.org1.example.com"
    }
}

}

VM2 上的 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": {
            "peer1.org1.example.com": {}
        }
    }
},
"organizations": {
    "Org1": {
        "mspid": "Org1MSP",
        "peers": [
            "peer1.org1.example.com"
        ],
        "certificateAuthorities": [
            "ca.org1.example.com"
        ]
    }
},
"orderers": {
    "orderer.example.com": {
        "url": "grpc://<IP1>:7050"
    }
},
"peers": {
    "peer1.org1.example.com": {
        "url": "grpc://<IP2>:7051",
        "eventUrl": "grpc://<IP2>:7053"
    }
},
"certificateAuthorities": {
    "ca.org1.example.com": {
        "url": "http://<IP1>:7054",
        "caName": "ca.org1.example.com"
    }
}

}

docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
bad3e19266c6        bridge              bridge              local
bb28a60f158b        composer_default    bridge              local
8002ff68da75        host                host                local
f5c9ac2997e5        none                null                local



docker inspect composer_default
[
    {
        "Name": "composer_default",
        "Id": "bb28a60f158b4c61438b3792c0c2cd5c13d1aa3bbbd6c1cfe8dff88a0232efc1",
        "Created": "2018-05-31T13:56:28.314975468+02:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "<IP2>",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "868f282e3ae67ed3861e9e4729292019b220b3f04dfcf300395251223ba14b68": {
                "Name": "peer1.org1.example.com",
                "EndpointID": "1141dd4d1aa0ed6a4ec1e5dd103a3affa90a8344600969111af433f5ad396d59",
                "MacAddress": "<MACAddress>",
                "IPv4Address": "<IP2>",
                "IPv6Address": ""
            },
            "aa6579c58c1bd2bfde2491a083fc731f7fbc0ec44d609c2105ff6628be14bf15": {
                "Name": "couchdb1",
                "EndpointID": "dddb99538f49524ce5d68fb768cb73c0d96608f57e6fe743ddfc0023a63c6a3e",
                "MacAddress": "<MACAddress>",
                "IPv4Address": "<IP2>",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

标签: hyperledger-fabrichyperledgerhyperledger-composer

解决方案


推荐阅读