启动资源管理器时出现以下错误:
<<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>
TypeError: Cannot read property 'size' of undefined
at Platform.initialize (/home/kp/Desktop/blockchain-explorer/app/platform/fabric/Platform.js:52:45)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Received kill signal, shutting down gracefully
Closed out connections使用Fabric v1.2和Explorerv0.3.6,我用grpc替换了grpcs,但这也没有多大帮助。不确定在配置文件中将“size”属性传递到何处。
{
"network-configs":{
"network-1":{
"version":"1.0",
"clients":{
"client-1":{
"tlsEnable":true,
"organization":"Org1MSP",
"channel":"mychannel",
"credentialStore":{
"path":"./tmp/credentialStore_Org1/credential",
"cryptoStore":{
"path":"./tmp/credentialStore_Org1/crypto"
}
}
}
},
"channels":{
"mychannel":{
"peers":{
"peer0.org1.example.com":{
}
},
"connection":{
"timeout":{
"peer":{
"endorser":"6000",
"eventHub":"6000",
"eventReg":"6000"
}
}
}
}
},
"organizations":{
"Org1MSP":{
"mspid":"Org1MSP",
"fullpath":false,
"adminPrivateKey":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/"
},
"signedCert":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/"
}
},
"Org2MSP":{
"mspid":"Org2MSP",
"adminPrivateKey":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/"
}
},
"OrdererMSP":{
"mspid":"OrdererMSP",
"adminPrivateKey":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore/"
}
}
},
"peers":{
"peer0.org1.example.com":{
"tlsCACerts":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"url":"grpc://localhost:7051",
"eventUrl":"grpc://localhost:7053",
"grpcOptions":{
"ssl-target-name-override":"peer0.org1.example.com"
}
},
"peer1.org1.example.com":{
"tlsCACerts":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"url":"grpc://localhost:8051",
"eventUrl":"grpc://localhost:8053",
"grpcOptions":{
"ssl-target-name-override":"peer1.org1.example.com"
}
},
"peer0.org2.example.com":{
"tlsCACerts":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"url":"grpc://localhost:9051",
"eventUrl":"grpc://localhost:9053",
"grpcOptions":{
"ssl-target-name-override":"peer0.org2.example.com"
}
},
"peer1.org2.example.com":{
"tlsCACerts":{
"path":"/home/kp/Desktop/bct/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"url":"grpc://localhost:10051",
"eventUrl":"grpc://localhost:10053",
"grpcOptions":{
"ssl-target-name-override":"peer1.org2.example.com"
}
}
},
"orderers":{
"orderer.example.com":{
"url":"grpc://localhost:7050"
}
}
},
"network-2":{
}},"configtxgenToolPath":"/home/kp/Desktop/bct/fabric-samples/bin/","license":"Apache-2.0“}
发布于 2018-09-20 14:36:28
TypeError: Cannot read property 'size' of undefined
at Platform.initialize (/home/kp/Desktop/blockchain-explorer/app/platform/fabric/Platform.js:52:45)根据Platform.js的说法,这意味着由于某种原因无法加载你的config.json。您需要查看以下视点:
我不认为它与这个问题有关,但是当禁用TLS时,您需要将config.json中的'tlsEnable‘改为'false’。
{
"network-configs": {
"network-1": {
"clients": {
"client-1": {
"tlsEnable": false,
^^^^^发布于 2018-10-17 11:51:14
你对这个问题有什么解决方案吗?我使用link https://github.com/hyperledger/blockchain-explorer逐步部署了Hyperledger Explorer,在使用fabric v1.2和composer v0.20.0时遇到了与您相同的错误
发布于 2019-08-30 23:44:32
我得到了同样的错误,在我这边,“network-configs”标签丢失了。在控制台日志中,就在此错误之前,我收到了一条消息,显示‘*初始化已启动hyperledger fabric platform *,',未定义
如果检查platform.js中的代码,您可以看到未定义的变量对应于网络配置。
我在原始文件夹中创建了一个简单的config.json文件,如下所示:
{
"network-configs": {
"first-network": {
"name": "firstnetwork",
"profile": "./connection-profile/first-network.json",
"enableAuthentication": false
}
},
"license": "Apache-2.0"然后我创建了一个完整的档案文档,以
{
"name": "first-network",
"version": "1.0.0",我不确定是否真的有必要拆分文件,但不管怎样,对我来说,这个过程解决了这个问题。
https://stackoverflow.com/questions/52363329
复制相似问题