Skip to content
Branch: master
Find file History
Latest commit 2a838e3 Jul 24, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
modules Merge pull request #124 from sercher/fix/agent-endpoint-initialization Jun 21, 2019
router Make serializer out byte and not str. May 28, 2019
serializer Fixed error in deserialize. Jun 6, 2019
view Merge remote-tracking branch 'upstream/master' into fix-todo-basicmsg Jun 15, 2019
.gitignore Improve gitignore Sep 27, 2018
.setup.py.un~ added jinja template engine May 29, 2018
Dockerfile Add dockerfile for python agent Oct 16, 2018
Makefile Makefile : rename targets with "docker-" prefixe to avoid confusion Jan 21, 2019
README.md
__init__.py some refactoring Apr 26, 2019
agent.py added --hostname parameter to indy-agent, endpoint is initialized on … Jun 17, 2019
indy-agent.py added --hostname parameter to indy-agent, endpoint is initialized on … Jun 17, 2019
indy_sdk_utils.py Minor checks in get_wallet_records. May 27, 2019
message.py Make serializer out byte and not str. May 28, 2019
post_message_handler.py
requirements.txt fix calling coroutine and update requirements May 3, 2019
scope.md Addition of Scope markdown, and minor updates to both the python READ… Oct 20, 2018
setup.py Clean up errors reported by pylint (root) May 29, 2018
websocket_message_handler.py Handle multiple incoming websocket connections Jul 10, 2019

README.md

Indy-agent implementation in Python

Migration Notice

The work of creating interoperable Agents has moved to the Hyperledger Aries Project. This agent is not actively maintained and over time the protocols used here may diverge more and more from the standards discussed in the Hyperledger Aries Project.

Superseding Projects

Other questions?

Direct any other questions you may have about this repository to the Aries channel.

Python Reference Agent

This is an implementation of indy-agent written in Python.

This agent seeks to be as simple as possible while accurately representing the Sovrin protocol. See Scope for goal and scope details.

Quickstart

There are two ways to run the agent:

  1. Using Docker (tested on Ubuntu 16.04 and MacOS Mojave 10.14)
  2. Using dev mode (tested on Ubuntu 16.04, MacOS Mojave 10.14 and Windows 10)

Change your current folder to indy-agent/python.

1. Using Docker

  • Make sure you have Docker installed
  • Build docker image : $ make docker-build
  • In one instance of your terminal : $ make docker-start PORT=8094 and don't close it
  • In another instance of your terminal : $ make docker-start PORT=8095 and don't close it
  • Open up 2 tabs in your browser : http://localhost:8094 (agent A) and http://localhost:8095 (agent B)

If agent is not reachable with localhost, try with the internal docker container IP :

  • Run make docker-getip PORT=8094 to get the ID address of the first container (for example : 172.17.0.2)
  • And run make docker-getip PORT=8095 to get the ID address of the second container (for example : 172.17.0.3)

2. Using dev mode

Requirements :

If you have used the python reference agent, make sure you have updated libindy to at least version 1.8.0 and reinstalled pip packages into your virtual environment.

Procedure :

  • Make sure you have Python virtual environment installed and running.
  • Install requirements: $ pip install -r requirements.txt
  • In one instance of your terminal: $ python indy-agent.py 8094 and don't close it.
  • In another instance of your terminal: $ python indy-agent.py 8095 and don't close it.
  • Open up your browser, with two tabs opened: localhost:8094 (agent A) and localhost:8095 (agent B).

Using the demo

To this point I hope you have properly launched the agents. In each terminal, after browser tabs opened, you can see the "offer endpoint" usefull for the following scenario (in my case Agent Offer Endpoint : "http://172.17.0.3:8095/offer")

  • In agent A browser tab type : Alice and any password
  • In agent B browser tab type : Bob and any password
  • In agent A browser tab click button send connection offer : Type AliceToBobConnection and /offer path of the second agent (in my case it was http://172.17.0.3:8095/offer), click send connection offer
  • In agent B browser tab click on the view button and check the received message : Click send request
  • In agent A browser tab click on the view button and check the received message : Click send response
  • In agent B browser tab click on the view button and check the received message

Alternatively, the python indy-agent accepts commandline arguments for the wallet name and wallet passphrase (e.g. Alice and 1234). To do this after entering the port number in the command line arguments add in the wallet name and wallet passphrase python indy-agent.py 8094 --wallet Alice 1234.

During development, it is useful to use an ephemeral wallet that is created new each time. To do so, provide a name and a passphrase on the command line, and add the --ephemeralwallet argument. Example: python indy-agent.py 8094 --wallet Alice 1234 --ephemeralwallet. Note: ephemeral wallets will not overwrite normal wallets.

You can’t perform that action at this time.