Hyperledger Indy:开发指南样例代码分析 - 节点 Onboarding

英文指南:https://github.com/hyperledger/indy-sdk/blob/master/doc/getting-started/getting-started.md#step-3-getting-the-ownership-for-stewardss-verinym
翻译版:https://blog.csdn.net/li_jiachuan/article/details/82904143
样例代码:https://github.com/hyperledger/indy-sdk/blob/master/samples/python/src/getting_started.py

    logger.info("Getting started -> started")

    # Steward Agent
    pool_name = 'pool1'
    logger.info("Open Pool Ledger: {}".format(pool_name))
    # 获得 genesis transaction path
    pool_genesis_txn_path = get_pool_genesis_txn_path(pool_name)
    pool_config = json.dumps({"genesis_txn": str(pool_genesis_txn_path)})

    # Set protocol version 2 to work with Indy Node 1.4
    await pool.set_protocol_version(PROTOCOL_VERSION)

    try:
        # 创建 nodes pool
        await pool.create_pool_ledger_config(pool_name, pool_config)
    except IndyError as ex:
        if ex.error_code == ErrorCode.PoolLedgerConfigAlreadyExistsError:
            pass
    # 打开跟 nodes pool 的连接
    pool_handle = await pool.open_pool_ledger(pool_name, None)

    logger.info("========&#
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值