[英]Access locally hosted Hyperledger Fabric from local network
我正在嘗試使用Fabric SDK訪問本地托管的Hyperledger Fabric。 從本地計算機調用事務沒有問題。 但是,當我嘗試使用Fabric SDK從同一網絡中的其他計算機運行腳本時,我不斷收到錯誤消息。
我在config.json中指定了我的本地IP地址
{
"channel_name": "mychannel",
"smart_contract_name": "smartcontract",
"connection_file": "local_fabric_connection.json",
"appAdmin": "admin",
"appAdminSecret": "adminpw",
"orgMSPID": "Org1MSP",
"caName": "ipaddress:port",
"userName": "user1",
"gatewayDiscovery": { "enabled": true, "asLocalhost": false }
}
我還嘗試通過將localhost更改為連接文件中的IP地址來使用本地IP地址:
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpc://ipaddress:17051"
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "http://ipaddress:17054",
"caName": "ca.org1.example.com"
}
}
是否有任何不同的設置我必須更改才能從另一台機器訪問Fabric?
我正在使用VSCode中的IBM Blockchain Extension開發智能合約。
當我運行我的腳本“query.js”時,我不斷收到此錯誤:
[Remote.js]: Error: Failed to connect before the deadline URL:grpc://peer0.org1.example.com:17051
我通過從config.json中刪除gatewayDiscovery來解決問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.