2017-08-28 61 views
0

我們需要在碼頭集裝箱的網絡之外運行「composer」命令。 當我在/ etc/hosts文件中指定訂購者和對等主機名(例如peer0.org1.example.com)時,「composer」命令似乎工作。如何在composer連接配置文件中指定規範服務器名稱?

但是,如果我指定服務器的IP地址,它不起作用。這裏是示例。

$ composer network list -p hlfv1 -n info-share-bc -i PeerAdmin -s secret 

✖ List business network info-share-bc 
Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed 

Command succeeded 

這是在/ etc/hosts中指定主機名時的命令示例。

$ composer network list -p hlfv1 -n info-share-bc -i PeerAdmin -s secret 

✔ List business network info-share-bc 
name:  info-share-bc 
models: 
    - org.hyperledger.composer.system 
    - bc.share.info 
<snip> 

我相信當服務器名稱無法得到解決,我們將這裏描述指定稱爲「SSL的目標名稱覆蓋」的選項,hyperledger Node.js的SDK。

https://jimthematrix.github.io/Remote.html

- ssl-target-name-override {string} Used in test environment only, 
when the server certificate's hostname (in the 'CN' field) does not 
match the actual host endpoint that the server process runs at, 
the application can work around the client TLS verify failure by 
setting this property to the value of the server certificate's hostname 

是否有任何選項,連接配置文件(connection.json)來指定主機名?

+0

找到解決辦法:連接配置文件中的hostnameOverride選項解決了連接問題。 「eventURL」:「grpcs:// :17053」, 「hostnameOverride」:「peer0.org1.example.com」, – ibmamnt

回答

1

在連接配置文件中發現了一項解決方法:hostnameOverride選項解決了連接問題。

"eventURL": "grpcs://<target-host>:17053", 
"hostnameOverride": "peer0.org1.example.com", 
相關問題