Aca-py 0.6.0:未提供信息分类帐实例 error/bug?
Aca-py 0.6.0: INFO Ledger instance not provided error/bug?
我是 Hyperledger Aries 的新手,我不知道自己做错了什么。
环境:
- Ubuntu16LTS
- Docker 18.09.7 构建 2d0083d
- hyperledger-aries-python 版本:0.6.0(源代码)
来自aca-py repo (https://github.com/hyperledger/aries-cloudagent-python i 运行:
./scripts/run_docker 开始-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 --trace
注意:我尝试了不同的 pool_genesis_transaction 文件并尝试以各种方式传递它们(通过 URL,通过位于 docker 容器中的文件)。它总是掉落相同或相似的信息:
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...
查看演示我只是不知道为什么我的白羊座无法连接到任何 indy-ledger。
将 indy-cli 与相同的 genesis-files 一起使用效果很好。 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 首先使用 provision 命令来配置你的 aca-py 实例。为此使用参数 wallet-type indy
- 运行 aca-py 通常使用启动命令和您的配置参数。一定要使用 --wallet-type indy 标志才能连接到一个 indy 账本
长话短说:
在 aries-cloudagent-python (aca-py) 代码中,使用哪个分类帐(例如 indy 分类帐)的配置似乎来自指定的钱包类型。
1st.: 提供参数:--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
3rd.: https://github.com/hyperledger/aries-cloudagent-python/blob/main/DevReadMe.md 处的 aca-py 文档明确指出:
Running Locally: For local development, we recommend using the provided Docker scripts to run the ACA-Py software
4th.: aca-py 可以使用安装在docker 容器中的sqlite。查看aca-py是否兼容sqlite,运行
./scripts/run_docker start --help
其中 returns 可用参数列表。其中之一是:
--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
returns
Successfully tagged aries-cloudagent-run:latest
Created new profile
Profile backend: indy
Profile name: test
No public DID
Ledger configured
这很奇怪,因为现在他能够找到 sqlite。这似乎正确配置了数据库,因此可以使用它。但是因为它在 docker 容器内,并且容器丢弃所有更改,所以此内部配置将永远不可用。
第六。为了解决这个问题,我在 Ubuntu18LTS 上安装了来自 https://pypi.org/project/aries-cloudagent/
的 aries cloud-agent 本地包
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
连接到我的分类帐
我是 Hyperledger Aries 的新手,我不知道自己做错了什么。
环境:
- Ubuntu16LTS
- Docker 18.09.7 构建 2d0083d
- hyperledger-aries-python 版本:0.6.0(源代码)
来自aca-py repo (https://github.com/hyperledger/aries-cloudagent-python i 运行:
./scripts/run_docker 开始-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 --trace
注意:我尝试了不同的 pool_genesis_transaction 文件并尝试以各种方式传递它们(通过 URL,通过位于 docker 容器中的文件)。它总是掉落相同或相似的信息:
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...
查看演示我只是不知道为什么我的白羊座无法连接到任何 indy-ledger。 将 indy-cli 与相同的 genesis-files 一起使用效果很好。 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 首先使用 provision 命令来配置你的 aca-py 实例。为此使用参数 wallet-type indy
- 运行 aca-py 通常使用启动命令和您的配置参数。一定要使用 --wallet-type indy 标志才能连接到一个 indy 账本
长话短说:
在 aries-cloudagent-python (aca-py) 代码中,使用哪个分类帐(例如 indy 分类帐)的配置似乎来自指定的钱包类型。
1st.: 提供参数:--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
3rd.: https://github.com/hyperledger/aries-cloudagent-python/blob/main/DevReadMe.md 处的 aca-py 文档明确指出:
Running Locally: For local development, we recommend using the provided Docker scripts to run the ACA-Py software
4th.: aca-py 可以使用安装在docker 容器中的sqlite。查看aca-py是否兼容sqlite,运行
./scripts/run_docker start --help
其中 returns 可用参数列表。其中之一是:
--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
returns
Successfully tagged aries-cloudagent-run:latest
Created new profile
Profile backend: indy
Profile name: test
No public DID
Ledger configured
这很奇怪,因为现在他能够找到 sqlite。这似乎正确配置了数据库,因此可以使用它。但是因为它在 docker 容器内,并且容器丢弃所有更改,所以此内部配置将永远不可用。
第六。为了解决这个问题,我在 Ubuntu18LTS 上安装了来自 https://pypi.org/project/aries-cloudagent/
的 aries cloud-agent 本地包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
连接到我的分类帐