0

我已经按照并完成了教程

https://medium.com/@malliksarvepalli/hyperledger-fabric-1-2-on-multiple-hosts-using-docker-swarm-and-compose-11c13635e69e

我连接了 3 台主机,所有服务都已启动。当我在 PC2 主机中运行 ./script.sh 时,我得到了正确的结果。现在我正在关注下一个教程,即:

https://medium.com/@malliksarvepalli/hyperledger-explorer-with-fabric-1-2-running-on-multiple-hosts-89c5af691b7e

任何人都可以在本教程中启发我吗?我发现我应该使用 ubuntu 16.04 创建一个新主机并安装以下先决条件:

节点 8.11.x

PostgreSQL 9.5 或更高版本

Jq

我对吗?

在 exploreconfig.json 我更新了 postgres 变量:

主机:192.168.1.136(第 4 个虚拟机 ip),端口:5432,用户名:postgres,密码:psql,数据库:fabric

他们是正确的吗?

我还修改了 config.json 文件中的 Orderer、Org1 [peer0 & peer1)、Org2(peer0 & peer1) IP 地址,其中网络已启动并正在运行的前三个 Vms 的 ips。

并遵循其余的说明和测试,但是当我运行命令 ./start.sh 时,我在控制台中有日志:

false 'ssl-certs' '/home/database/blockchain-explorer/ssl-certs'

postgres://christy:christy@192.168.1.136:5432/fabric

error when connecting to db: { Error: connect ECONNREFUSED 192.168.1.136:5432

at Object._errnoException (util.js:992:11)

at _exceptionWithHostPort (util.js:1014:20)

at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

code: 'ECONNREFUSED',

errno: 'ECONNREFUSED',

syscall: 'connect',

address: '192.168.1.136',

port: 5432 }

******* Initialization started for hyperledger fabric platform ******, { 

'network-1': 

 { version: '1.0',

 clients: { 'client-1': [Object] },

 channels: { mychannel: [Object] },

 organizations: { Org1MSP: [Object], Org2MSP: [Object], OrdererMSP: 
 [Object] },

  peers: 

   { 'peer0.org1.ntua.com': [Object],

    'peer1.org1.ntua.com': [Object],

    'peer0.org2.ntua.com': [Object],

    'peer1.org2.ntua.com': [Object] },

    orderers: { 'orderer.ntua.com': [Object] } },

    'network-2': {} }

   client_configs.name  undefined  client_configs.profile  undefined

   FabricUtils.createFabricClient 

   <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

   Error :  [ 'Invalid platform configuration, Please check the log' ]

   error when connecting to db: TypeError: Cannot read property 'on' of 
   undefined

  at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

  explorer/app/persistence/postgreSQL/PgService.js:68:16)

  at ontimeout (timers.js:498:11)

  at tryOnTimeout (timers.js:323:5)

  at Timer.listOnTimeout (timers.js:290:5)


  <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

  TypeError: "callback" argument must be a function

  at setTimeout (timers.js:450:11)

  at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

  explorer/app/persistence/postgreSQL/PgService.js:85:5)

  at ontimeout (timers.js:498:11)

  at tryOnTimeout (timers.js:323:5)

  at Timer.listOnTimeout (timers.js:290:5)

  Received kill signal, shutting down gracefully

  Closed out connections

  false 'ssl-certs' '/home/database/blockchain-explorer/ssl-certs'

   postgres://christy:christy@192.168.1.136:5432/fabric

   error when connecting to db: { Error: connect ECONNREFUSED 192.168.1.136:5432

   at Object._errnoException (util.js:992:11)

   at _exceptionWithHostPort (util.js:1014:20)

   at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

   code: 'ECONNREFUSED',

   errno: 'ECONNREFUSED',

   syscall: 'connect',

   address: '192.168.1.136',

   port: 5432 }


   ******* Initialization started for hyperledger fabric platform ******, 
  { 

  'network-1': 

  { version: '1.0',

   clients: { 'client-1': [Object] },

   channels: { mychannel: [Object] },

   organizations: { Org1MSP: [Object], Org2MSP: [Object], OrdererMSP: 

   [Object] },

   peers: 

   { 'peer0.org1.ntua.com': [Object],

     'peer1.org1.ntua.com': [Object],

     'peer0.org2.ntua.com': [Object],

     'peer1.org2.ntua.com': [Object] },

    orderers: { 'orderer.ntua.com': [Object] } },

    'network-2': {} }

    client_configs.name  undefined  client_configs.profile  undefined

    FabricUtils.createFabricClient 

    <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

    Error :  [ 'Invalid platform configuration, Please check the log' ]

    error when connecting to db: TypeError: Cannot read property 'on' of 
    undefined

   at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

   explorer/app/persistence/postgreSQL/PgService.js:68:16)

   at ontimeout (timers.js:498:11)

   at tryOnTimeout (timers.js:323:5)

   at Timer.listOnTimeout (timers.js:290:5)

   <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

   TypeError: "callback" argument must be a function

   at setTimeout (timers.js:450:11)

   at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

   explorer/app/persistence/postgreSQL/PgService.js:85:5)

   at ontimeout (timers.js:498:11)

   at tryOnTimeout (timers.js:323:5)

   at Timer.listOnTimeout (timers.js:290:5)

   Received kill signal, shutting down gracefully

   Received kill signal, shutting down gracefully

   Closed out connections

如果还需要其他日志,请告诉我。任何帮助都会有所帮助。非常感谢。

4

1 回答 1

1

我可以给你一些方面来检查你的环境。

  • 首先,您需要检查您是否能够从您尝试启动 Hyperledger Explorer 的 vm 访问 postgresql DB(4th's vm)。如果没有,我认为您需要更改您的 postgres 配置(postgresql.conf/pg_hba.conf)以启用外部访问。

    $ sudo -u postgres psql -h 192.168.1.136 -d fabric -c 'table peer'

  • 其次,请确认您确实在第 4 个虚拟机上运行了 ./createdb.sh。如果更改了数据库名称,还需要对齐脚本

    $ cd app/persistence/fabric/postgreSQL/db/

    $ ./createdb.sh

于 2019-07-31T07:46:47.980 回答