Hands-on- Decentralized Identity(SSI)-Setting up Hyperledger Indy Node and Hyperledger-Aries Agent
Hyperledger Indy — Distributed Decentralized Identity Ledger
Hyperledger Aries — Interoperable connectors that helps connect to Decentralized Identity ledger.
Prerequisites :
1. Python >3.7
2. Docker
Setting up Indy network in Local Environment :
I did not face any challenges with setting up Indy network and it does comes up with decent documentation. I did try out the docker version of setup and here are steps below,
- Clone Indy-sdk — https://github.com/hyperledger/indy-sdk
- Build & Run the Image of Indy Pool, This lets you to run 4 validator nodes by default and genesis block which includes corresponding connections details for Aries Agent to connect.
docker build -f ci/indy-pool.dockerfile -t indy_pool .
docker run -itd -p 9701-9708:9701-9708 indy_pool
3. Ensure you get latest version of Libindy
Above steps would create a docker container running the local Indy pool with ports exposed from 9701–9708.
Setting up Aries Agent in Local Environment :
Now that we have the Local Indy network setup , the next step would be running the Aries Agent.
What is Aries Agent ?
Aries agent communicate to Indy ledger and play a vital role in providing Verifiable Credentials(VC). I would not be covering upon SSI Concepts / VC , rather focus on setup.
We would using Faber-Alice demo code provided Aries-cloud-agent -https://github.com/hyperledger/aries-cloudagent-python/tree/master/demo
I did face some challenges when setting up the Faber and Alice agents in local network ,most of them with respect to Indy-plenum and Python rocks-db. Please note Agents by default connects to 9000 port , you need a server that communicates to Indy Pool to fetch genesis and registering DID. To avoid above challenges and peer-out from environmental issues, I have created Docker image that has all of required libraries for Aries-Agent to run.
FROM ubuntu:18.04ARG uid=1000# Install environment
RUN apt-get update -y && apt-get install -y \
git \
wget \
python3.5 \
python3-pip \
python-setuptools \
python3-nacl \
apt-transport-https \
ca-certificates \
supervisor
RUN pip3 install -U \
pip==20.2 \
setuptools
RUN apt install software-properties-common -yRUN add-apt-repository ppa:deadsnakes/ppaRUN apt updateRUN apt install python3.7 -y
RUN apt-get install libssl-dev swig -y
RUN apt-get install -y graphviz-dev -yRUN apt-get install python3 python2.7-dev python3.6-dev \
python3.7-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
python-pip -yRUN apt-get install python-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
python-pip
RUN apt install libeccodes-dev -yRUN pip install setuptools --upgradeRUN pip3 install setuptools --upgradeRUN apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev -y
RUN pip3 install -U \
CythonRUN apt-get install libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev -y
RUN apt-get install librocksdb-dev -y#RUN apt-get install -y libliz4-dev
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
RUN add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"
RUN apt-get update
RUN apt-get install -y libindy=1.14.2
RUN alias python='/usr/bin/python3.7'RUN . ~/.bashrcRUN apt-get install liblz4-devRUN python --version#VOLUME /home/ubuntu/von-network : /von-network#RUN mkdir von-network
RUN pip3 install -U \
setuptools \
pyyaml \
aiodns \
aiohttp \
aiohttp-jinja2 \
aiosqlite \
base58 \
cchardet \
rlp \
supervisor \
indy-plenum \
python3-indy
RUN useradd -ms /bin/bash -u $uid indyRUN exec "$@"EXPOSE 9000
#RUN cd /von-network
You can grab the docker file at https://github.com/rangesh-/indy-server/blob/master/local-indy-server.dockerfile
To build docker image :
sudo docker build -t indyserver -f local-indy-server.dockerfile .
With all prerequisites available in docker image, it would be easy for us to spin up container and run the aries-agent. To run aries-agent(Faber and Alice), Please follow steps provided in demo section of aries cloud agent- https://github.com/hyperledger/aries-cloudagent-python/tree/master/demo
We could also make use of ledger browser provided by Von-network to track transactions happening in Indy network.
Indy Ledger Browser :
Indy ledger browser that connects to local Indy pool shows the health of validator nodes and transactions.
References :
https://github.com/hyperledger/aries-cloudagent-python
https://github.com/hyperledger/aries-framework-go/blob/master/docs/rest/openapi_demo.md