0

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

Peer 已安装链码,连接到通道,没有问题。

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

我已将日志添加到 /blockchain-explorer/node_modules/fabric-client/lib/Channel.js 中的 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"
  }
}
4

1 回答 1

0

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

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

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

于 2019-05-30T16:06:21.360 回答