Install Hyperledger Indy on AWS


Install Hyperledger Indy on AWS

Recipe ID: hsts-r12


Recipe Overview

Hyperledger Indy is a distributed ledger in The Linux Foundation family which is built for decentralized digital-identity management. Hyperledger Indy is in its incubation stage, and we will explore the Indy Command Line Interface or CLI to look at the concept and functions offered by Hyperledger Indy with the current distribution.

For those who are not familiar with Hyperledger project, reading Blockchain Overview, Intro to Hyperledger Family and Hyperledger Blockchain Ecosystem, Hyperledger Design Philosophy and Framework Architecture, and Overview of Building Blockchain Smart Contracts in Hyperledger articles are strongly recommended beforehand.

In this recipe, we only cover the installation of Hyperledger Indy and the Indy CLI on AWS. However, first we give an overview of Hyperledger Indy project and its concepts and components.

Overview of Hyperledger Indy
Hyperledger Indy is a public permissioned blockchain network for identity, which is built with privacy by design. It provides decentralized and self-sovereign identity management with a distributed ledger technology. An identity owner takes full control of its personal data in order to expose select information or avoid compromising the underlying personal data. Hyperledger Indy offers an alternative solution to managing identities and tackling increasing identity security demands, such as privacy, personal information leakage, data breach, and identity theft.
Here are Hyperledger Indy's key concepts:

Hyperledger Indy is composed of the following projects:

The Hyperledger Indy network is a distributed ledger that was designed specifically for decentralized identities with the following characteristics:

Hyperledger Indy and Indy CLI Installation on AWS
To install and run this recipes, you need an AWS EC2 instance with the following configuration:

Follow the steps to install Indy and Indy CLI:

git clone -b rc --depth=1 https://github.com/hyperledger/indy-sdk.git

sudo docker build -f ci/indy-pool.dockerfile -t indy_pool .

ubuntu@ip-172-31-90-67:~/indy/indy-sdk$ sudo docker build -f ci/indy-pool.dockerfile -t indy_pool .

Sending build context to Docker daemon 119.4MB Step 1/22 : FROM ubuntu:16.04

---> a597cf115cd3

......

Successfully built ad625c5e93d9

Successfully tagged indy_pool:latest

3. Start up the Indy network using the built Docker image on a localhost:

sudo docker run -itd -p 9701-9708:9701-9708 indy_pool

Verify that the indy_pool container is running and get the indy_pool Docker container name with the following command. You'll need the Docker container name to stop and restart the Indy Docker container using the Docker command later. The Indy Docker container name for the recipe is stoic_mendeleev:
ubuntu@ip-172-31-90-67:~/indy/indy-sdk$ sudo docker ps –a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c6feb453b2b9 indy_pool "/usr/bin/supervisord" 6 days ago Up 2 seconds 0.0.0.0:9701-9708->9701-9708/tcp stoic_mendeleev

Log into the shell of the running Indy container by entering the following command:
ubuntu@ip-172-31-90-67:~/indy/indy-sdk$ sudo docker exec -t stoic_mendeleev /bin/bash
indy@c6feb453b2b9:/$

 

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"

sudo apt-get update
sudo apt-get install -y libindy
ubuntu@ip-172-31-90-67:~/indy$ sudo apt-get install -y libindy
Reading package lists... Done
Building dependency tree
Reading state information... Done
......

Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial/universe amd64 libsqlite0 amd64 2.8.17-12fakesync1 [139 kB]
Get:2 https://repo.sovrin.org/sdk/deb xenial/stable amd64 libindy amd64 1.6.8 [2,662 kB]
......

Setting up libsqlite0 (2.8.17-12fakesync1) ...
Setting up libindy (1.6.8) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...

5. Install indy-cli:
sudo apt-get install -y indy-cli ubuntu@ip-172-31-90-67:~/indy$ sudo apt-get install -y indy-cli Reading package lists... Done
......
Preparing to unpack .../indy-cli_1.6.8_amd64.deb ...
Unpacking indy-cli (1.6.8) ...
Setting up indy-cli (1.6.8) ...

Put Things Together
In this recipe, we downloaded the Indy source code repository, then built the Indy Docker container and started testing the Indy network on the AWS localhost. We also installed indy-sdk and indy-cli to interact with the Indy testing. In the Indy Docker container, the command to start Indy node is /usr/bin/python3/usr/local/bin/start_indy_node Node1 0.0.0.0 9701 0.0.0.0 9702.
The parameters for the start_indy_node Python module are node_name node_ip node_port client_ip client_port.

The Indy network nodes use two pairs of IPs or ports for running the node and communicating between nodes and clients. The first IP or port pair is for the node-to-node communication, and the second IP or port pair is for client-to-node communication.

Additional Notes
To browse the configuration and genesis transactions definition files for the Indy network that was installed in this recipe, you can log into the Indy Docker container using the following command:
sudo docker exec -it stoic_mendeleev /bin/bash
In the shell of the Indy container, you can browse the Indy system configuration file and the configuration directories for different parts of the Indy node under /etc/indy:

LOG_DIR = '/var/log/indy'

BACKUP_DIR = '/var/lib/indy/backup'

NODE_INFO_DIR = '/var/lib/indy'
NETWORK_NAME = 'sandbox'

For example, the node genesis transaction files are specified as GENESIS_DIR = /var/lib/indy. For the sandbox testing network, its genesis files are under the /var/lib/indy/sandbox folder as domain_transactions_genesis and pool_transactions_genesis. The sample transaction to create an initial identity in the network is as follows:
{"reqSignature":{},"txn":{"data":{"dest":"Th7MpTaRZVRYnPiabds81Y","role":"2","verkey":"~7TYfekw4GUagBnBVCqPjiC"},"metadata":{"from":"V4SGRU86Z58d6TV7PBUe6f"},"type":"1"},"txnMetadata":{"seqNo":2},"ver":"1"}

Congratulation! We have successfully installed Hyperledger Indy on an AWS EC2 virtual machine. The next step is to work with Hyperledger Indy and build your first blockchain application.

The following recipes are excellent resources for installing other Hyperledger tools:

Blockchain Developer Guide- How to Install and work with Hyperledger Sawtooth
Blockchain Developer Guide- How to Install Hyperledger Fabric on AWS
Blockchain Hyperledger Composer Business Network Modeling and Environment Setup
Blockchain Developer Guide- How to Install Hyperledger Burrow on AWS
Blockchain Developer Guide- How to Install Hyperledger Iroha on AWS
Blockchain Developer Guide- How to Install Hyperledger Seth and Docker on AWS

To conclude this recipe, we like to recommend our Blockchain Hyperledger Development in 30 hours course to those interested in pursuing a blockchain development career. Indeed, as of this writing, Hyperledger Foundation offers the following two Hyperledger certifications: The Certified Hyperledger Fabric Administrator (CHFA) and The Certified Hyperledger Sawtooth Administrator (CHSA), both of which are highly regarded in the industry. Hyperledger Foundation is in the process of creating Hyperledger Developer certification program, which may be released in early or middle of 2020. In short, by taking our hands-on online Hyperledger class, you would be able to obtain CHFA certification.

This recipe is written by Brian Wu who is our senior Hyperledger instructor in Washington DC. His Hyperledger Cookbook with 40+ hands-on recipes is highly recommended.

Related Training Courses

Hands-on Node.JS, MongoDB and Express.js Training
Advance JavaScript, jQuery Using JSON and Ajax
Learn Hands-on Blockchain Ethereum Development & Get Certified in 30 Hrs
Learn Blockchain Hyperledger Development & Get Certified in 30 Hrs
Become Blockchain Certified Security Architect in 30 hours
Blockchain Certified Solution Architect in 30 hours
Introduction to Python Programming
Object Oriented Programming with UML


Private and Custom Tutoring

We provide private tutoring classes online and offline (at our DC site or your preferred location) with custom curriculum for almost all of our classes for $50 per hour online or $75 per hour in DC. Give us a call or submit our private tutoring registration form to discuss your needs.


View Other Classes!