gpt4 book ai didi

python - Aca-py 0.6.0 : INFO Ledger instance not provided error/bug?

转载 作者:行者123 更新时间:2023-12-04 15:03:00 27 4
gpt4 key购买 nike

我是 Hyperledger Aries 的新手,我无法弄清楚我做错了什么。
环境:

  • Ubuntu16LTS
  • Docker 18.09.7 构建 2d0083d
  • hyperledger-aries-python 版本:0.6.0(源代码)

  • 从 aca-py 存储库( https://github.com/hyperledger/aries-cloudagent-python 我运行:
    ./scripts/run_docker start -e http://host.docker.internal:8000 -it http 0.0.0.0 8000 -ot http --admin 0.0.0.0 11000 --admin-insecure-mode --log-level DEBUG --genesis-url https://raw.githubusercontent.com/CHempel-esatus/SSI4DE_Genesis/master/pool_transactions_genesis - 痕迹
    注意:我尝试了不同的 pool_genesis_transaction 文件并尝试以各种方式传递它们(通过 URL,通过位于 docker conainer 中的文件)。它总是丢弃相同或相似的信息:
    2021-03-12 09:48:32,311 aries_cloudagent.config.ledger INFO Ledger instance not provided
    2021-03-12 09:48:32,312 aries_cloudagent.core.conductor WARNING No ledger configured
    这是完整的输出:
    2021-03-12 09:48:31,035 asyncio DEBUG Using selector: EpollSelector
    2021-03-12 09:48:31,036 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.out_of_band
    2021-03-12 09:48:31,037 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.actionmenu
    2021-03-12 09:48:31,038 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.routing
    2021-03-12 09:48:31,039 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.discovery
    2021-03-12 09:48:31,041 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.introduction
    2021-03-12 09:48:31,041 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.problem_report
    2021-03-12 09:48:31,042 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.coordinate_mediation
    2021-03-12 09:48:31,043 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.present_proof
    2021-03-12 09:48:31,044 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.trustping
    2021-03-12 09:48:31,045 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.didexchange
    2021-03-12 09:48:31,047 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.issue_credential
    2021-03-12 09:48:31,048 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.basicmessage
    2021-03-12 09:48:31,050 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.protocols.connections
    2021-03-12 09:48:31,051 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.holder
    2021-03-12 09:48:31,057 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.ledger
    2021-03-12 09:48:31,072 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.messaging.credential_definitions
    2021-03-12 09:48:31,085 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.messaging.schemas
    2021-03-12 09:48:31,091 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.revocation
    2021-03-12 09:48:31,105 aries_cloudagent.core.plugin_registry DEBUG Loaded module: aries_cloudagent.wallet
    2021-03-12 09:48:31,119 aries_cloudagent.config.ledger INFO Fetching genesis transactions from: https://raw.githubusercontent.com/CHempel-esatus/SSI4DE_Genesis/master/pool_transactions_genesis
    2021-03-12 09:48:32,302 aries_cloudagent.core.profile INFO Create profile manager: in_memory
    2021-03-12 09:48:32,311 aries_cloudagent.config.ledger INFO Ledger instance not provided
    2021-03-12 09:48:32,312 aries_cloudagent.core.conductor WARNING No ledger configured

    ::::::::::::::::::::::::::::::::::::::::::::::
    :: Aries Cloud Agent ::
    :: ::
    :: ::
    :: Inbound Transports: ::
    :: ::
    :: - http://0.0.0.0:8000 ::
    :: ::
    :: Outbound Transports: ::
    :: ::
    :: - http ::
    :: - https ::
    :: ::
    :: Administration API: ::
    :: ::
    :: - http://0.0.0.0:11000 ::
    :: ::
    :: ver: 0.6.0 ::
    ::::::::::::::::::::::::::::::::::::::::::::::

    Listening...
    查看演示,我只是不知道为什么我的 aries 无法连接到任何 indy-ledger。
    使用具有相同创世文件的 indy-cli 工作正常。 CLI 能够连接,所以我假设所有 pool_genesis_files 都正确。
    我做错了什么还是缺少什​​么?

    最佳答案

    我终于找到了解决方案。我是如何找到它的故事:
    短篇小说:
    先决条件:在您的机器上安装 indy-sdk、aries-cloudagent、python3_indy 和 python 3.6.9+。如果您不知道该怎么做,请参阅长篇故事。
    Python 3.6.9 随 Ubuntu18LTS 开箱即用

  • 在本地安装 aries-cloudagent-python (aca-py)。
  • 首先使用配置命令运行 aca-py 来配置您的 aca-py 实例。使用参数 wallet-type indy
  • 使用 start 命令和您的配置参数正常运行 aca-py。请务必使用 --wallet-type indy 标志才能连接到 indy 分类帐

  • 长篇故事:
    在 aries-cloudagent-python (aca-py) 代码中,使用哪个分类帐(例如 indy 分类帐)的配置似乎来自指定的钱包类型。
    第一:提供参数:--wallet-type indy
    -> 这返回了错误,需要 --wallet-name 和 --wallet-key 参数。所以我提供了他们:
    ./scripts/run_docker start 
    -e http://127.0.0.1:8000
    -it http 127.0.0.1 8000
    -ot http
    --admin 127.0.0.1 11000
    --admin-insecure-mode
    --log-level DEBUG
    --genesis-url https://raw.githubusercontent.com/CHempel-esatus/SSI4DE_Genesis/master/pool_transactions_genesis
    --trace
    --recreate-wallet
    --wallet-type indy
    --wallet-name test
    --wallet-key 12345
    2nd.:这导致以下错误,告诉没有提供钱包的数据库。
    2021-03-16 09:19:45,447 indy.libindy DEBUG _indy_loop_callback: >>> command_handle: 0, err , args: (0,)
    2021-03-16 09:19:45,447 indy.libindy WARNING _indy_loop_callback: Function returned error
    2021-03-16 09:19:45,449 indy.libindy DEBUG _indy_loop_callback <<<
    2021-03-16 09:19:45,449 aries_cloudagent.commands.start ERROR Exception during startup:
    Traceback (most recent call last):
    File "/home/indy/aries_cloudagent/indy/sdk/wallet_setup.py", line 169, in open_wallet
    credentials=json.dumps(self.wallet_access),
    File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/site-packages/indy/wallet.py", line 127, in open_wallet
    open_wallet.cb)
    indy.error.WalletNotFoundError

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "/home/indy/aries_cloudagent/commands/start.py", line 72, in init
    await startup
    File "/home/indy/aries_cloudagent/commands/start.py", line 28, in start_app
    await conductor.setup()
    File "/home/indy/aries_cloudagent/core/conductor.py", line 91, in setup
    self.root_profile, self.setup_public_did = await wallet_config(context)
    File "/home/indy/aries_cloudagent/config/wallet.py", line 40, in wallet_config
    profile = await mgr.open(context, profile_cfg)
    File "/home/indy/aries_cloudagent/indy/sdk/profile.py", line 161, in open
    opened = await indy_config.open_wallet()
    File "/home/indy/aries_cloudagent/indy/sdk/wallet_setup.py", line 182, in open_wallet
    ) from x_indy
    File "/home/indy/aries_cloudagent/indy/sdk/wallet_setup.py", line 169, in open_wallet
    credentials=json.dumps(self.wallet_access),
    File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/site-packages/indy/wallet.py", line 127, in open_wallet
    open_wallet.cb)
    aries_cloudagent.core.error.ProfileNotFoundError: Wallet 'test' not found: Error: Wallet not found
    Caused by: No wallet database exists
    第三:aca-py 的文档在 https://github.com/hyperledger/aries-cloudagent-python/blob/main/DevReadMe.md明确地说:

    Running Locally: For local development, we recommend using the provided Docker scripts to run the ACA-Py software


    第四:aca-py 可以使用安装在 docker 容器中的 sqlite。要查看 aca-py 是否与 sqlite 兼容,请运行 ./scripts/run_docker start --help它返回可用参数的列表。一种是:
    --wallet-storage-type <storage-type>
    Specifies the type of Indy wallet backend to use.
    Supported internal storage types are 'basic' (memory),
    'default' (sqlite), and 'postgres_storage'. The
    default, if not specified, is 'default'. [env var:
    ACAPY_WALLET_STORAGE_TYPE]

    第五名:运行
    ./scripts/run_docker provision 
    -e http
    --genesis-url
    https://raw.githubusercontent.com/CHempel-esatus/SSI4DE_Genesis/master/pool_transactions_genesis
    --recreate-wallet
    --wallet-type indy
    --wallet-name test
    --wallet-key 12345
    返回
    Successfully tagged aries-cloudagent-run:latest
    Created new profile
    Profile backend: indy
    Profile name: test
    No public DID
    Ledger configured
    这很奇怪,因为现在他能够找到sqlite。这似乎正确配置了数据库,因此可以使用它。但是因为它在一个 docker 容器内,并且容器会丢弃每一次更改,所以这个内部配置将永远不可用。
    6.为了解决这个问题,我在 Ubuntu18LTS 上安装了来自 https://pypi.org/project/aries-cloudagent/ 的本地云代理包。
    pip3 install aries-cloudagent
    pip3 install python3_indy
    并遵循 indy-sdk https://github.com/hyperledger/indy-sdk 的安装说明
    我还在本地机器上安装了 sqlite:
    sudo apt install sqlite
    7th。:在我重新启动系统后,我执行:
    aca-py provision -e http://127.0.0.1:8000 --genesis-url https://raw.githubusercontent.com/CHempel-esatus/SSI4DE_Genesis/master/pool_transactions_genesis --recreate-wallet --wallet-type indy --wallet-name test --wallet-key test
    回来
    Created new profile
    Profile backend: indy
    Profile name: test
    No public DID
    Ledger configured

    8th。:在那之后,我云运行 aca-py 并使用 admin-REST-api 连接到我的分类帐
    enter image description here

    关于python - Aca-py 0.6.0 : INFO Ledger instance not provided error/bug?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66640173/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com