I have a one question.
I’m trying to connect the Android app to the indy pool, but I see error( Timeout happens for ledger operation) source(https://github.com/jSh4rk/SampleIndyWallet)
I installed indy in AWS(ubuntu 16.04 lts) and after running node with docker
When running docker I entered the command
docker build --build-arg pool_ip=172.31.37.144 -f ci/indy-pool.dockerfile -t indy_pool
because I want 172.31.37.144
to be private ip address of my docker container:
docker run -itd -p 172.31.37.144:9701-9708:9701-9708 -t indy_pool
In SampleIndyWallet's file MainActivity.java I changed the string ip to public IP of my container.
However, I get error org.hyperledger.indy.sdk.InvalidStateException: The SDK library experienced an unexpected internal error
in the process of opening connection to the pool.
In order to connect to Hyperledger Indy from anywhere, as you might already know, you need genesis file. Genesis file specifies IP addresses of the network Nodes and their associated cryptographic data (signatures, public keys...).
When building Indy pool docker with command as you've posted
docker build --build-arg pool_ip=172.31.37.144 -f ci/indy-pool.dockerfile -t indy_pool
it's important to specify correct pool_ip
. The pool_ip
will become part of genesis file. And when you supply genesis file to indySDK, it will take these IPs and try to establish connection with them. If you are getting error such as PoolTimeout
, it's likely because these IPs are not reachable from the environment you run IndySDK at.
So by building image as above you are saying: "Clients connecting to container made of this image will have to be able to reach the container via address 172.31.37.144
". That might work if you are trying to connect to the pool from other docker container within the same network. But if application is running on your localhost, 172.31.37.144
will not connect anywhere as that's only internal IP address within the docker network.
As I understood, you want to run Indy network in pool and connect to the pool from application running on your host. The easiest way is to make the network reachable on your localhost / 127.0.0.1
by exposing the ports. Let's first build indy network container which will have 127.0.0.1
in its genesis transactions.
docker build --build-arg pool_ip=127.0.0.1 -f ci/indy-pool.dockerfile -t indy_pool
Now let's read genesis file of your image and store it locally.
docker exec indy_pool cat '/var/lib/indy/sandbox/pool_transactions_genesis' > ~/my_genesis.txn
Next you'll start the pool similarly as you've been doing it, but no need to specify internal ip address of container - it doesn't matter.
docker run -itd -p 9701-9708:9701-9708 -t indy_pool
Now you when you start your application and try to connect to the pool, you'll have to specify path to genesis file we created on your localhost.