0

我有一个使用 Composer 创建的正在运行的业务网络。我已经公开了 REST API,一切看起来都很好!然而...

我现在想找到有关网络的各种配置数据来连接 Hyperledger Explorer,所以我需要以下内容:

{
    "network-config": {
        "org1": {
            "name": "peerOrg1",
            "mspid": "Org1MSP",
            "peer1": {
                "requests": "grpcs://127.0.0.1:7051",
                "events": "grpcs://127.0.0.1:7053",
                "server-hostname": "peer0.org1.example.com",
                "tls_cacerts": "fabric-path/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
            },
            "peer2": {
                "requests": "grpcs://127.0.0.1:8051",
                "events": "grpcs://127.0.0.1:8053",
                "server-hostname": "peer1.org1.example.com",
                "tls_cacerts": "fabric-path/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
            },
            "admin": {
                "key": "fabric-path/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
                "cert": "fabric-path/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
            }
        },
    },
    "host": "localhost",
    "port": "8080",
    "channel": "mychannel",
    "keyValueStore": "/tmp/fabric-client-kvs",
    "eventWaitTime": "30000",
}

此外,我想了解如何扩展我的网络,即部署到真实节点(不仅仅是 IBM 云)。

谢谢!

4

2 回答 2

1

我在下面粘贴了一个示例,该示例为我在 Composer v0.17 的开发结构上工作。我建议您检查频道名称和加密材料的位置。另请注意,Composer Playground 也使用端口 8080,因此您可能会在那里看到端口冲突

    {
"network-config": {
    "org1": {
        "name": "peerOrg1",
        "mspid": "Org1MSP",
        "peer1": {
            "requests": "grpc://127.0.0.1:7051",
            "events": "grpc://127.0.0.1:7053",
            "server-hostname": "peer0.org1.example.com",
            "tls_cacerts": "/home/ibm/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
        },
        "admin": {
            "key": "/home/ibm/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
            "cert": "/home/ibm/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
        }
    }
},
"host": "localhost",
"port": "8081",
"channel": "composerchannel",
"keyValueStore": "/tmp/fabric-client-kvs",
"eventWaitTime": "30000",
"mysql": {
    "host": "127.0.0.1",
    "port": "3306",
    "database": "fabricexplorer",
    "username": "root",
    "passwd": "******"
}
}

本文档可以帮助您扩展 Fabric

于 2018-04-09T16:02:04.290 回答
0

我找到了为每个网络获取上述配置的方法。创建 Fabric Composer 网络时,您将拥有以下文件夹:

~/fabric-tools

它将包含一个名为的文件Devserver_connection.json,您将在其中找到对等方的grpc地址。

同样在该文件夹中,您可以深入了解文件系统以访问:

~/fabric-tools/fabric-scripts/hlfv1/composer/crypto-config

在这里,您将找到允许浏览器访问您的网络所需的密钥。

祝你好运!

于 2018-04-10T09:16:24.327 回答