bugfix> docker > 投稿
[
    {
        "Name": "composer_default",
        "Id": "1b06e8bd3c547c739285284f89d416b6bae6cad8d8a5437659cc2877136c5e8f",
        "Created": "2018-05-25T06:42:35.269643488Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "1963ad6763c63f3e4dd15b0a4717ddee5c2fe39dad90edbd75c4a0c4f412439b": {
                "Name": "orderer.example.com",
                "EndpointID": "a34529bb554dd0a7f3ad706cf95536112774b209619364dd98f7edbb5317b150",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "46237b2a21b2a2dbb513ccea7e93793538bcdeaf583e82911c2451f7ee109faf": {
                "Name": "couchdb",
                "EndpointID": "398a01a0f85cf91ddb23933ded579597263135cbe5b027a73d9bbe374837a06f",
                "MacAddress": "02:42:ac:12:00:04",
                "IPv4Address": "172.18.0.4/16",
                "IPv6Address": ""
            },
            "5baee4bb30d087b0d622954228be91509124f632a81774fb382fe0e80111d32b": {
                "Name": "ca.org1.example.com",
                "EndpointID": "a458f59f8d3fa2600f6eb933ee685bffc08ac83cd793ad707f9188b1a07fb6a9",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            },
            "651d6d2878104cc496b0bafd6466b70d8a45ef462cc06130e93e0a50214d1f99": {
                "Name": "peer0.org1.example.com",
                "EndpointID": "9e9a7c2c3164d6258e5bd3231376772703fe2d621978e0760e44569fc3c8c567",
                "MacAddress": "02:42:ac:12:00:05",
                "IPv4Address": "172.18.0.5/16",
                "IPv6Address": ""
            },
            "da6a8ade513c4fb9b1a351f42e0a06f2e26f0eb471fa08832aa3863285e2f384": {
                "Name": "dev-peer0.org1.example.com-usps-imts-network-0.0.2",
                "EndpointID": "0f73549d1c16abb13fe1a2d1a1a175e6161ad3d155064033654a436669468b9e",
                "MacAddress": "02:42:ac:12:00:06",
                "IPv4Address": "172.18.0.6/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

この composer_default に追加するコンテナに別のNode.jsアプリがあります通信網。 orderer.example.com このネットワーク内の独自のコンテナにもあります。 Node.jsアプリがコンテナ外にあったとき、以前は grpc://localhost:7050 を実行していました接続する。

コンテナ内にあるので、 grpc://<WHAT-IP-SHOULD-I-USE>:7050

コンテナ名 grpc://orderer.example.com:7050 を試しました 、ネットワークゲートウェイ grpc://172.18.0.1:7050 、接続できません。

回答 1 件
  • コンテナ名またはIPが機能するため、 http:localhost:7050  =>  http://orderer.example.com:7050  または http://172.18.0.3:7050

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

あなたの答え