【ERROR】fabric explorer报错 (node:28283) DeprecationWarning: grpc.load: Use the @grpcproto-loader modu

    科技2022-08-06  116

    1、已启动fabric。 2、将fabric-explorer文件夹下的client文件夹中的components替换为中文版的components(前端的js代码)【中文版目前支持Fabric 1.4.x区块链,由汇智网提供,下载地址:https://github.com/ezpod/blockchain-explorer/ 。】 3、相关npm操作执行完毕。 4、尝试启动fabric explorer报错:

    (node:28283) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead /home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/app/persistence/postgreSQL/PgService.js:96 throw err; ^ Error: This socket has been ended by the other party at Socket.writeAfterFIN [as write] (net.js:364:12) at Connection.end (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/node_modules/pg/lib/connection.js:341:22) at Client.end (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/node_modules/pg/lib/client.js:546:21) at PgService.closeconnection (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/app/persistence/postgreSQL/PgService.js:128:15) at Persist.closeconnection (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/app/persistence/postgreSQL/Persist.js:71:18) at Synchronizer.close (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/app/Synchronizer.js:81:21) at shutDown (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/sync.js:35:16) at process.on.up (/home/cielo/go/src/github.com/hyperledger/fabric/blockchain-explorer/sync.js:71:2) at emitOne (events.js:116:13) at process.emit (events.js:211:7)

    解决方案

    未尝试: https://stackoverflow.com/questions/54930636/deprecationwarning-grpc-load-use-the-grpc-proto-loader-module-with-grpc-loadp

    https://github.com/nestjs/nest/issues/980

    https://stackoverflow.com/questions/53637292/deprecationwarning-grpc-load-use-the-grpc-proto-loader-instead

    以上都不对。

    需要在log当中查看问题 log路径:cielo@cielo-ubuntu:~/go/src/github.com/hyperledger/fabric/blockchain-explorer/logs/console$ 可以看到是上次db当中的数据留下了了,这次启动它无法把数据写进去。 将数据库当中每个表格的所有数据删除,或删除所有表重新跑create.db生成表。

    下图为postgresql中的内容:

    删除表后,重新运行fabric explorer 文件夹下的/start.sh,成功。

    (fabric explorer的管理员用户名和密码在配置文件里面,如果是在first network上面跑,配置文件路径为:cielo@cielo-ubuntu:~/go/src/github.com/hyperledger/fabric/blockchain-explorer/app/platform/fabric/connection-profile$ 默认用户名密码:admin adminpw)

    Processed: 0.009, SQL: 8