首页 文章

Hyperledger Blockchain Explorer的问题

提问于
浏览
0

我尝试按照此处提供的说明为Hyperledger Fabric 1.0部署Hyperledger Blockchain Explorer:https://github.com/hyperledger/blockchain-explorer

但是,每当我尝试启动main.js时,我都会收到以下错误:

`[2017-11-17 20:57:53.785] [ERROR] Helper - Error: Calling enrollment endpoint failed with error [Error: write EPROTO 140480353146688:error:1411713E:SSL routines:ssl_check_srvr_ecc_cert_and_alg:ecc cert not for signing:../deps/openssl/openssl/ssl/ssl_lib.c:2520:
140480353146688:error:14082130:SSL routines:ssl3_check_cert_and_algorithm:bad ecc cert:../deps/openssl/openssl/ssl/s3_clnt.c:3550:
]
at ClientRequest.<anonymous> (/opt/gopath/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:711:12)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at onwriteError (_stream_writable.js:408:12)
at onwrite (_stream_writable.js:430:5)
at _destroy (internal/streams/destroy.js:39:7)
at TLSSocket.Socket._destroy (net.js:561:3)
[2017-11-17 20:57:53.787] [ERROR] Helper - admin enrollment failed`

我确保正确配置了config.json . 我没有编辑tls设置或路径 . 第一网络(./byfn.sh)生成的证书肯定是正确的,因为byfn设置最终成功 .

我认为资源管理器处理证书的方式有问题,但我不知道在哪里搜索解决方案 .

任何有关上述的帮助将不胜感激!

3 回答

  • 0

    您必须在docker-compose-e2e-template.yaml中提供CA的正确凭据(ca文件夹存在于网络中每个组织的msp文件夹中) .

    对于Eg .

    • FABRIC_CA_SERVER_TLS_CERTFILE = / etc / hyperledger / fabric-ca-server-config / ca.org1.example.com-cert.pem

    • FABRIC_CA_SERVER_TLS_KEYFILE = / etc / hyperledger / fabric-ca-server-config / f0a8e7e64651071b720e47eb4c71a3610cadb185a1ace6c029d8b41688fde6b2_sk

    在卷部分中,以这种方式提供映射 - ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config

    不使用url中的localhost,而是使用Docker使用的IP(仅当您使用Docker QuickStart Terminal时才适用)(在我的情况下,它是192.168.99.100) .

    在enrollAdmin.js文件中,

    var caRootsPath =“./crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem”let data = fs.readFileSync(caRootsPath); let caroots = Buffer.from(data).toString();

    var tlsOptions = {
        trustedRoots: caroots,
        verify: true // Make it false if some error like Hostname/IP doesn't match certificate's altnames: "IP: 192.168.99.100 is not in the cert's list occurs. This error can also be removed if you have admin access to your computer. 
    };
    // be sure to change the http to https when the CA is running TLS enabled
    fabric_ca_client = new Fabric_CA_Client('https://192.168.99.100:7054', tlsOptions , 'ca-org1', crypto_suite);
    
  • 0

    如果您使用的是测试或本地TLS Fabric对等,则还必须执行以下操作:https://github.com/hyperledger/blockchain-explorer

    “如果您要连接到非TLS结构对等体:请修改对等URL中的协议(grpcs-> grpc)和端口(9051-> 9050)并删除tls_cacerts”

    我能够看到一个带有"cannot GET/"和swagger API链接的空白页面:http://localhost:9000/api-docs/#/现在正常 . 我只需要弄清楚业务网络特定密钥/证书的存储位置 .

  • 0

    当我使用Hyperledger Fabric 1.2版本部署区块链资源管理器时,问题再次出现,但解决方案首先无法解决我的问题:

    unknown protocol SSL routines:ssl3_check_cert_and_algorithm:bad ecc cert:../deps/openssl/openssl/ssl/s3_clnt.c:3550:
    

    起初,我认为它是由版本不兼容引起的,因为在我将网络升级到结构1.2或1.1之前似乎工作正常 . 但是,为了区块链资源管理器,不必将我的结构网络降级到1.0 . 在github / composer打开的其他类似问题给了我一些关于这个问题的提示,但仍然不能完全解决它 .

    使用像 node --inspect-brk:0.0.0.0:9229 server.js 这样的同步调试工具可以帮我解决这个问题:

    我的错误日志与上面打印的日志相同,发生在 FabricCAClientImpl.js:711:12 . 要去定义代码,它会抛出一个错误:

    request.on('error', function (err) {
    reject(new Error(util.format('Calling enrollment endpoint failed with error [%s]', err)));
    });
    

    使用 self._httpClient.request 发送http请求后调用该函数:

    var request = self._httpClient.request(requestOptions, function (response)
    

    查看 self._httpClient 的定义,它显示模块 https 是在代码的头部导入的 . 这就是为什么某些解决方案建议我们将 TLS_ENABLEfalse 更改为 true ,并在配置文件中将 grpcs 修改为 grpc . 但在后一版本中,结构使用连接配置文件来帮助我们加载keycerts .

    官方连接配置文件示例文件默认使用 https ,但我们可以将其更改为 http url并强制客户端使用http策略,如:

    ca:
      url: http://localhost:7054
      httpOptions:
         verify: true
    

相关问题