Skip to content

Commit

Permalink
simplify demo readme
Browse files Browse the repository at this point in the history
Signed-off-by: pstlouis <[email protected]>
  • Loading branch information
PatStLouis committed Jan 9, 2025
1 parent ca356fe commit ef8d8e6
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 32,110 deletions.
37 changes: 27 additions & 10 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# DID WebVH Server Demo

There's 3 ways to run this demo:
- Using the deployed demo instance of the services through the public Postman workspace.
- Just head to the [public Postman workspace](https://www.postman.com/bcgov-digital-trust/trust-did-web-server) and follow the instructions.
- You can also import this workspace by searching for `Trust DID Web Server` in the public API Network.

- Deploying the project locally and using a desktop installation of Postman to execute the requests.
- You will need a **local** installation of the [Postman desktop app](https://www.postman.com/downloads/). Once you have this, you can import the [public workspace](https://www.postman.com/bcgov-digital-trust/trust-did-web-server). The workspace also contains additional documentation for runnig this demo.

- Deploying the project locally and using the OpenAPI web interfaces of each service.
These are step by step instructions.

## Setting up you local deployments

Expand All @@ -35,6 +27,8 @@ curl -H Host:agent.docker.localhost \
- http://agent.docker.localhost/api/doc
- http://server.docker.localhost/docs

You can continue reading to go through the steps of registering a DID. There's also a script available to automate this (`./register.sh`).

## Create a DID

Time required: Less than 10 minutes
Expand Down Expand Up @@ -140,17 +134,40 @@ curl -X 'POST' -H Host:server.docker.localhost \

```

## Resolve (locally) your new DID
## Resolve (locally) the DID
```bash
curl -H Host:server.docker.localhost http://127.0.0.1/demo/issuer/did.json | jq .
```

## Initialise the DID Log

```bash
# Request the provided helper log entry to sign
LOG_ENTRY=$(curl -H Host:server.docker.localhost http://127.0.0.1/demo/issuer | jq .logEntry)

# Sign with the controller
PAYLOAD=$(cat <<EOF
{"document": $LOG_ENTRY, "options": $CONTROLLER_PROOF_OPTIONS}
EOF
)
SIGNED_LOG_ENTRY=$(curl -X 'POST' -H Host:agent.docker.localhost \
-H 'Content-Type: application/json' \
'http://127.0.0.1/vc/di/add-proof' \
-d ''"$PAYLOAD"'' | jq .securedDocument)

# Send response to server
PAYLOAD=$(cat <<EOF
{"logEntry": $SIGNED_LOG_ENTRY}
EOF
)
curl -X 'POST' -H Host:server.docker.localhost \
-H 'Content-Type: application/json' \
'http://127.0.0.1/demo/issuer' \
-d ''"$PAYLOAD"'' | jq .

```

## Resolve (locally) the DID Log
```bash
curl -H Host:server.docker.localhost http://127.0.0.1/demo/issuer/did.jsonl
```
16 changes: 0 additions & 16 deletions demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
---
services:
frontend:
build:
context: frontend
dockerfile: Dockerfile
environment:
DOMAIN: server.${DOMAIN}
SECRET_KEY: ${SECRET_KEY}
ENDORSER_MULTIKEY: ${ENDORSER_MULTIKEY}
TDW_SERVER_URL: http://server:8000
AGENT_ADMIN_URL: http://agent:8020
labels:
- traefik.enable=true
- traefik.http.routers.frontend.rule=Host(`demo.${DOMAIN}`)
- traefik.http.routers.frontend.entrypoints=web
- traefik.http.services.frontend.loadbalancer.server.port=5000

server:
build:
context: ../server
Expand Down
19 changes: 0 additions & 19 deletions demo/frontend/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions demo/frontend/app/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions demo/frontend/app/errors/__init__.py

This file was deleted.

31 changes: 0 additions & 31 deletions demo/frontend/app/errors/handlers.py

This file was deleted.

19 changes: 0 additions & 19 deletions demo/frontend/app/plugins/agent.py

This file was deleted.

64 changes: 0 additions & 64 deletions demo/frontend/app/plugins/tdw.py

This file was deleted.

5 changes: 0 additions & 5 deletions demo/frontend/app/routes/main/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions demo/frontend/app/routes/main/forms.py

This file was deleted.

16 changes: 0 additions & 16 deletions demo/frontend/app/routes/main/routes.py

This file was deleted.

Loading

0 comments on commit ef8d8e6

Please sign in to comment.