Skip to content
Snippets Groups Projects
Unverified Commit ccb2cd58 authored by Berend Sliedrecht's avatar Berend Sliedrecht Committed by GitHub
Browse files

Merge pull request #1 from spherity/fixes-to-start-docker-container

minor fixes to make the docker container work and ssi-abstraction cleanup
parents ff4c37c0 5a76911b
No related branches found
No related tags found
2 merge requests!9feat(ssi): Establish a trusted connection with yourself,!8Project house-keeping, refactoring and reorganizing
Showing
with 52 additions and 6701 deletions
......@@ -28,7 +28,7 @@ pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
logs/log.json
**/logs/log.json
# OS
.DS_Store
......
......@@ -17,7 +17,7 @@ The Attestation Manager is the microservice responsible for handling the feature
### Pre-requisite
* yarn
* pnpm
* docker
* docker-compose
* PostgreSQL
......@@ -54,12 +54,12 @@ to run all the services.
## Build
```
yarn build
pnpm build
```
## Run
```
yarn start
pnpm start
```
### Environment Variables Required
......@@ -96,13 +96,13 @@ yarn start
```bash
# unit tests
$ npm run test
$ pnpm test
# e2e tests
$ npm run test:e2e
$ pnpm test:e2e
# test coverage
$ npm run test:cov
$ pnpm test:cov
```
......
......@@ -15,7 +15,7 @@
"prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio",
"start": "nest start",
"start:docker": "yarn prisma:generate && yarn dbSchema && yarn start",
"start:docker": "pnpm prisma:generate && pnpm dbSchema && pnpm start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston';
import winston, { Logger } from 'winston';
import ecsFormat from '@elastic/ecs-winston-format';
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import winston = require('winston');
import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) {
......
......@@ -23,7 +23,7 @@ The service implements REST endpoints, events and calls to other services relate
### Pre-requisites
* yarn
* pnpm
* docker
* docker-compose
* postgres
......@@ -103,13 +103,13 @@ to run all the services.
```bash
# unit tests
$ npm run test
$ pnpm test
# e2e tests
$ npm run test:e2e
$ pnpm test:e2e
# test coverage
$ npm run test:cov
$ pnpm test:cov
```
## GDPR
......
......@@ -14,8 +14,8 @@
"prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio",
"start": "nest start",
"start:docker": "yarn prisma:generate && yarn dbSchema && yarn start",
"start:docker:prod": "yarn prisma:migrate && node dist/src/main",
"start:docker": "pnpm prisma:generate && pnpm dbSchema && pnpm start",
"start:docker:prod": "pnpm prisma:migrate && node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston';
import ecsFormat = require('@elastic/ecs-winston-format');
import winston = require('winston');
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import winston, { Logger } from 'winston';
import ecsFormat from '@elastic/ecs-winston-format';
import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) {
......
......@@ -17,7 +17,7 @@ The Principal Manager is the microservice responsible for handling the authentic
### Pre-requisite
* yarn
* pnpm
* docker
* docker-compose
* Postgres
......@@ -55,12 +55,12 @@ to run all the services.
## Build
```
yarn build
pnpm build
```
## Run
```
yarn start
pnpm start
```
### Environment variable required
......@@ -91,13 +91,13 @@ yarn start
```bash
# unit tests
$ yarn test
$ pnpm test
# e2e tests
$ yarn test:e2e
$ pnpm test:e2e
# test coverage
$ yarn test:cov
$ pnpm test:cov
```
## GDPR
......
......@@ -15,7 +15,7 @@
"prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio",
"start": "nest start",
"start:docker": "yarn prisma:migrate && yarn start",
"start:docker": "pnpm prisma:migrate && pnpm start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston';
import ecsFormat = require('@elastic/ecs-winston-format');
import winston = require('winston');
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import winston, { Logger } from 'winston';
import ecsFormat from '@elastic/ecs-winston-format';
import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) {
......
......@@ -4,6 +4,7 @@
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"target": "es6",
"sourceMap": true,
......@@ -29,4 +30,4 @@
"config",
],
"exclude": ["node_modules", "./dist/**/*"]
}
\ No newline at end of file
}
This diff is collapsed.
......@@ -16,7 +16,7 @@ The Proof Manager, is the microservice responsible for handling the features rel
### Pre-requisite
* yarn
* pnpm
* docker
* docker-compose
* Postgres
......@@ -56,12 +56,12 @@ to run all the services.
## Build
```
yarn build
pnpm build
```
## Run
```
yarn start
pnpm start
```
### Environment Variables Required
......@@ -96,13 +96,13 @@ yarn start
```bash
# unit tests
$ npm run test
$ pnpm test
# e2e tests
$ npm run test:e2e
$ pnpm test:e2e
# test coverage
$ npm run test:cov
$ pnpm test:cov
```
......
......@@ -15,7 +15,7 @@
"dbSchema": "npx prisma db push --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio",
"start": "nest start",
"start:docker": "yarn prisma:generate && yarn dbSchema && yarn start",
"start:docker": "pnpm prisma:generate && pnpm dbSchema && pnpm start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston';
import ecsFormat = require('@elastic/ecs-winston-format');
import winston = require('winston');
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import winston, { Logger } from 'winston';
import ecsFormat from '@elastic/ecs-winston-format';
import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) {
......
......@@ -26,7 +26,7 @@ with the default exposed ports:
Dependencies:
```bash
$ yarn
$ pnpm install
```
* **If docker is not installed, [Install docker](https://docs.docker.com/engine/install/)**.
......@@ -85,13 +85,13 @@ $ docker-compose up --build
```bash
# unit tests
$ yarn test
$ pnpm test
# e2e tests
$ yarn test:e2e
$ pnpm test:e2e
# test coverage
$ yarn test:cov
$ pnpm test:cov
```
......
import * as Joi from 'joi';
import Joi from 'joi';
const validationSchema = Joi.object({
NATS_URL: Joi.string().required(),
......
/* eslint-disable */
import { subscribe } from './listener';
describe('listener', () => {
it('should subscribe agent to available events', async () => {
const agent = {
events: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
on: (eventName: string, cb: () => void) => {},
},
};
......
......@@ -9,12 +9,12 @@ import { listenerConfig } from './listenerConfig';
* @param agent - the agent that has been initialized on startup
* @param natsClient - the client that specifies how events are published
*/
export const subscribe = async (
export const subscribe = (
agent: Agent,
natsClient: NatsClientService,
) => {
for (let i = 0; i < listenerConfig.length; i += 1) {
agent.events.on(listenerConfig[i], async ({ payload }: any) => {
agent.events.on(listenerConfig[i], ({ payload }) => {
logger.info(
`${listenerConfig[i]} called. Payload: ${JSON.stringify(payload)}`,
);
......
......@@ -53,18 +53,16 @@ const agentFactory = {
}
const indyLedgers: LedgerInfo[] = ledgerIds.map((id: LedgerIds) => {
const ledgerId: LedgerIds = id;
if (!LEDGER_GENESIS?.[ledgerId]) {
if (!LEDGER_GENESIS?.[id]) {
throw new Error(
`No pool transaction genesis provided for ledger ${ledgerId}`,
`No pool transaction genesis provided for ledger ${id}`,
);
}
const ledger: LedgerInfo = {
id: `${ledgerId}_Genesis`,
indyNamespace: `${ledgerNamespaces[ledgerId]}`,
genesisTransactions: LEDGER_GENESIS?.[ledgerId],
id: `${id}_Genesis`,
indyNamespace: `${ledgerNamespaces[id]}`,
genesisTransactions: LEDGER_GENESIS?.[id],
isProduction: false,
};
......@@ -95,7 +93,7 @@ const agentFactory = {
agent.registerOutboundTransport(new HttpOutboundTransport());
await agent.initialize();
await subscribe(agent, natsClient);
subscribe(agent, natsClient);
if (agent.isInitialized) {
ledgerIds.map(async (id: LedgerIds) => {
......@@ -160,7 +158,7 @@ const agentFactory = {
name: NATSServices.SERVICE_NAME,
transport: Transport.NATS,
options: {
servers: [config().nats.url as string],
servers: [config().nats.url],
},
},
]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment