Hyperledger 资源管理器为空,并显示查询 - 错误:尚未为此客户端分配任何标识



我最近安装了Hyperledger Explorer。运行资源管理器时,它不会向浏览器返回任何内容,并给出错误:

postgres://hppoc:password@127.0.0.1:5432/fabricexplorer
Please open web browser to access :http://localhost:8080/
[2018-04-16 08:15:18.542] [ERROR] Query - Error: No identity has been assigned to this client
    at Client._getSigningIdentity (/home/ubuntu/blockchain-explorer/node_modules/fabric-client/lib/Client.js:1206:11)
    at Channel.queryInfo (/home/ubuntu/blockchain-explorer/node_modules/fabric-client/lib/Channel.js:896:36)
    at helper.getOrgAdmin.then (/home/ubuntu/blockchain-explorer/app/query.js:98:18)
    at <anonymous>

我试图console.log blockchain-explorer/node_modules/fabric-client/lib/Client.js:1206:11的输出确实admin变量是undefined

这很奇怪,因为我在此之前安装了 Composer,它运行得很好。所有crypto-config都使用作曲家示例提供的默认设置。

版本

(几乎是最新的稳定版本(:

  • 操作系统: Ubuntu 16.04 LTS
  • Docker: 18.03.0-ce
  • 节点:v8.11.1
  • 超级账本结构:1.1.0
  • 超级账本作曲家:0.19

资源管理器config.json几乎是默认的,没有TLS:

{
    "network-config": {
            "org1": {
                    "name": "hlfv1",
                    "mspid": "Org1MSP",
                    "peer1": {
                            "requests": "grpc://127.0.0.1:7051",
                            "events": "grpc://127.0.0.1:7053",
                            "server-hostname": "peer0.org1.example.com"
                    },
                    "admin": {
                            "key": "/home/ubuntu/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
                            "cert": "/home/ubuntu/fabric-tools/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
                    }
            }
    },
    "host": "localhost",
    "port": "8080",
    "channel": "composerchannel",
    "keyValueStore": "/tmp/fabric-client-kvs",
    "eventWaitTime": "30000",
    "pg": {
            "host": "127.0.0.1",
            "port": "5432",
            "database": "fabricexplorer",
            "username": "hppoc",
            "passwd": "password"
    },
    "license": "Apache-2.0"
}

我错过了什么/提示?事先谢谢。

1.查看您的"签名者"文件夹。Hyperledger 浏览器只接受 pem 文件,不接受 x509 证书(也许它在上一版本中已经更改,我不知道,我仍然使用旧版本的资源管理器(。要从证书中获取 PEM 文件,请仅从-----开始证书-----MII 中选取部分 ...直到。。。1EHbso=-----结束证书-----并删除所有行尾 ((,最后将文件命名为 admin.pem。

您可能还需要重命名"密钥库"文件夹中的私钥文件。删除"-priv"并替换为"_sk"。

阿拉伯数字。我不知道它是否区分大小写,但您使用的身份是"admin",同时,在您的密钥库和证书路径中,身份是"管理员"。

我遇到了同样的问题,但是只需在config.json上向对等配置(网络config.org1.peer1.tls_cacerts(添加tls_cacerts,我的情况得到了改善。我仍然在日志上收到相同的错误,但现在我可以在Hyperledger Explorer上看到块。

  • 优麒麟 16.04.1 LTS
  • Docker 版本 17.05.0-ce,内部版本 89658be
  • 节点 v8.11.1
  • 超级账本结构 1.1.0
    • 已禁用红绿灯
  • 超级账本编辑器:v0.19.1

根据Hyperledger Explorer聊天中的对话,这似乎是一个忽略同行而没有tls_cacerts的错误。在我的猜测中,下面的代码可能是带来了这个错误。https://github.com/hyperledger/blockchain-explorer/blob/master/app/helper.js#L251

我遇到了同样的问题。

就我而言,这是因为我忘记了这些步骤:

cd client
npm install
npm run build

让这个东西工作。实际上有几个问题。

1. It does work only with TLS. Non-tls doesn't work.
2. The node version has to be 8.9.x.
3. There is one more config file apart from the config.json in the main directory. app/platform/fabric/config.json it has the n/w definition only for the sample n/w/. So this will have issues working with n/w which was not started using the byfn script. Changing this config file allows you to connect to any fabric n/w.

这是因为您的客户端_adminSigningIdentity为空。您可以通过通过以下方式打印客户端对象来检查它:-

  1. 导入实用程序模块 ( var util = require('util') (
  2. 通过console.log(util.inspect(client))或打印客户端值按控制台.log ( client.getClientConfig())

如果输出是这样的


{ organization: 'org1',
  credentialStore: 
   { path: '/home/babita/Desktop/My network/fabric-client-kv-org',
     wallet: 'wallet-name',
     cryptoStore: { path: '/tmp/fabric-client-kv-org' } },
  mspid: 'RepackagersMSP' }
Client {
  _cryptoSuite: 
   CryptoSuite_ECDSA_AES {
     _keySize: 256,
     _hashAlgo: 'SHA2',
     _cryptoKeyStore: 
      CryptoKeyStore {
        logger: [Object],
        _store: null,
        _storeConfig: [Object],
        _getKeyStore: [Function] },
     _curveName: 'secp256r1',
     _ecdsaCurve: 
      PresetCurve {
        curve: [Object],
        ...
        hash: [Object] },
     _hashFunction: [Function],
     _hashOutputSize: 32,
     _ecdsa: 
      EC {
        curve: [Object],
        ...
        hash: [Object] } },
  _clientConfigMspid: 'OrgMSP',
  _stateStore: 
   FileKeyValueStore {
     _dir: '/home/babita/Desktop/My network/fabric-client-kv-repackagers' },
  _userContext: null,
  _network_config: 
   NetworkConfig_1_0 {
     _network_config: 
      { version: '1.0',
        name: 'Network',
        'x-type': 'hlfv1',
        description: 'your Network',
        channels: [Object],
        organizations: [Object],
        orderers: [Object],
        peers: [Object],
        certificateAuthorities: [Object],
        client: [Object] },
     _client_context: [Circular],
     _network_config_loc: '/home/babita/Desktop/My network/artifacts/network-config.yaml',
     _peers: Map {},
     _channel: Map {},
     _orderers: Map {} },
  _msps: Map {},
  _devMode: false,
  _adminSigningIdentity: null,
  _tls_mutual: {},
  _organizations: Map {},
  _certificateAuthorities: Map {},
  _channels: Map {},
  _connection_options: {} }

您的_adminSigningIdentity为空

您可以通过以下方式修复它:-

client.setAdminSigningIdentity 方法 (https://fabric-sdk-node.github.io/Client.html#setAdminSigningIdentity(

相关内容

最新更新