【问题标题】:Regarding How front end application access the wallet in hyperledger fabric关于前端应用程序如何访问超级账本结构中的钱包
【发布时间】:2019-08-26 21:24:54
【问题描述】:

在 Hyperledger 结构中,钱包是否会保存在手机和笔记本电脑等用户设备中,如果前端存储用户设备,它将如何使用钱包?

提前致谢

【问题讨论】:

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


    【解决方案1】:

    是的,您可以将钱包存储在用户设备中,例如 fabcar 示例。如果你去registerUser.js,你会观察到:

     // Create a new file system based wallet for managing identities.
            const walletPath = path.join(process.cwd(), 'wallet');
            const wallet = new FileSystemWallet(walletPath);
            console.log(`Wallet path: ${walletPath}`);
    
            // Check to see if we've already enrolled the user.
            const userExists = await wallet.exists('user1');
            if (userExists) {
                console.log('An identity for the user "user1" already exists in the wallet');
                return;
            }
    

    a walletPath 声明在您选择用于存储身份和管理身份的目录的位置。正如您在userExists 中看到的,它检查用户1 的证书是否存在于钱包目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-27
      • 2021-08-26
      • 1970-01-01
      相关资源
      最近更新 更多