Skip to content
Snippets Groups Projects
Commit cae0b968 authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

docs: add readmes for each of the projects

parent c7d7120e
No related branches found
No related tags found
1 merge request!17docs: add readmes for each of the projects
Pipeline #63024 failed
Showing
with 3368 additions and 225 deletions
node_modules
tmp
tools
compose
.*
dist
LEDGERS="BCOVRIN_TEST"
IDUNION_KEY=#add if you are using IDUNION as a ledger
AGENT_PEER_URL="http://localhost:4000"
AGENT_PEER_URL="http://localhost:8001"
AGENT_NAME=EXAMPLE_AGENT_45
AGENT_KEY=EXAMPLE_AGENT_45_KEY
AGENT_DID_SEED=200000000000000000000000ExampleT21 #random string min 32 chars
......
This diff is collapsed.
# Ocm Engine
# OCM Engine
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
- [Introduction](#introduction)
- [Requirements](#requirements)
- [Architecture](#architecture)
- [Setup](#setup)
- [Local env](#local)
- [Docker env](#docker)
- [Usage](#usage-via-postman)
- [Example](#send-didcomm-messages-between-two-ocms)
**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**
## Introduction
## Further help
OCM Engine is a monorepo based on [NestJS](http://nestjs.com) and [Nx](https://nx.dev), holding applications in `apps` directory and `libraries` in `libs`, which were used to create the applications and can be used for developing additional applications in `OCM` project.
### Apps list:
- Agent
- Attestation Manager
- Connection Manager
- Proof Manager
- Gateway
### Library list:
- Askar
- Clients
- Config
- Dtos
- Ledgers
- Nats
## Requirements
- Git
- NodeJS >= v18.16.0
- PostgresDB
- Nats
## Architecture
```mermaid
flowchart TD
Postman --http--> Gateway
Gateway --ws--> Postman
Gateway --tcp--> cm[Connection Manager] & am[Attestation Manager] & pm[Proof Manager] --event--> nats[NATS]
nats --event--> Agent
Agent --tcp--> Gateway
Agent <--> db[(PostgresDB)]
Agent <--> Ledger[(Ledger)]
```
## Setup
- ##### Install Git
How to install [Git](https://www.atlassian.com/git/tutorials/install-git) on my system.
- ##### Install NodeJS >= v18.16.0 version
How to install [NodeJS](https://nodejs.org/en/download/package-manager) on my system.
Second option is to use version manager like [nvm](https://github.com/nvm-sh/nvm) which will allow you to switch between different NodeJS versions.
- ##### Clone the repo
Once you have installed all Git, Node, Yarn you can clone the project with:
```
git clone git@code.vereign.com:gaiax/ocm/ocm-engine.git
```
or
```
git clone https://code.vereign.com/gaiax/ocm/ocm-engine.git
```
- ##### Install Dependencies
Go inside your cloned repo and install all dependencies with:
```
yarn install
```
## Local
You can run the entire stack or specific application locally.
Example for entire stack:
1. copy .env.example to .env
2. edit .env to your liking
3. yarn install
4. yarn infra:local or install PostgresDB and Nats broker locally and add them to .env
5. yarn serve:all
Example of running only the agent service as a rest service.
1. copy .env.example to .env
2. edit .env to your liking and change AGENT_IS_REST to true
3. yarn install
4. yarn infra:local or isntall PostgresDB and Nats broker locally and add them to .env
5. yarn serve:agent
## Docker
Example:
You can `issuer` OCM stack with:
1. edit issuer.env in compose directory
2. yarn infra:issuer
Then the gateway will be at http://localhost:8081 url
`Holder` OCM stack can be started with:
1. edit holder.env in compose directory
2. yarn infra:holder
Then the gateway will be at http://localhost:8082 url
You can run the entire stack - `issuer` and `holder` with:
1. edit issuer.env and holder.env in compose directory
2. yarn infra
Yarn commands are wrapper around docker-compose for easier use. You can still use docker-compose from compose dir.
## Usage via Postman
1. Import postman collection from the repo
2. Connect to Socket.io on the gateway address, to listen for responses with [postman](https://learning.postman.com/docs/sending-requests/websocket/websocket) event is "message"
3. Make a request
4. Response will be sent to the Socket.io
## Send Didcomm messages between two OCMs
1. Setup [Postman](#usage-via-postman) as the previous step
2. Check your local ip - on linux and macos - ifconfig, windows - ipconfig
3. Edit [issuer.env](compose/env/issuer.env)
- Change `AGENT_PEER_URL` to use your local ip - `http://your-local-ip:8001` - EXAMPLE `http://192.168.111.53:8001`
- Change `AGENT_NAME` and `AGENT_KEY` - those are the name and the key of the wallet
- Change `AGENT_DID_SEED` - this is a seed for private key from which the DID will be created.
4. Start the issuer with `yarn run infra:issuer` or `npm run infra:issuer`
5. Connect to the socket via postman. `ws://localhost:8081`
6. `Create new invitation` via postman request, on the socket listener you will receive invitation url response
7. Copy and paste this url in the chat
8. Another OCM (which performed the same setup steps, but with different values) should get this invitation url
8. Call `accept invitation` via postman with this invitation url as a body payload
9. Response will be returned on the socket, that a connection is made.
10. Get the connectionId from this response
11. Send basic message with connectionId and a string message
12. On the socket of issuer a event will be received with the message and connection id.
## License
This project is licensed under the AGPL License - see the [LICENSE](LICENSE) file for details.
Visit the [Nx Documentation](https://nx.dev) to learn more.
# OCM ENGINE - AGENT
Agent service is a wrapper around @ocm-engine/askar library.
The agent can be started with two different mods - Rest and Consumer, default behaviour is a message consumer.
Agent will consume messages from a broker (NATS) on a pre-configured stream and subjects.
Then it will do execute the task and send result to the @ocm-engine/gateway.
## Agent setup
### From the root of the project run:
#### Install dependencies
```
yarn install
```
#### Copy .env.example to .env
```
cp .env.exampe .env
```
Do changes to the .env according to your needs.
#### Start the agent locally:
```
yarn serve:agent
```
......@@ -9,7 +9,6 @@ COPY package.json yarn.lock ./
RUN yarn install
EXPOSE 8080
EXPOSE 8001
EXPOSE 6001
......
import { Module } from "@nestjs/common";
import { AskerDynamicModule } from "@ocm-engine/asker";
import { AskarDynamicModule } from "@ocm-engine/askar";
import { ConfigModule } from "@nestjs/config";
import {
agentConfig,
......@@ -23,7 +23,7 @@ const validationSchema = Joi.object({
@Module({
imports: [
AskerDynamicModule.forRootAsync(),
AskarDynamicModule.forRootAsync(),
ConfigModule.forRoot({
isGlobal: true,
load: [agentConfig, ledgersConfig, natsConfig, gatewayConfig],
......
# OCM ENGINE - Attestation Manager
Internal service.
Attestation manager accepts requests for schemas, credentials and messages.
That are coming from @ocm-engine/gateway api, then converts them to events and pushes to a NATS stream with specific for the event subject.
## Attestation Manager setup
### From the root of the project run:
#### Install dependencies
```
yarn install
```
#### Copy .env.example to .env
```
cp .env.exampe .env
```
Do changes to the .env according to your needs.
#### Start the agent locally:
```
yarn serve:am
```
# OCM ENGINE - Connection Manager
Internal service.
Connection manager accepts requests for connections, that are coming from @ocm-engine/gateway api, then converts them to events and pushes to a NATS stream with specific for the event subject.
## Connection Manager setup
### From the root of the project run:
#### Install dependencies
```
yarn install
```
#### Copy .env.example to .env
```
cp .env.exampe .env
```
Do changes to the .env according to your needs.
#### Start the agent locally:
```
yarn serve:cm
```
# OCM ENGINE - Gateway
External service.
This is the single point of communication, between Client and OCM.
Gateway have a HTTP API described in gateway-swagger.json. It will accept all valid request and return a UUID. Then after the result is ready the gateway will push result object through websocket. Socket name can be configured according to usage.
## Attestation Manager setup
### From the root of the project run:
#### Install dependencies
```
yarn install
```
#### Copy .env.example to .env
```
cp .env.exampe .env
```
Do changes to the .env according to your needs.
#### Start the agent locally:
```
yarn serve:gw
```
......@@ -46,15 +46,52 @@ export class AttestationController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to connection manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
@ApiBadRequestResponse({
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: ["name must be a string", "name should not be empty"],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiOperation({
summary: "Create schema",
......@@ -81,14 +118,54 @@ export class AttestationController {
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
description:
"Error in sending data to connection manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: [
"schemaId must be a string",
"schemaId should not be empty",
],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "Get schema by id",
......@@ -114,15 +191,27 @@ export class AttestationController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "List all schemas",
......@@ -149,14 +238,56 @@ export class AttestationController {
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: [
"schemaId must be a string",
"schemaId should not be empty",
"tag must be a string",
"tag should not be empty",
],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "Create credential definition",
......@@ -185,14 +316,56 @@ export class AttestationController {
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: [
"connectionId must be a string",
"connectionId should not be empty",
"credentialDefinitionId must be a string",
"credentialDefinitionId should not be empty",
],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "Issue credential",
......@@ -218,15 +391,27 @@ export class AttestationController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "List all credential",
......@@ -252,15 +437,27 @@ export class AttestationController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "List unaccepted credential offers",
......@@ -286,15 +483,27 @@ export class AttestationController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "Accept credential offers",
......@@ -323,14 +532,56 @@ export class AttestationController {
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
type: BadRequestException,
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: [
"connectionId must be a string",
"connectionId should not be empty",
"message must be a string",
"message should not be empty",
],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
description:
"Error in sending data to attestation manager. This error shows that attestation manager could not convert request to event or attestation manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1234",
},
},
},
},
},
})
@ApiOperation({
summary: "Send basic message",
......
......@@ -37,15 +37,27 @@ export class ConnectionController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to connection manager. This error shows that connection manager could not convert request to event or connection manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:4312",
},
},
},
},
},
})
@ApiOperation({
summary: "Create invitation for connection",
......@@ -72,14 +84,54 @@ export class ConnectionController {
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
description:
"Error in sending data to connection manager. This error shows that connection manager could not convert request to event or connection manager could not send the event to the broker.",
type: BadRequestException,
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: [
"invitationUrl must be a string",
"invitationUrl should not be empty",
],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
description:
"Error in sending data to connection manager. This error shows that connection manager could not convert request to event or connection manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:4312",
},
},
},
},
},
})
@ApiOperation({
summary: "Accept invitation for connection",
......@@ -94,7 +146,7 @@ export class ConnectionController {
return this.cmClient.sendPayload<CreateInvitationResponseDto>({
pattern: "connections",
payload: {
source: "/invitation/accept",
source: "/invitations/accept",
data: createInvitationDto,
type: CONNECTION_ACCEPT,
},
......@@ -111,15 +163,27 @@ export class ConnectionController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to connection manager. This error shows that connection manager could not convert request to event or connection manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:4312",
},
},
},
},
},
})
@ApiOperation({
summary: "List all connections",
......@@ -145,15 +209,27 @@ export class ConnectionController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to connection manager. This error shows that connection manager could not convert request to event or connection manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:4312",
},
},
},
},
},
})
@ApiOperation({
summary: "Get connection by id",
......
......@@ -37,15 +37,27 @@ export class ProofController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to proof manager. This error shows that proof manager could not convert request to event or proof manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1919",
},
},
},
},
},
})
@ApiOperation({
summary: "List received unaccepted proofs",
......@@ -72,14 +84,54 @@ export class ProofController {
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
description:
"Error in sending data to proof manager. This error shows that proof manager could not convert request to event or proof manager could not send the event to the broker.",
type: BadRequestException,
description: "Validation error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 400,
},
message: {
type: "array",
example: [
"attributes must contain at least 1 elements",
"attributes must be an array",
],
},
error: {
type: "string",
example: "Bad Request",
},
},
},
},
},
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
description:
"Error in sending data to proof manager. This error shows that proof manager could not convert request to event or proof manager could not send the event to the broker.",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1919",
},
},
},
},
},
})
@ApiOperation({
summary: "Issue proof for credential",
......@@ -105,15 +157,27 @@ export class ProofController {
"Request is accepted for execution, the response id will match the event id received from the web socket",
type: GatewayAcceptedResponseDto,
})
@ApiBadRequestResponse({
status: 400,
@ApiInternalServerErrorResponse({
description:
"Error in sending data to proof manager. This error shows that proof manager could not convert request to event or proof manager could not send the event to the broker.",
type: BadRequestException,
})
@ApiInternalServerErrorResponse({
status: 500,
description: "Unknown error",
content: {
"application/json": {
schema: {
type: "object",
properties: {
statusCode: {
type: "number",
example: 500,
},
message: {
type: "string",
example: "connect ECONNREFUSED 0.0.0.0.0:1919",
},
},
},
},
},
})
@ApiOperation({
summary: "Accept credential proof",
......
......@@ -37,7 +37,7 @@ async function bootstrap() {
app.enableShutdownHooks();
const config = new DocumentBuilder()
.setTitle("Gateway")
.setTitle("OCM Gateway")
.setDescription("OCM ENGINE GATEWAY API")
.setVersion("1.0")
.addServer(`http://${gatewayConfig.host}:${gatewayConfig.httpPort}`)
......
# OCM ENGINE - Proof Manager
Internal service.
Connection manager accepts requests for proofs, that are coming from @ocm-engine/gateway api, then converts them to events and pushes to a NATS stream with specific for the event subject.
## Proof Manager setup
### From the root of the project run:
#### Install dependencies
```
yarn install
```
#### Copy .env.example to .env
```
cp .env.exampe .env
```
Do changes to the .env according to your needs.
#### Start the agent locally:
```
yarn serve:pm
```
version: '3.8'
services:
#===================== ISSUER =========================#
agent-issuer:
labels:
- "traefik.http.routers.agent-issuer.rule=Host(`agent-issuer.local`)"
- "traefik.http.routers.agent-issuer.entrypoints=web"
gateway-issuer:
profiles:
- issuer
container_name: agent-issuer
build:
context: "../"
dockerfile: "./apps/agent/deployment/Dockerfile"
container_name: gw-issuer
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/gateway:/app/
working_dir: /app
command: node main.js
ports:
- "8081:8081"
- "8881:8881"
env_file:
- ./env/issuer.env
# ports:
# - "8080:8080"
# - "8001:8001"
depends_on:
pg_db:
condition: service_started
broker-issuer:
builder:
condition: service_completed_successfully
cm-issuer:
condition: service_started
gateway-issuer:
labels:
- "traefik.http.routers.gateway-issuer.rule=Host(`gateway-issuer.local`)"
- "traefik.http.routers.gateway-issuer.entrypoints=web"
agent-issuer:
profiles:
- issuer
container_name: gateway-issuer
build:
context: "../"
dockerfile: "./apps/gateway/deployment/Dockerfile"
container_name: agent-issuer
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/agent:/app/
working_dir: /app
command: node main.js
ports:
- "8080:8080"
- "8001:8001"
env_file:
- ./env/issuer.env
# ports:
# - "8081:8081"
# - "8881:8881"
depends_on:
builder:
condition: service_completed_successfully
cm-issuer:
condition: service_started
cm-issuer:
profiles:
- issuer
container_name: cm-issuer
build:
context: "../"
dockerfile: "./apps/connection-manager/deployment/Dockerfile"
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/connection-manager:/app/
working_dir: /app
command: node main.js
profiles:
- issuer
env_file:
- ./env/issuer.env
ports:
- "8882"
depends_on:
builder:
condition: service_completed_successfully
broker-issuer:
condition: service_started
am-issuer:
container_name: am-issuer
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/attestation-manager:/app/
working_dir: /app
command: node main.js
profiles:
- issuer
container_name: am-issuer
build:
context: "../"
dockerfile: "./apps/attestation-manager/deployment/Dockerfile"
env_file:
- ./env/issuer.env
ports:
- "8883"
depends_on:
builder:
condition: service_completed_successfully
broker-issuer:
condition: service_started
pm-issuer:
container_name: pm-issuer
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/proof-manager:/app/
working_dir: /app
command: node main.js
profiles:
- issuer
container_name: pm-issuer
build:
context: "../"
dockerfile: "./apps/proof-manager/deployment/Dockerfile"
env_file:
- ./env/issuer.env
ports:
- "8884"
depends_on:
builder:
condition: service_completed_successfully
broker-issuer:
condition: service_started
#===================== holder =========================#
agent-holder:
labels:
- "traefik.http.routers.agent-issuer.rule=Host(`agent-holder.local`)"
- "traefik.http.routers.agent-issuer.entrypoints=web"
gateway-holder:
profiles:
- holder
container_name: agent-holder
build:
context: "../"
dockerfile: "./apps/agent/deployment/Dockerfile"
container_name: gw-holder
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/gateway:/app/
working_dir: /app
command: node main.js
ports:
- "8091:8081"
- "8891:8881"
env_file:
- ./env/holder.env
# ports:
# - "8080:8080"
# - "8001:8001"
depends_on:
pg_db:
condition: service_started
broker-holder:
builder:
condition: service_completed_successfully
cm-issuer:
condition: service_started
gateway-holder:
labels:
- "traefik.http.routers.gateway-issuer.rule=Host(`gateway-holder.local`)"
- "traefik.http.routers.gateway-issuer.entrypoints=web"
agent-holder:
profiles:
- holder
container_name: gateway-holder
build:
context: "../"
dockerfile: "./apps/gateway/deployment/Dockerfile"
container_name: agent-holder
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/agent:/app/
working_dir: /app
command: node main.js
ports:
- "8090:8080"
- "6001:6001"
env_file:
- ./env/holder.env
# ports:
# - "8081:8081"
# - "8881:8881"
depends_on:
cm-holder:
builder:
condition: service_completed_successfully
cm-issuer:
condition: service_started
cm-holder:
container_name: cm-holder
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/connection-manager:/app/
working_dir: /app
command: node main.js
profiles:
- holder
container_name: cm-holder
build:
context: "../"
dockerfile: "./apps/connection-manager/deployment/Dockerfile"
env_file:
- ./env/holder.env
ports:
- "8882"
depends_on:
broker-holder:
builder:
condition: service_completed_successfully
broker-issuer:
condition: service_started
am-holder:
container_name: am-holder
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/attestation-manager:/app/
working_dir: /app
command: node main.js
profiles:
- holder
container_name: am-holder
build:
context: "../"
dockerfile: "./apps/attestation-manager/deployment/Dockerfile"
env_file:
- ./env/holder.env
ports:
- "8883"
depends_on:
broker-holder:
builder:
condition: service_completed_successfully
broker-issuer:
condition: service_started
pm-holder:
container_name: pm-holder
image: node:18.16.0
volumes:
- ./data/node_modules:/app/node_modules
- ./data/dist/apps/proof-manager:/app/
working_dir: /app
command: node main.js
profiles:
- holder
container_name: pm-holder
build:
context: "../"
dockerfile: "./apps/proof-manager/deployment/Dockerfile"
env_file:
- ./env/holder.env
ports:
- "8884"
depends_on:
broker-holder:
builder:
condition: service_completed_successfully
broker-issuer:
condition: service_started
#===================== INFRA =========================#
builder:
privileged: true
image: node:18.16.0-buster-slim
volumes:
- ./../yarn.lock:/app/yarn.lock
- ./../package.json:/app/package.json
- ./../apps:/app/apps
- ./../libs:/app/libs
- ./../nx.json:/app/nx.json
- ./../tsconfig.base.json:/app/tsconfig.base.json
- ./data/node_modules:/app/node_modules
- ./data/dist:/app/dist
working_dir: /app
command:
- sh
- -c
- |
whoami
apt update -y && apt install python3 git make build-essential -y
yarn install
yarn build:all
exit 0
pg_db:
image: 'postgres:latest'
......@@ -201,7 +256,6 @@ services:
volumes:
- ./data/issuer/nats/:/data/
broker-holder:
profiles:
- holder
......@@ -214,16 +268,3 @@ services:
volumes:
- ./data/holder/nats/:/data/
reverse-proxy:
image: traefik:v2.10.1
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.webextra.address=:8001"
ports:
- "80:80"
- "8001:8001"
- "8080:8080"
volumes:
- ./data/var/run/docker.sock:/var/run/docker.sock
LEDGERS="BCOVRIN_TEST"
IDUNION_KEY=
AGENT_PEER_URL="http://agent-holder:8001"
AGENT_NAME=DEV_AGENT_HOLDER_OCM # this should be changed to company name
AGENT_KEY=HwNJroKHTSSj3XvE7ZAnuKiTn2C4QkFvxEqfm5rzhNrh #example random string
AGENT_DID_SEED=200000000000000000000000TCuste21 #did private key seed min lenght 32
AGENT_PEER_URL="http://agent-holder:6001"
AGENT_NAME=DEV_AGENT_HOLDER_OCM_4 # this should be changed to company name
AGENT_KEY=DEV_AGENT_HOLDER_OCM_4 #example random string
AGENT_DID_SEED=2000000000000000CCA120000000TCuste21jsjs #did private key seed min lenght 32
AGENT_DB_HOST=pg_db:5432
AGENT_DB_USER=postgres
AGENT_DB_PASS=postgres
......@@ -16,7 +16,7 @@ AGENT_RETE_LIMIT=5
NATS_SERVERS=broker-holder:4222
NATS_STREAM_NAME=ssi_holder_stream
NATS_SUBJECTS="connections.*,proofs.*,credentials.*,schemas.*"
NATS_SUBJECTS="connections.*,proofs.*,credentials.*,schemas.*,messages.*"
GATEWAY_HTTP_PORT=8081
GATEWAY_TCP_PORT=8881
......@@ -28,7 +28,7 @@ CONNECTION_SERVICE_TCP_PORT=8882
CONNECTION_SERVICE_HOST=cm-holder
ATTESTATION_SERVICE_TCP_PORT=8883
ATTESTATION_SERVICE_HOST=ap-holder
ATTESTATION_SERVICE_HOST=am-holder
PROOF_SERVICE_TCP_PORT=8884
PROOF_SERVICE_HOST=pm-holder
......@@ -2,9 +2,9 @@ LEDGERS="BCOVRIN_TEST"
IDUNION_KEY=
AGENT_PEER_URL="http://agent-issuer:8001"
AGENT_NAME=DEV_AGENT_ISSUER_OCM # this should be changed to company name
AGENT_KEY=HwNJroKHTSSj3XvE7ZAnuKiTn2C4QkFvxEqfm5rzhNrh #example random string
AGENT_DID_SEED=200000000000000000000000TCuste21 #did private key seed min lenght 32
AGENT_NAME=DEV_AGENT_ISSUER_OCM_4 # this should be changed to company name
AGENT_KEY=DEV_AGENT_ISSUER_OCM_4 #example random string
AGENT_DID_SEED=20000000000000000000000aca0xxaDTCuste21udhasjs #did private key seed min lenght 32
AGENT_DB_HOST=pg_db:5432
AGENT_DB_USER=postgres
AGENT_DB_PASS=postgres
......@@ -16,7 +16,7 @@ AGENT_RETE_LIMIT=5
NATS_SERVERS=broker-issuer:4222
NATS_STREAM_NAME=ssi_issuer_stream
NATS_SUBJECTS="connections.*,proofs.*,credentials.*,schemas.*"
NATS_SUBJECTS="connections.*,proofs.*,credentials.*,credentials.definition.*,credentials.offer.*,schemas.*,messages.*"
GATEWAY_HTTP_PORT=8081
GATEWAY_TCP_PORT=8881
......@@ -28,7 +28,7 @@ CONNECTION_SERVICE_TCP_PORT=8882
CONNECTION_SERVICE_HOST=cm-issuer
ATTESTATION_SERVICE_TCP_PORT=8883
ATTESTATION_SERVICE_HOST=ap-issuer
ATTESTATION_SERVICE_HOST=am-issuer
PROOF_SERVICE_TCP_PORT=8884
PROOF_SERVICE_HOST=pm-issuer
This diff is collapsed.
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment