bcgov / issuer-kit

Verifiable Credential Issuer Starter Kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible to attach hosted ledger on EC2

SuryaSHalwasia opened this issue · comments

I am running a hosted von-network on EC2 and I have ensured the port 9000 is open for communication and the nodes are able to communicate to each other. I tested it and am able to access it. I changed the ledger url to the ip at port 9000 and am getting the following errors.

2024-01-10 18:16:06,314 aries_cloudagent.commands.start ERROR Exception during startup:
issuer-kit-agent-1 | Traceback (most recent call last):
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/commands/start.py", line 72, in init
issuer-kit-agent-1 | await startup
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/commands/start.py", line 28, in start_app
issuer-kit-agent-1 | await conductor.setup()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/core/conductor.py", line 184, in setup
issuer-kit-agent-1 | if not await ledger_config(
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/config/ledger.py", line 136, in ledger_config
issuer-kit-agent-1 | }
issuer-kit-agent-1 | Shutting down
issuer-kit-agent-1 | async with ledger:
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/ledger/indy_vdr.py", line 308, in aenter
issuer-kit-agent-1 | await self.pool.context_open()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/ledger/indy_vdr.py", line 229, in context_open
issuer-kit-agent-1 | await self.open()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/ledger/indy_vdr.py", line 192, in open
issuer-kit-agent-1 | self.handle = await open_pool(transactions=txns, socks_proxy=self.socks_proxy)
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/indy_vdr/pool.py", line 177, in open_pool
issuer-kit-agent-1 | await pool.refresh()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/indy_vdr/pool.py", line 58, in refresh
issuer-kit-agent-1 | await bindings.pool_refresh(self.handle)
issuer-kit-agent-1 | File "/usr/local/lib/python3.9/asyncio/futures.py", line 284, in await
issuer-kit-agent-1 | yield self # This tells Task to wait for completion.
issuer-kit-agent-1 | File "/usr/local/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
issuer-kit-agent-1 | future.result()
issuer-kit-agent-1 | File "/usr/local/lib/python3.9/asyncio/futures.py", line 201, in result
issuer-kit-agent-1 | raise self._exception
issuer-kit-agent-1 | indy_vdr.error.VdrError: Pool timeout: Request was interrupted
issuer-kit-api-1 | debug: Agent not ready, retrying in 500ms...
issuer-kit-api-1 | debug: Agent not ready, retrying in 500ms...
issuer-kit-agent-1 exited with code 0

Im running in the exact configuration of demo mode just changed the ledger to the one hosted on EC2. Am I missing something? Thanks.

@SuryaSHalwasia, what does the genesis file look like for your network? It needs to list the publicly available IP addresses and ports of the nodes. I think the URL you updated is only used to fetch the genesis file from a von-network instance. The nodes themselves need to be publicly accessible and will use port 9701 through 9708.

Example; http://test.bcovrin.vonx.io/genesis

The startup command for that instance of von-network is:

./manage start 138.197.138.255 LOG_LEVEL=info RUST_LOG=error POOL_CONNECTION_DELAY=20 POOL_CONNECTION_ATTEMPTS=30 WEB_SERVER_HOST_PORT=80 "LEDGER_INSTANCE_NAME=BCovrin Test" "INFO_SITE_TEXT=digital.gov.bc.ca/digital-trust" "INFO_SITE_URL=https://digital.gov.bc.ca/digital-trust/" "LEDGER_CACHE_PATH=/home/indy/.indy_client/ledger-cache/ledger-cache-db" "INDY_SCAN_URL=http://test.bcovrin.vonx.io:3707/home/BCOVRIN_TEST" "INDY_SCAN_TEXT=IndyScan - BCovrin Test"

Hey, so I have hosted the ledger on http://18.219.79.245/ using the above command.
But I'm getting the same issues are below.

issuer-kit-api-1 | debug: Agent not ready, retrying in 500ms...
issuer-kit-keycloak-1 | 2024-01-10 20:25:15,513 WARN [io.quarkus.agroal.runtime.DataSources] (main) Datasource enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
issuer-kit-api-1 | debug: Agent not ready, retrying in 500ms...
issuer-kit-agent-1 | 2024-01-10 20:25:15,990 aries_cloudagent.commands.start ERROR Exception during startup:
issuer-kit-agent-1 | Traceback (most recent call last):
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/commands/start.py", line 72, in init
issuer-kit-agent-1 | await startup
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/commands/start.py", line 28, in start_app
issuer-kit-agent-1 | await conductor.setup()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/core/conductor.py", line 184, in setup
issuer-kit-agent-1 | if not await ledger_config(
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/config/ledger.py", line 136, in ledger_config
issuer-kit-agent-1 | async with ledger:
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/ledger/indy_vdr.py", line 308, in aenter
issuer-kit-agent-1 | await self.pool.context_open()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/ledger/indy_vdr.py", line 229, in context_open
issuer-kit-agent-1 | await self.open()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/aries_cloudagent/ledger/indy_vdr.py", line 192, in open
issuer-kit-agent-1 | self.handle = await open_pool(transactions=txns, socks_proxy=self.socks_proxy)
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/indy_vdr/pool.py", line 177, in open_pool
issuer-kit-agent-1 | await pool.refresh()
issuer-kit-agent-1 | File "/home/aries/.local/lib/python3.9/site-packages/indy_vdr/pool.py", line 58, in refresh
issuer-kit-agent-1 | await bindings.pool_refresh(self.handle)
issuer-kit-agent-1 | File "/usr/local/lib/python3.9/asyncio/futures.py", line 284, in await
issuer-kit-agent-1 | yield self # This tells Task to wait for completion.
issuer-kit-agent-1 | File "/usr/local/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
issuer-kit-agent-1 | future.result()
issuer-kit-agent-1 | File "/usr/local/lib/python3.9/asyncio/futures.py", line 201, in result
issuer-kit-agent-1 | raise self._exception
issuer-kit-agent-1 | indy_vdr.error.VdrError: Pool timeout: Request was interrupted
issuer-kit-agent-1 | }
issuer-kit-agent-1 | Shutting down
issuer-kit-keycloak-1 | 2024-01-10 20:25:16,226 WARN [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal

I'm using the same configuration as demo.
Thanks.

@SuryaSHalwasia, If you look at the genesis file you'll see it's using the internal IP addresses of the nodes; http://18.219.79.245/genesis. You need to start von-network using the public IP address of the server, as indicated in the examples above. The command I provided is ONLY an example. Please update the IP address and values appropriately for your environment, and remove any references to the BCovrin Test environment. Since you've already run von-network once, you'll have to run ./manage rm to delete all of the stored values and start over.

@WadeBarnes yes thanks. Using this majorly for testing purposes. Thank you. The ledger is running just getting one error in my BCWallet.

credential_error

Do I also need to host the issuer-web as currently thats running on my local desktop? Thanks

Are you using a custom version of the BC Wallet that has been configured to connect to your von-network instance?

Also since you reset the ledger, you'll have to reset everything else too; agents, wallets, etc.

@SuryaSHalwasia, Here is a startup command customized for your environment. Could you use it rather than the only with all the command line options from the example please:

./manage start 18.219.79.245 LOG_LEVEL=info RUST_LOG=error POOL_CONNECTION_DELAY=20 POOL_CONNECTION_ATTEMPTS=30 WEB_SERVER_HOST_PORT=80 "LEDGER_CACHE_PATH=/home/indy/.indy_client/ledger-cache/ledger-cache-db"

You don't need to reset everything with rm to use it, just run ./manage stop first.

Are you using a custom version of the BC Wallet that has been configured to connect to your von-network instance?

Also since you reset the ledger, you'll have to reset everything else too; agents, wallets, etc.

No. Do I need to have one custom one? Its also not running on my esatus wallet. Thanks

Are you using a custom version of the BC Wallet that has been configured to connect to your von-network instance?
Also since you reset the ledger, you'll have to reset everything else too; agents, wallets, etc.

No. Do I need to have one custom one? Its also not running on my esatus wallet. Thanks

Yes, the wallet needs to be configured to talk to your network. By default the BC Wallet only communicates with three pre-configured ledgers, and your custom ledger is not in that list.

BCovrin Test, is in that list. So you might find it easier to just use it for your testing.

The esatus wallet is also only able to communicate with a list of preconfigured ledgers. BCovrin Test is in that list too. With esatus, you can configure custom ledgers by providing it with the genesis file for the ledger. On the settings screen, select Change Ledger, then click the + in the top right corner. From there you can import a genesis file that has been saved to your phone. BC Wallet does not have this sort of option yet.

The esatus wallet is also only able to communicate with a list of preconfigured ledgers. BCovrin Test is in that list too. With esatus, you can configure custom ledgers by providing it with the genesis file for the ledger. On the settings screen, select Change Ledger, then click the + in the top right corner. From there you can import a genesis file that has been saved to your phone. BC Wallet does not have this sort of option yet.

Thank you so much.