Skip to content

Commit 9026785

Browse files
authored
Merge pull request #45 from OpenMined/feature/acapy056_yaml
Feature/acapy056 yaml
2 parents 85932b6 + 40cc2d8 commit 9026785

File tree

91 files changed

+2499
-4058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2499
-4058
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build
77
.ipynb_checkpoints/
88
__pycache__/
99

10-
*/received_files/*
10+
**/received_files/*
1111
libs/om-aries-controller/demo/bob/image_received.png
1212

1313
.vscode/

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ Verify that **s2i** is in your PATH. If not, then edit your PATH and add the di
2828

2929
Ensure that Docker is running. If it is not try `sudo dockerd` in another terminal.
3030

31-
You can now go to the tutorials folder and follow the examples
31+
You should now be able to run any of the tutorials or projects within this repo.
32+
33+
E.g for the main tutorial on the aries-basic-controller
34+
1. Navigate to the root directory of the tutorial
3235
`cd tutorials/aries-basic-controller`
36+
2. Spin up the docker-compose configuration
37+
`./manage start`
38+
3. Get the urls and tokens for the juypter notebook instances within the project
39+
**From the root PyDentity folder**
40+
`./scripts/get_URLS.sh`
41+
4. Navigate to the urls this spits out and follow the instructions within the notebooks.
3342

3443
## Tutorials
3544

@@ -77,3 +86,7 @@ SSI voting system.
7786
### [Doctors in Training](./projects/doctors-in-training)
7887

7988
A real life use case of SSI developed as part of an NHS INTEROpen hackathon.
89+
90+
### [Single Agent](./project/single-agent)
91+
92+
This spins up a single agent (with attachment capability) pointing to the Sovrin StagingNet and publicly exposed using Ngrok. It includes an associated notebook. Our thought is you could use this to experiment with interoperability of other aries agents. For example aca-pico.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# see: https://pypi.org/project/ConfigArgParse/ for file format overview
2+
# before running aca-py, run the following (the commands are embedded below, next to the related parameters):
3+
# - run a local postgres database
4+
# - run a local instance of von-network
5+
# - register your did (seed) on the network
6+
# run aca-py as:
7+
# ACAPY_WALLET_SEED=my_seed_000000000000000000000000 ACAPY_WALLET_KEY=key ./bin/aca-py start --arg-file ./demo/local-indy-args.yaml
8+
9+
log-level: info
10+
genesis-url: !ENV ${GENESIS_URL}
11+
# Admin insecure mode and api key will come from the following two variables
12+
# which is parsed and used automatically by ACA-Py
13+
# ACAPY_ADMIN_API_KEY
14+
# ACAPY_ADMIN_INSECURE_MODE
15+
admin: [0.0.0.0, !ENV '${ADMIN_PORT}']
16+
label: !ENV ${AGENT_NAME}
17+
# the following is the callback url for your controller
18+
webhook-url: !ENV ${WEBHOOK_URL}
19+
# assumes you are running a local von-network, like:
20+
# cd von-network
21+
# ./manage start <my local ip>
22+
inbound-transport:
23+
- [http, 0.0.0.0, !ENV '${HTTP_PORT}']
24+
# - [ws, 0.0.0.0, !ENV '${HTTP_PORT}']
25+
outbound-transport: http
26+
# the following is the public endpoint advertised by the agent
27+
endpoint: !ENV ${AGENT_ENDPOINT}
28+
auto-ping-connection: true
29+
# register your did using (this example is for von-network):
30+
# curl -d '{"seed":"my_seed_000000000000000000000000", "role":"TRUST_ANCHOR", "alias":"My Agent"}' -X POST http://localhost:9000/register
31+
# note that the env var name is configured in argparse.py
32+
# seed = comes from ACAPY_WALLET_SEED
33+
wallet-type: !ENV ${WALLET_TYPE}
34+
wallet-name: !ENV ${WALLET_NAME}
35+
wallet-key: !ENV ${WALLET_KEY}
36+
seed: !ENV ${WALLET_SEED}
37+
38+
## run a local postgres (docker) like:
39+
## docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres:10
40+
#wallet-storage-type: postgres_storage
41+
## could be sent using env var ACAPY_WALLET_STORAGE_CONFIG
42+
#wallet-storage-config: '{"url":"localhost:5432","max_connections":5}'
43+
## could be sent using env var ACAPY_WALLET_STORAGE_CREDS
44+
#wallet-storage-creds: '{"account":"postgres","password":"mysecretpassword","admin_account":"postgres","admin_password":"mysecretpassword"}'
45+
46+
47+
auto-accept-requests: true
48+
auto-respond-credential-proposal: true
49+
auto-respond-credential-offer: true
50+
auto-respond-credential-request: true
51+
auto-store-credential: true
52+
auto-respond-presentation-proposal: true
53+
auto-respond-presentation-request: true
54+
preserve-exchange-records: true
55+
debug-connections: true
56+
debug-credentials: true
57+
debug-presentations: true
58+
enable-undelivered-queue: true

configuration/aries-args-basic.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# see: https://pypi.org/project/ConfigArgParse/ for file format overview
2+
# before running aca-py, run the following (the commands are embedded below, next to the related parameters):
3+
# - run a local postgres database
4+
# - run a local instance of von-network
5+
# - register your did (seed) on the network
6+
# run aca-py as:
7+
# ACAPY_WALLET_SEED=my_seed_000000000000000000000000 ACAPY_WALLET_KEY=key ./bin/aca-py start --arg-file ./demo/local-indy-args.yaml
8+
9+
log-level: info
10+
genesis-url: !ENV ${GENESIS_URL}
11+
# Admin insecure mode and api key will come from the following two variables
12+
# which is parsed and used automatically by ACA-Py
13+
# ACAPY_ADMIN_API_KEY
14+
# ACAPY_ADMIN_INSECURE_MODE
15+
admin: [0.0.0.0, !ENV '${ADMIN_PORT}']
16+
label: !ENV ${AGENT_NAME}
17+
# the following is the callback url for your controller
18+
webhook-url: !ENV ${WEBHOOK_URL}
19+
# assumes you are running a local von-network, like:
20+
# cd von-network
21+
# ./manage start <my local ip>
22+
inbound-transport:
23+
- [http, 0.0.0.0, !ENV '${HTTP_PORT}']
24+
# - [ws, 0.0.0.0, !ENV '${HTTP_PORT}']
25+
outbound-transport: http
26+
# the following is the public endpoint advertised by the agent
27+
endpoint: !ENV ${AGENT_ENDPOINT}
28+
# register your did using (this example is for von-network):
29+
# curl -d '{"seed":"my_seed_000000000000000000000000", "role":"TRUST_ANCHOR", "alias":"My Agent"}' -X POST http://localhost:9000/register
30+
# note that the env var name is configured in argparse.py
31+
# seed = comes from ACAPY_WALLET_SEED
32+
wallet-type: !ENV ${WALLET_TYPE}
33+
wallet-name: !ENV ${WALLET_NAME}
34+
wallet-key: !ENV ${WALLET_KEY}
35+
seed: !ENV ${WALLET_SEED}
36+
37+
## run a local postgres (docker) like:
38+
## docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres:10
39+
#wallet-storage-type: postgres_storage
40+
## could be sent using env var ACAPY_WALLET_STORAGE_CONFIG
41+
#wallet-storage-config: '{"url":"localhost:5432","max_connections":5}'
42+
## could be sent using env var ACAPY_WALLET_STORAGE_CREDS
43+
#wallet-storage-creds: '{"account":"postgres","password":"mysecretpassword","admin_account":"postgres","admin_password":"mysecretpassword"}'

dockerfiles/agents/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM bcgovimages/aries-cloudagent:py36-1.15-0_0.5.6
2+
3+
ADD configuration ./configuration
4+
ADD scripts ./scripts
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM bcgovimages/aries-cloudagent:py36-1.15-0_0.5.6
2+
3+
ADD configuration ./configuration
4+
ADD scripts ./scripts
5+
6+
USER root
7+
8+
ADD libs/attachment-protocol .
9+
10+
11+
RUN pip3 install --no-cache-dir -e .
12+
#
13+
USER $user

tutorials/helpers/create_connection/Dockerfile renamed to dockerfiles/agents/Dockerfile.createconnection

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ ADD libs/aries-basic-controller .
55

66
RUN pip3 install --no-cache-dir -e .
77

8-
ADD tutorials/helpers/create_connection/create_connection.py .
8+
ADD helpers/create_connection/create_connection.py .

dockerfiles/agents/Dockerfile.ngrok

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM bcgovimages/aries-cloudagent:py36-1.15-0_0.5.6
2+
3+
ADD configuration ./configuration
4+
ADD scripts ./scripts
5+
6+
USER root
7+
8+
ADD https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 ./jq
9+
RUN chmod +x ./jq
10+
11+
RUN chmod +x ./scripts/startup.sh
12+
RUN chmod +x ./scripts/ngrok-wait.sh
13+
14+
USER $user
15+
16+
ENTRYPOINT ["/usr/bin/env"]
17+
CMD ./scripts/ngrok-wait.sh ./scripts/startup.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM continuumio/miniconda3
2+
3+
ENV WORKSPACE /workspace
4+
5+
ARG jupyter_port
6+
ENV env_jupyter_port=jupyter_port
7+
# Setup workspace environment
8+
RUN apt-get update && apt-get install -y gcc
9+
RUN conda install jupyter notebook=5.7.8
10+
11+
12+
ADD libs/attachment-controller attachment-controller
13+
14+
15+
RUN pip install --no-cache-dir -e attachment-controller
16+
17+
18+
WORKDIR $WORKSPACE
19+
20+
# Make the image start the jupyer notebook
21+
COPY scripts/jupyter-entrypoint.sh /entrypoint.sh
22+
RUN chmod +x /entrypoint.sh
23+
24+
# ENTRYPOINT ["/entrypoint.sh", "$env_jupyter_port"]
25+
ENTRYPOINT ["/entrypoint.sh", "8888"]

0 commit comments

Comments
 (0)