From b03db7f944de372609abc4a618ec09023932d7f3 Mon Sep 17 00:00:00 2001 From: Stephen Curran Date: Tue, 2 Jul 2019 18:30:39 +0000 Subject: [PATCH] Tweak in script to work under Linux; updates to readme for demo Signed-off-by: Stephen Curran --- demo/README.md | 46 +++++++++++++++++++++++++--------------------- scripts/run_demo | 5 ++--- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/demo/README.md b/demo/README.md index f7d670700e..c34f1fe781 100644 --- a/demo/README.md +++ b/demo/README.md @@ -6,47 +6,49 @@ The dockerized demo requires to have von-network instance running in Docker locally. See the [von-network](von-https://github.com/bcgov/von-network) readme file for more info. ### Running the dockerized demo -Open two shells (Git Bash is recommended for Windows) in the `scripts` directory. +Open three `bash` shells. Git Bash is highly recommended for Windows, Linux and Mac terminal apps default to `bash`. -Start the `faber` agent by issuing the following command in the first shell: -``` +In the first terminal window, start `von-network` using the instructions provided [here](https://github.com/bcgov/von-network#running-the-network-locally). + +In the second terminal, change directory into `scripts` directory of your clone of this repository. Start the `faber` agent by issuing the following command: + +``` bash ./run_demo faber ``` -Start the `alice` agent by issuing the following command in the first shell: -``` +In the second terminal, change directory into `scripts` directory of your clone of this repository. Start the `faber` agent by issuing the following command: + +``` bash ./run_demo alice ``` -Refer to the section [follow the script](#follow-the-script) for further instructions. +Jump to the [Follow The Script](#follow-the-script) section below for further instructions. + +## Running Locally -## Running locally First you need to startup a local ledger (e.g. like this: https://github.com/hyperledger/indy-sdk#1-starting-the-test-pool-on-localhost), and then open up two shell scripts and run: -``` +``` bash python faber-pg.py ``` -``` +``` bash python alice-pg.py ``` -Note that alice and faber will each use 5 ports, e.g. if you run ```python faber-pg.py 8020``` if will actually use -ports 8020 through 8024. +Note that Alice and Faber will each use 5 ports, e.g. if you run ```python faber-pg.py 8020``` it will actually use ports 8020 through 8024. -To create the alice/faber wallets using postgres storage, just add the "--postgres" option when running the script. +To create the Alice/Faber wallets using postgres storage, just add the "--postgres" option when running the script. -These scripts run the agent as a sub-process (see the documentation for acagent) and also publish a rest service to -receive web hook callbacks from their agent +These scripts implement the controller and run the agent as a sub-process (see the documentation for `acagent`). The controller publishes a rest service to receive web hook callbacks from their agent. -Refer to the section [follow the script](#follow-the-script)for further instructions. +Refer to the [Follow The Script](#follow-the-script) section below for further instructions. ## Follow The Script -Once Faber has started, it will create and display an invitation; copy this invitation and input at the Alice prompt. -The scripts will then request an option: +With both the Alice and Faber agents started, go to the Faber terminal window. The Faber agent has created and displayed an invitation. Copy this invitation and paste it at the Alice prompt. The agents will connect and then show a menu of options: -faber-pg.py - establishes a connection with Alice, and then provides a menu: +Faber: ``` 1 = send credential to Alice @@ -55,13 +57,15 @@ faber-pg.py - establishes a connection with Alice, and then provides a menu: x = stop and exit ``` -alice-pg.py - once a connection is established, this script provides a menu: +Alice: ``` 3 = send a message to Faber x = stop and exit ``` -At the Faber prompt, enter "1" to send a credential, and then "2" to request a proof. +Feel free to use the "3" option to send messages back and forth between the agents. Fun, eh? Those are secure, end-to-end encrypted messages. + +When ready to test the credentials exchange protocols, go to the Faber prompt, enter "1" to send a credential, and then "2" to request a proof. -You don't need to do anything with Alice - she will automatically receive Credentials and respond to Proofs. +You don't need to do anything with Alice's agent - her agent is implemented to automatically receive credentials and respond to proof requests. diff --git a/scripts/run_demo b/scripts/run_demo index 8a05fb59c2..17b9514b99 100755 --- a/scripts/run_demo +++ b/scripts/run_demo @@ -28,7 +28,7 @@ else AGENT_PORT_RANGE=8030-8037 fi -DOCKER_ENV="-e LOG_LEVEL=${LOG_LEVEL} -e RUNMODE=docker" +DOCKER_ENV="-e LOG_LEVEL=${LOG_LEVEL} -e RUNMODE=docker -e DOCKERHOST=`docker run --net=host codenvy/che-ip`" if ! [ -z "$POSTGRES" ]; then DOCKER_ENV="${DOCKER_ENV} -e POSTGRES=1 -e RUST_BACKTRACE=1" fi @@ -36,9 +36,8 @@ fi # on Windows, docker run needs to be prefixed by winpty if [[ "$OSTYPE" == "msys" ]]; then DOCKER="winpty docker" -else - DOCKER=${DOCKER:-docker} fi +DOCKER=${DOCKER:-docker} $DOCKER run --name $AGENT --rm -it \ -p 0.0.0.0:$AGENT_PORT_RANGE:$AGENT_PORT_RANGE \