4

启动资源管理器时出现以下错误:

<<<<<<<<<<<<<<<<<<<<<<<<<< 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 和 Explorer v0.3.6,我已将 grpcs 替换为 grpc,但这也无济于事。不确定在配置文件中传递“大小”属性的位置。

{
   "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" }

4

3 回答 3

0

我得到了同样的错误,在我这边标签“network-configs”:丢失了。在控制台日志中,就在此错误之前,我收到一条消息,提示“为超级账本结构平台 ****** 开始初始化 *******”,未定义

如果您检查了 platform.js 中的代码,您可以看到未定义的变量对应于 network-configs。

我在原始文件夹中创建了一个简单的 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",

我不确定是否真的有必要拆分文件,但无论如何在我这边这个程序解决了这个问题。

于 2019-08-30T15:44:31.713 回答
0

你有解决这个问题的方法吗?我通过链接https://github.com/hyperledger/blockchain-explorer逐步部署了 Hyperledger Explorer ,我遇到了与使用 fabric v1.2 和 composer v0.20.0 相同的错误

于 2018-10-17T03:51:13.783 回答
0
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。您需要从以下观点进行审查:

  • 检查日志/app/app.log
  • 与原始 config.json 的区别

而且我认为它与此问题无关,但是在禁用 TLS 时,您需要将 config.json 中的 'tlsEnable' 变为 'false'。

{
   "network-configs": {
     "network-1": {
       "clients": {
         "client-1": {
           "tlsEnable": false,
                        ^^^^^
于 2018-09-20T06:36:28.220 回答