-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(prism-agent): add connect/issue doc + allow local execution of multiple Prism Agent instances #178
feat(prism-agent): add connect/issue doc + allow local execution of multiple Prism Agent instances #178
Changes from all commits
ae7a60b
cf16131
6f8c9c8
d9ba69f
f160964
ea2dd70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,6 @@ services: | |
POSTGRES_DB: castor | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- pg_data_castor_db:/var/lib/postgresql/data | ||
|
||
|
@@ -36,8 +34,6 @@ services: | |
POSTGRES_DB: pollux | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5433:5432 | ||
volumes: | ||
- pg_data_pollux_db:/var/lib/postgresql/data | ||
|
||
|
@@ -49,6 +45,28 @@ services: | |
db_pollux: | ||
condition: service_started | ||
|
||
########################## | ||
# Connect Database | ||
########################## | ||
|
||
db_connect: | ||
image: postgres:13 | ||
restart: always | ||
environment: | ||
POSTGRES_DB: connect | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
volumes: | ||
- pg_data_connect_db:/var/lib/postgresql/data | ||
|
||
# delay to ensure DB is up before applying migrations | ||
db_connect_init_delay: | ||
image: alpine:3 | ||
command: sleep 5 | ||
depends_on: | ||
db_connect: | ||
condition: service_started | ||
|
||
########################## | ||
# Iris Database | ||
########################## | ||
|
@@ -60,8 +78,6 @@ services: | |
POSTGRES_DB: iris | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5434:5432 | ||
volumes: | ||
- pg_data_iris_db:/var/lib/postgresql/data | ||
|
||
|
@@ -78,20 +94,18 @@ services: | |
# Services | ||
########################## | ||
mediator: | ||
image: ghcr.io/input-output-hk/mercury-mediator:0.1.0-SNAPSHOT | ||
image: ghcr.io/input-output-hk/mercury-mediator:0.2.0 | ||
|
||
iris: | ||
image: ghcr.io/input-output-hk/iris-service:0.1.0-SNAPSHOT | ||
ports: | ||
- 8081:8081 | ||
image: ghcr.io/input-output-hk/iris-service:0.1.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one more question for architecture meeting: how to template the component versions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good point. I will add that as a next AOH topic 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done this in the local running script in this PR #153 - I'll finalise it today |
||
environment: | ||
IRIS_DB_HOST: db_iris | ||
IRIS_DB_PORT: 5432 | ||
IRIS_DB_NAME: iris | ||
IRIS_DB_USER: postgres | ||
|
||
prism-agent: | ||
image: ghcr.io/input-output-hk/prism-agent:0.2.0-SNAPSHOT | ||
image: ghcr.io/input-output-hk/prism-agent:0.6.0-SNAPSHOT | ||
environment: | ||
IRIS_HOST: iris | ||
IRIS_PORT: 8081 | ||
|
@@ -105,9 +119,12 @@ services: | |
POLLUX_DB_NAME: pollux | ||
POLLUX_DB_USER: postgres | ||
POLLUX_DB_PASSWORD: postgres | ||
ports: | ||
- "8085:8085" | ||
- "8080:8080" | ||
CONNECT_DB_HOST: db_connect | ||
CONNECT_DB_PORT: 5432 | ||
CONNECT_DB_NAME: connect | ||
CONNECT_DB_USER: postgres | ||
CONNECT_DB_PASSWORD: postgres | ||
DIDCOMM_SERVICE_URL: http://host.docker.internal:${PORT}/didcomm/ | ||
|
||
swagger-ui: | ||
image: swaggerapi/swagger-ui:v4.14.0 | ||
|
@@ -121,7 +138,7 @@ services: | |
haproxy: | ||
image: haproxy:2.6.5 | ||
ports: | ||
- "80:80" # Http | ||
- "${PORT}:80" # Http | ||
depends_on: | ||
- mediator | ||
- prism-agent | ||
|
@@ -132,4 +149,5 @@ services: | |
volumes: | ||
pg_data_castor_db: | ||
pg_data_pollux_db: | ||
pg_data_connect_db: | ||
pg_data_iris_db: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
### Running multiple instances of Prism Agent | ||
--- | ||
|
||
#### Starting an instance for `Inviter` on port `8080` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8080 docker-compose -p inviter -f infrastructure/local/docker-compose.yml up | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we redefine the roles in the next PR to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would keep |
||
``` | ||
|
||
#### Starting an instance for `Invitee` on port `8090` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8090 docker-compose -p invitee -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
### Executing the `Connect` flow | ||
--- | ||
|
||
- **Inviter** - Create a connection record containing the invitation | ||
```bash | ||
curl -X 'POST' \ | ||
'http://localhost:8080/prism-agent/connections' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"label": "Connect with Alice" | ||
}' | jq | ||
``` | ||
|
||
- **Inviter** - Retrieving the list of connections | ||
```bash | ||
curl -X 'GET' 'http://localhost:8080/prism-agent/connections' | jq | ||
``` | ||
|
||
- **Invitee** - Accept OOB invitation | ||
|
||
Replace `{RAW_INVITATION}` with the value of the '_oob' query string parameter from the invitation URL above | ||
```bash | ||
curl -X 'POST' \ | ||
'http://localhost:8090/prism-agent/connection-invitations' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"invitation": "{RAW_INVITATION}" | ||
}' | jq | ||
``` | ||
|
||
- **Invitee** - Retrieving the list of connections | ||
```bash | ||
curl -X 'GET' 'http://localhost:8090/prism-agent/connections' | jq | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
### Running multiple instances of Prism Agent | ||
--- | ||
|
||
#### Starting an instance for `Issuer` on port `8080` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8080 docker-compose -p issuer -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
#### Starting an instance for `Holder` on port `8090` | ||
|
||
```bash | ||
# From the root directory | ||
PORT=8090 docker-compose -p holder -f infrastructure/local/docker-compose.yml up | ||
``` | ||
|
||
### Executing the `Issue` flow | ||
--- | ||
|
||
- **Issuer** - Initiate a new issue credential flow | ||
|
||
Replace `{SUBJECT_ID}` with the DID of the holder displayed at startup in the his Prism Agent console logs | ||
```bash | ||
curl -X 'POST' \ | ||
'http://localhost:8080/prism-agent/issue-credentials/credential-offers' \ | ||
-H 'accept: application/json' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"schemaId": "schema:1234", | ||
"subjectId": "{SUBJECT_ID}", | ||
"validityPeriod": 3600, | ||
"automaticIssuance": false, | ||
"awaitConfirmation": false, | ||
"claims": { | ||
"firstname": "Alice", | ||
"lastname": "Wonderland", | ||
"birthdate": "01/01/2000" | ||
} | ||
}' | jq | ||
``` | ||
|
||
- **Holder** - Retrieving the list of issue records | ||
```bash | ||
curl -X 'GET' 'http://localhost:8090/prism-agent/issue-credentials/records' | jq | ||
``` | ||
|
||
- **Holder** - Accepting the credential offer | ||
|
||
Replace `{RECORD_ID}` with the UUID of the record from the previous list | ||
```bash | ||
curl -X 'POST' 'http://localhost:8090/prism-agent/issue-credentials/records/{RECORD_ID}/accept-offer' | jq | ||
``` | ||
|
||
- **Issuer** - Retrieving the list of issue records | ||
```bash | ||
curl -X 'GET' 'http://localhost:8080/prism-agent/issue-credentials/records' | jq | ||
``` | ||
|
||
- **Issuer** - Issuing the credential | ||
|
||
Replace `{RECORD_ID}` with the UUID of the record from the previous list | ||
```bash | ||
curl -X 'POST' 'http://localhost:8080/prism-agent/issue-credentials/records/{RECORD_ID}/issue-credential' | jq | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ThisBuild / version := "0.5.0-SNAPSHOT" | ||
ThisBuild / version := "0.6.0-SNAPSHOT" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as far as I remember, @antonbaliasnikov and @FabioPinheiro added the guard that protects version.sbt files from manual edition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @antonbaliasnikov I thought it would be automatically overridden by the release process. If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should never edit these files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, but will that file be updated automatically by the release pipeline then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep it as it is, but I'm concerned that we currently have a database per building block or even per product.
probably, it's ok, but I want any ADR that defines this architecture.
having
castor
,pollux
,mercury
,connect
DBs and 3 rolesholder
,issuer
,verifier
we might come to the exposure of dbs :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we'd better have a single Postgres instance for everything, and even a single DB containing all BB tables. But let's discuss that later on yes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it is deployed to a real environmnet [non-local] it is a single instance of PG with multiple databases - which will suit us well if they ever become microservices of their own / when we face scaling issues