【问题标题】:fabric-sdk-node fails to retrieve the context of an existing userfabric-sdk-node 无法检索现有用户的上下文
【发布时间】:2019-10-04 12:03:19
【问题描述】:

我在调用函数<async> getUserContext(name, checkPersistence) 时遇到了一些问题,到目前为止,我知道它仅在我尝试获取现有用户的上下文时才会失败,但它确实适用于非现有用户。

我用来创建客户端对象和调用函数的代码如下:

const config = '-connection-profile-path';
        const client = hfc.loadFromConfig(hfc.getConfigSetting(`network${config}`));
        client.loadFromConfig(hfc.getConfigSetting(`${this.orgId}${config}`));
        await client.initCredentialStores();
        const admin = await client.getUserContext('admin', true);

错误是:

[2019-10-04 11:41:38.701] [错误] utils/registerUser - 类型错误: 无法读取未定义的属性“曲线”

据我所知,这没有任何意义。我发现的唯一解决方案是检查证书是否是最新的,即删除它并让 runApp.sh 和 setupAPIs.sh (我正在使用 hyperledger/fabric-samples 中的余额转移示例)使用所有这些证书再次创建文件夹。

【问题讨论】:

    标签: hyperledger-fabric hyperledger-fabric-ca hyperledger-fabric-sdk-js


    【解决方案1】:

    我发现唯一的问题是我使用的 docker 容器中的用户与 State Store 中的用户不同步。因此,如果您使用 docker,请确保保持用户同步。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多