Hyperledger Explorer无法在8080上启动(发现问题)

时间:2019-05-29 18:34:18

标签: hyperledger-fabric hyperledger-explorer

运行hlf 1.4和kubernetes中的最新资源管理器。资源管理器挂起在尝试到达对等方的开始阶段。如果启动Web界面,它将无法到达代码。

对等方已安装链码,已连接到频道,没有问题。

我已禁用TLS,以使调查更加容易,并将日志放入Channel.js,Peer.js的资源管理器依赖项中,以便更好地进行调查。

我已将日志添加到Channel.js中 /blockchain-explorer/node_modules/fabric-client/lib/Channel.js 打印连接到目标,我可以看到它显示了grpc:// localhost:undefined。我相信它会尝试将请求发送到无效地址,然后默默地死亡。整个文件https://gist.github.com/gad0lin/51384bfea1c207ccf016a0cad8e413b6#file-channel-js-L3474

[{"_options":"1","_url":"2","_endpoint":"3","_name":"4","_request_timeout":45000,"_grpc_wait_for_ready_timeout":3000,
"_endorserClient":"5","_discoveryClient":"6"},{"name":"4","grpc.ssl_target_name_override":"4","grpc.default_authority":"4","grpc.max_receive_message_length":-1,"grpc.max_send_message_length":-1},"grpc://localhost:undefined",{"addr":"7","creds":"8"},"peer1-hlf-peer.peers.svc.cluster.local",
{"$interceptors":"9","$interceptor_providers":"10","$channel":"11"},{"$interceptors":"12","$interceptor_providers":"13","$channel":"14"},"localhost",{},[],[],{},[],[],{}]

这是hlf的配置:

{
  "network-configs": {
    "network-1": {
      "version": "1.0",
      "clients": {
            "cli": {
              "tlsEnable": false,
              "organization": "Org1MSP",
              "channel": "mychannel",
              "credentialStore": {
                  "path": "./tmp/credentialStore_Org1/credential",
                  "cryptoStore": {
                    "path": "./tmp/credentialStore_Org1/crypto"
                }
              }
            }
      },
      "channels": {
          "mychannel": {
              "peers": {
                "peer1-hlf-peer.peers.svc.cluster.local": {}
              },
              "connection": {
               "timeout": {
                 "peer": {
                    "endorser": "30",
                    "eventHub": "30",
                    "eventReg": "30"
                }
              }
            }
          }
      },
      "organizations": {
        "Org1MSP": {
          "certificateAuthorities": ["fabric-ca"],
          "mspid": "Org1MSP",
          "fullpath": true,
          "adminPrivateKey": {
            "path": "/var/hyperledger/msp/admincerts/key.pem"
          },
          "signedCert": {
            "path": "/var/hyperledger/msp/admincerts/cert.pem"
          }
        }
      },
      "peers": {          
        "peer1-hlf-peer.peers.svc.cluster.local": {
          "url": "grpc://peer1-hlf-peer.peers.svc.cluster.local:7051",
           "eventUrl": "grpc://peer1-hlf-peer.peers.svc.cluster.local:7053",
           "grpcOptions": {
              "ssl-target-name-override": "peer1-hlf-peer.peers.svc.cluster.local"
            }
          }
      },
      "orderers": {
        "ord1-hlf-ord.orderers.svc.cluster.local" : {
                "url":"grpc://ord1-hlf-ord.orderers.svc.cluster.local:7050"
              }   
      },
      "certificateAuthorities": {
        "fabric-ca": {
          "url": "http://ca-hlf-ca.cas.svc.cluster.local:7054",
          "httpOptions":{
            "verify": false
          },
          "registrar": {
            "enrollId": "admin",
            "enrollSecret": "adminpw"
          },
          "caName": "ca"
        }    
      }
    }
  }
}{
  "persistence": "postgreSQL",
  "platforms": ["fabric"],
  "postgreSQL": {
    "host": "explorer-db.x.svc.cluster.local",
    "port": "5432",
    "database": "fabricexplorer",
    "username": "hppoc",
    "passwd": "password"
  },
  "sync": {
    "type": "local",
    "platform": "fabric",
    "blocksSyncTime": "3"
  }
}

1 个答案:

答案 0 :(得分:0)

我找到了罪魁祸首。有两个问题。

  1. 我没有在资源管理器配置中将环境变量DISCOVERY_AS_LOCALHOST设置为false。那就是我看到的原因:本地主机。

  2. 在同级中,我设置了变量CORE_PEER_GOSSIP_EXTERNALENDPOINT,但是没有端口。这就是我看到未定义为端口的原因。