Skip to content

Commit 49084ec

Browse files
authored
Merge pull request openwallet-foundation#2122 from swcurran/demo-instruction-updates
Update some of the demo Readme and Endorser instructions
2 parents ed3d739 + d9f3f97 commit 49084ec

2 files changed

Lines changed: 53 additions & 34 deletions

File tree

demo/Endorser.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
There are two ways to run the alice/faber demo with endorser support enabled.
44

5-
65
## Run Faber as an Author, with a dedicated Endorser agent
76

8-
This approach runs Faber as an un-privileged agent, and starts a dedicated Endorser sub-process to endorse Faber's transactions.
7+
This approach runs Faber as an un-privileged agent, and starts a dedicated Endorser Agent in a sub-process (an instance of ACA-Py) to endorse Faber's transactions.
8+
9+
Start a VON Network instance and a Tails server:
910

10-
Start a VON Network and a Tails server.
11+
- Following the [Building and Starting](https://github.com/bcgov/von-network/blob/main/docs/UsingVONNetwork.md#building-and-starting) section of the VON Network Tutorial to get ledger started. You can leave off the `--logs` option if you want to use the same terminal for running both VON Network and the Tails server. When you are finished with VON Network, follow the [Stopping And Removing a VON Network](https://github.com/bcgov/von-network/blob/main/docs/UsingVONNetwork.md#stopping-and-removing-a-von-network) instructions.
12+
- Run an AnonCreds revocation registry tails server in order to support revocation by following the instructions in the [Alice gets a Phone](https://github.com/hyperledger/aries-cloudagent-python/blob/master/demo/AliceGetsAPhone.md#run-an-instance-of-indy-tails-server) demo.
1113

1214
Start up Faber as Author (note the tails file size override, to allow testing of the revocation registry roll-over):
1315

1416
```bash
1517
TAILS_FILE_COUNT=5 ./run_demo faber --endorser-role author --revocation
1618
```
1719

18-
Start up Alcie as normal:
20+
Start up Alice as normal:
1921

2022
```bash
2123
./run_demo alice
@@ -33,7 +35,7 @@ This approach sets up the endorser roles to allow manual testing using the agent
3335
- Faber runs as an Endorser (all of Faber's functions - issue credential, request proof, etc.) run normally, since Faber has ledger write access
3436
- Alice starts up with a DID aith Author privileges (no ledger write access) and Faber is setup as Alice's Endorser
3537

36-
Start a VON Network and a Tails server.
38+
Start a VON Network and a Tails server using the instructions above.
3739

3840
Start up Faber as Endorser:
3941

demo/README.md

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ There are several demos available for ACA-Py mostly (but not only) aimed at deve
44

55
## Table of Contents <!-- omit in toc -->
66

7-
- [The IIWBook Demo](#the-iiwbook-demo)
87
- [The Alice/Faber Python demo](#the-alicefaber-python-demo)
98
- [Running in a Browser](#running-in-a-browser)
109
- [Running in Docker](#running-in-docker)
1110
- [Running Locally](#running-locally)
1211
- [Installing Prerequisites](#installing-prerequisites)
13-
- [Start a local indy ledger](#start-a-local-indy-ledger)
12+
- [Start a local Indy ledger](#start-a-local-indy-ledger)
1413
- [Genesis File handling](#genesis-file-handling)
1514
- [Run a local Postgres instance](#run-a-local-postgres-instance)
1615
- [Optional: Run a von-network ledger browser](#optional-run-a-von-network-ledger-browser)
@@ -20,21 +19,18 @@ There are several demos available for ACA-Py mostly (but not only) aimed at deve
2019
- [Issuing and Proving Credentials](#issuing-and-proving-credentials)
2120
- [Additional Options in the Alice/Faber demo](#additional-options-in-the-alicefaber-demo)
2221
- [Revocation](#revocation)
23-
- [Mediation](#mediation)
24-
- [Multi-tenancy](#multi-tenancy)
25-
- [Multi-ledger](#multi-ledger)
2622
- [DID Exchange](#did-exchange)
2723
- [Endorser](#endorser)
2824
- [Run Indy-SDK Backend](#run-indy-sdk-backend)
25+
- [Mediation](#mediation)
26+
- [Multi-ledger](#multi-ledger)
27+
- [Multi-tenancy](#multi-tenancy)
28+
- [Multi-tenancy *with Mediation*!!!](#multi-tenancy-with-mediation)
2929
- [Learning about the Alice/Faber code](#learning-about-the-alicefaber-code)
3030
- [OpenAPI (Swagger) Demo](#openapi-swagger-demo)
3131
- [Performance Demo](#performance-demo)
3232
- [Coding Challenge: Adding ACME](#coding-challenge-adding-acme)
3333

34-
## The IIWBook Demo
35-
36-
The IIWBook demo is a real (play) self-sovereign identity demonstration. During the demo, you will get a mobile agent (sorry - IOS only right now), and use that agent to connect with several enterprise services to collect and prove credentials. The two services in the demo (the [email verification service](https://github.com/bcgov/indy-email-verification) and [IIWBook](https://github.com/bcgov/iiwbook)) are both instances of ACA-Py, and all the agents are using DIDComm to communicate. Learn about and run the demo at [https://vonx.io/how_to/iiwbook](https://vonx.io/how_to/iiwbook). Developers, when you are ready, check out the code in the repos of the two services to see how they implement Django web server-based controller and agent.
37-
3834
## The Alice/Faber Python demo
3935

4036
The Alice/Faber demo is the (in)famous first verifiable credentials demo. Alice, a former student of Faber College ("Knowledge is Good"), connects with the College, is issued a credential about her degree and then is asked by the College for a proof. There are a variety of ways of running the demo. The easiest is in your browser using a site ("Play with VON") that let's you run docker containers without installing anything. Alternatively, you can run locally on docker (our recommendation), or using python on your local machine. Each approach is covered below.
@@ -63,19 +59,20 @@ Jump to the [Follow the Script](#follow-the-script) section below for further in
6359

6460
### Running in Docker
6561

66-
Running the demo in docker requires having a `von-network` (a Hyperledger Indy public ledger sandbox) instance running in docker locally. See the [Running the Network Locally](https://github.com/bcgov/von-network#running-the-network-locally) section of the `von-network` readme file for more info.
62+
Running the demo in docker requires having a `von-network` (a Hyperledger Indy public ledger sandbox) instance running in docker locally. See the [VON Network Tutorial](https://github.com/bcgov/von-network/blob/main/docs/UsingVONNetwork.md) for guidance
63+
on starting and stopping your own local Hyperledger Indy instance.
6764

6865
Open three `bash` shells. For Windows users, `git-bash` is highly recommended. bash is the default shell in Linux and Mac terminal sessions.
6966

70-
In the first terminal window, start `von-network` by following the [Running the Network Locally](https://github.com/bcgov/von-network#running-the-network-locally) instructions.
67+
In the first terminal window, start `von-network` by following the [Building and Starting](https://github.com/bcgov/von-network/blob/main/docs/UsingVONNetwork.md#building-and-starting) instructions.
7168

72-
In the second terminal, change directory into `demo` directory of your clone of this repository. Start the `faber` agent by issuing the following command:
69+
In the second terminal, change directory into `demo` directory of your clone of the Aries Cloud Agent Python repository. Start the `faber` agent by issuing the following command:
7370

7471
``` bash
7572
./run_demo faber
7673
```
7774

78-
In the third terminal, change directory into `demo` directory of your clone of this repository. Start the `alice` agent by issuing the following command:
75+
In the third terminal, change directory into `demo` directory of your clone of the Aries Cloud Agent Python repository. Start the `alice` agent by issuing the following command:
7976

8077
``` bash
8178
./run_demo alice
@@ -87,6 +84,8 @@ Jump to the [Follow the Script](#follow-the-script) section below for further in
8784

8885
The following is an approach to to running the Alice and Faber demo using Python3 running on a bare machine. There are other ways to run the components, but this covers the general approach.
8986

87+
We don't recommend this approach if you are just trying this demo, as you will likely run into issues with the specific setup of your machine.
88+
9089
#### Installing Prerequisites
9190

9291
We assume you have a running Python 3 environment. To install the prerequisites specific to running the agent/controller examples in your Python environment, run the following command from this repo's `demo` folder. The precise command to run may vary based on your Python environment setup.
@@ -97,12 +96,16 @@ pip3 install -r demo/requirements.txt
9796

9897
While that process will include the installation of the Indy python prerequisite, you still have to build and install the `libindy` code for your platform. Follow the [installation instructions](https://github.com/hyperledger/indy-sdk#installing-the-sdk) in the indy-sdk repo for your platform.
9998

100-
#### Start a local indy ledger
99+
#### Start a local Indy ledger
101100

102-
Use instructions in the [indy-sdk repo](https://github.com/hyperledger/indy-sdk#how-to-start-local-nodes-pool-with-docker) to run a local ledger.
101+
Start a local `von-network` Hyperledger Indy network running in Docker by following the VON Network [Building and Starting](https://github.com/bcgov/von-network/blob/main/docs/UsingVONNetwork.md#building-and-starting) instructions.
102+
103+
We strongly recommend you use Docker for the local Indy network until you really, really need to know the details of running an Indy Node instance on a bare machine.
103104

104105
#### Genesis File handling
105106

107+
> Assuming you followed our advice and are using a VON Network instance of Hyperledger Indy, you can ignore this section. If you started the Indy ledger **without** using VON Network, this information might be helpful.
108+
106109
An Aries agent (or other client) connecting to an Indy ledger must know the contents of the `genesis` file for the ledger. The genesis file lets the agent/client know the IP addresses of the initial nodes of the ledger, and the agent/client sends ledger requests to those IP addresses. When using the `indy-sdk` ledger, look for the instructions in that repo for how to find/update the ledger genesis file, and note the path to that file on your local system.
107110

108111
The envrionment variable `GENESIS_FILE` is used to let the Aries demo agents know the location of the genesis file. Use the path to that file as value of the `GENESIS_FILE` environment variable in the instructions below. You might want to copy that file to be local to the demo so the path is shorter.
@@ -117,15 +120,29 @@ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432
117120

118121
#### Optional: Run a von-network ledger browser
119122

120-
If you want to be able to browse your local ledger as you run the demo, clone the [von-network](https://github.com/bcgov/von-network) repo, go into the root of the cloned instance and run the following command, replacing the `/path/to/local-genesis.txt` with a path to the same genesis file as was used in starting the ledger.
123+
If you followed our advice and are using a VON Network instance of Hyperledger Indy, you can ignore this section, as you already have a Ledger browser running, accessible on http://localhost:9000.
124+
125+
If you started the Indy ledger **without** using VON Network, and you want to be able to browse your local ledger as you run the demo, clone the [von-network](https://github.com/bcgov/von-network) repo, go into the root of the cloned instance and run the following command, replacing the `/path/to/local-genesis.txt` with a path to the same genesis file as was used in starting the ledger.
121126

122127
``` bash
123128
GENESIS_FILE=/path/to/local-genesis.txt PORT=9000 REGISTER_NEW_DIDS=true python -m server.server
124129
```
125130

126131
#### Run the Alice and Faber Controllers/Agents
127132

128-
With the rest of the pieces running, you can run the Alice and Faber controllers and agents. To do so, `cd` into the `demo` folder your clone of this repo in two terminal windows and run the following, replacing the `/path/to/local-genesis.txt`.
133+
With the rest of the pieces running, you can run the Alice and Faber controllers and agents. To do so, `cd` into the `demo` folder your clone of this repo in two terminal windows.
134+
135+
If you are using a VON Network instance of Hyperledger, run the following commands:
136+
137+
``` bash
138+
DEFAULT_POSTGRES=true python3 -m runners.faber --port 8020
139+
```
140+
141+
``` bash
142+
DEFAULT_POSTGRES=true python3 -m runners.alice --port 8030
143+
```
144+
145+
If you started the Indy ledger **without** using VON Network, use the following commands, replacing the `/path/to/local-genesis.txt` with the one for your configuration.
129146

130147
``` bash
131148
GENESIS_FILE=/path/to/local-genesis.txt DEFAULT_POSTGRES=true python3 -m runners.faber --port 8020
@@ -135,7 +152,7 @@ GENESIS_FILE=/path/to/local-genesis.txt DEFAULT_POSTGRES=true python3 -m runners
135152
GENESIS_FILE=/path/to/local-genesis.txt DEFAULT_POSTGRES=true python3 -m runners.alice --port 8030
136153
```
137154

138-
Note that Alice and Faber will each use 5 ports, e.g. using the parameter `... --port 8020` actually uses ports 8020 through 8024. Feel free to use different ports if you want.
155+
Note that Alice and Faber will each use 5 ports, e.g., using the parameter `... --port 8020` actually uses ports 8020 through 8024. Feel free to use different ports if you want.
139156

140157
Everything running? See the [Follow the Script](#follow-the-script) section below for further instructions.
141158

@@ -201,7 +218,7 @@ To enable support for revoking credentials, run the `faber` demo with the `--rev
201218

202219
Note that you don't specify this option with `alice` because it's only applicable for the credential `issuer` (who has to enable revocation when creating a credential definition, and explicitely revoke credentials as appropriate; alice doesn't have to do anything special when revocation is enabled).
203220

204-
You need to run a revocation registry in order to support revocation - the details are described in the [Alice gets a Phone](https://github.com/hyperledger/aries-cloudagent-python/blob/master/demo/AliceGetsAPhone.md#run-an-instance-of-indy-tails-server) demo instructions.
221+
You need to run an AnonCreds revocation registry tails server in order to support revocation - the details are described in the [Alice gets a Phone](https://github.com/hyperledger/aries-cloudagent-python/blob/master/demo/AliceGetsAPhone.md#run-an-instance-of-indy-tails-server) demo instructions.
205222

206223
Faber will setup support for revocation automatically, and you will see an extra option in faber's menu to revoke a credential:
207224

@@ -249,7 +266,7 @@ This is described in [Endorser.md](Endorser.md)
249266

250267
### Run Indy-SDK Backend
251268

252-
This runs using the indy-sdk libraries instead of askar:
269+
This runs using the older (and not recommended) indy-sdk libraries instead of [Aries Askar](:uhttps://github.com/hyperledger/aries-ask):
253270

254271
```bash
255272
./run_demo faber --wallet-type indy
@@ -263,27 +280,27 @@ To enable mediation, run the `alice` or `faber` demo with the `--mediation` opti
263280
./run_demo faber --mediation
264281
```
265282

266-
This will start up a second "mediator" agent and automatically set the alice/faber connection to use the mediator.
283+
This will start up a "mediator" agent with Alice or Faber and automatically set the alice/faber connection to use the mediator.
267284

268-
### Multi-tenancy
285+
### Multi-ledger
269286

270-
To enable support for multi-tenancy, run the `alice` or `faber` demo with the `--multitenant` option:
287+
To enable multiple ledger mode, run the `alice` or `faber` demo with the `--multi-ledger` option:
271288

272289
```bash
273-
./run_demo faber --multitenant
290+
./run_demo faber --multi-ledger
274291
```
275292

276-
(This option can be used with both (or either) `alice` and/or `faber`.)
293+
The configuration file for setting up multiple ledgers (for the demo) can be found at `./demo/multiple_ledger_config.yml`.
277294

278-
### Multi-ledger
295+
### Multi-tenancy
279296

280-
To enable multiple ledger mode, run the `alice` or `faber` demo with the `--multi-ledger` option:
297+
To enable support for multi-tenancy, run the `alice` or `faber` demo with the `--multitenant` option:
281298

282299
```bash
283-
./run_demo faber --multi-ledger
300+
./run_demo faber --multitenant
284301
```
285302

286-
The configuration file for setting up multiple ledgers (for the demo) can be found at `./demo/multiple_ledger_config.yml`.
303+
(This option can be used with both (or either) `alice` and/or `faber`.)
287304

288305
You will see an additional menu option to create new sub-wallets (or they can be considered to be "virtual agents").
289306

0 commit comments

Comments
 (0)