Skip to content
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

fix/ICS-197 fix docker-compose and readme.md #367

Merged
merged 2 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# NESTJS CONFIG
NESTJS_PORT=3000

# DB Config
DB_HOST=postgres
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=password
DB_NAME=dev-test

# Redis
REDIS_VERSION=6.0.8
REDIS_PASSWORD=password
REDIS_PORT=6379
REDIS_HOST=redis

#NATS.IO CONFIG
NATS_VERSION=2.1.8
NATS_CLIENTS_URL=nats:4222
NATS_ENVIRONMENT_NAME=dev

# ENS
CHAIN_ID=73799
CHAIN_NAME=volta
ENS_URL=https://volta-rpc-vkn5r5zx4ke71f9hcu0c.energyweb.org
PUBLIC_RESOLVER_ADDRESS=0x0a97e07c4Df22e2e31872F20C5BE191D5EFc4680
ENS_REGISTRY_ADDRESS=0xd7CeF70Ba7efc2035256d828d5287e2D285CD1ac
DID_REGISTRY_ADDRESS=0xc15d5a57a8eb0e1dcbe5d88b8f9a82017e5cc4af
CLAIM_MANAGER_ADDRESS=0x2F259e307D0Ba78902391c070e7b4aA043E74DBB
DOMAIN_NOTIFIER_ADDRESS=0xeea658026d6CDede4380D3aD030beAC911758A93
STAKING_POOL_FACTORY_ADDRESS=0x4b2A127680320eD980beAa7aD9b2447B96BC32fC
RESOLVER_V1_ADDRESS=0xf5EA22c1F799d425356c2aab2004200Ab4490D2b

# ASSETS
ASSETS_MANAGER_ADDRESS=0xE258fA7D1cc8964D0dEB7204Df947bCa42b2c940
ASSETS_SYNC_INTERVAL_IN_HOURS=10
ASSETS_SYNC_HISTORY_INTERVAL_IN_HOURS=21
ASSETS_SYNC_ENABLED=true

# IPFS
IPFS_URL=https://ipfs.infura.io:5001/api/v0/

# INTERVALS
DIDDOC_SYNC_INTERVAL_IN_HOURS=1
DID_SYNC_MAX_CONCURRENT=2
DID_SYNC_ENABLED=false
ENS_SYNC_INTERVAL_IN_HOURS=1
ENS_SYNC_ENABLED=false
DID_SYNC_MODE_FULL=false

# AWS ECR
DOCKER_REGISTRY=
DOCKER_REPOSITORY=
DOCKER_TAG=

# AUTH
ENABLE_AUTH=true
JWT_PRIVATE_KEY=private.pem
JWT_PUBLIC_KEY=public.pem
STRATEGY_CACHE_SERVER=http://localhost:3000/v1/
STRATEGY_PRIVATE_KEY=eab5e5ccb983fad7bf7f5cb6b475a7aea95eff0c6523291b0c0ae38b5855459c
STRATEGY_NUM_BLOCKS_BACK=10
JWT_ACCESS_TOKEN_EXPIRES_IN=1m
JWT_REFRESH_TOKEN_EXPIRES_IN=2m
JWT_ACCESS_TOKEN_NAME=token
JWT_REFRESH_TOKEN_NAME=refreshToken

# DID UNIVERSAL RESOLVER
UNIVERSAL_RESOLVER_URL=https://dev.uniresolver.io/1.0/identifiers/

# SENTRY CONFIG
SENTRY_DNS=
SENTRY_ENV=
SENTRY_RELEASE=

# LOGS CONFIG
LOGS_DIRECTORY=logs
13 changes: 7 additions & 6 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ DB_USERNAME=
DB_PASSWORD=
DB_NAME=

# REDIS
REDIS_VERSION=6.0.8
REDIS_PASSWORD=
REDIS_PORT=
REDIS_HOST=

# NATS.IO CONFIG
NATS_VERSION=2.1.8
NATS_CLIENTS_URL=
Expand All @@ -31,12 +37,6 @@ ASSETS_SYNC_INTERVAL_IN_HOURS=10
ASSETS_SYNC_HISTORY_INTERVAL_IN_HOURS=21
ASSETS_SYNC_ENABLED=true

# REDIS
REDIS_VERSION=6.0.8
REDIS_PASSWORD=

REDIS_PORT=
REDIS_HOST=

# IPFS
IPFS_URL=https://ipfs.infura.io:5001/api/v0/
Expand All @@ -47,6 +47,7 @@ DID_SYNC_ENABLED=true
DID_SYNC_MODE_FULL=true
ENS_SYNC_INTERVAL_IN_HOURS=11
ENS_SYNC_ENABLED=true
DID_SYNC_MODE_FULL=false

# AWS ECR
DOCKER_REGISTRY=
Expand Down
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repository was formerly refered to as the `iam-cache-server`.
```bash
# development
$ git checkout develop
$ cp .env.dist .env
$ cp .env.dev .env
$ cp docker-compose.dev.yml docker-compose.yml
```

Expand All @@ -24,34 +24,7 @@ $ git checkout master
$ cp .env.dist .env
$ cp docker-compose.prod.yml docker-compose.yml
```

### Populate env file for development

The following values can be used in the `.env` file

#### NESTJS CONFIG

NESTJS_PORT=

#### DB Config

DB_HOST=postgres\
DB_PORT=5432\
DB_USERNAME=postgres\
DB_PASSWORD=password\
DB_NAME=dev

#### Redis

REDIS_VERSION=6.0.8\
REDIS_PASSWORD="password"\
REDIS_PORT=6379\
REDIS_HOST=redis

#### NATS.IO CONFIG

NATS_VERSION=2.1.8\
NATS_CLIENTS_URL=nats:4222
In `production` empty values need to be populated in `.env` file, while `development` is prepopulated with sample values

## Installation

Expand All @@ -63,9 +36,6 @@ $ npm run generate:jwtkeys

## Running the app

### Populate env file for development

The values from .env.dev can be used to run locally

```bash
# development
Expand Down
7 changes: 4 additions & 3 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:12.22-alpine As development
FROM node:16.10.0 As development

WORKDIR /app

RUN apk add --no-cache bash curl openssl python make g++ && \
RUN apt-get update && \
apt-get install -y bash curl openssl python-pip make g++ && \
curl -sfL https://install.goreleaser.com/github.com/tuananh/node-prune.sh | sh && \
npm install node-dev -g && npm cache clean --force

Expand All @@ -11,7 +12,7 @@ COPY docker ./docker

RUN chmod +x ./docker/node-modules-clean.sh

RUN npm i && npm cache clean --force && \
RUN npm ci && npm cache clean --force && \
./docker/node-modules-clean.sh && \
npm dedupe && \
rm -f .npmrc
35 changes: 2 additions & 33 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repository was formerly refered to as the `iam-cache-server`.
```bash
# development
$ git checkout develop
$ cp .env.dist .env
$ cp .env.dev .env
$ cp docker-compose.dev.yml docker-compose.yml
```

Expand All @@ -24,34 +24,7 @@ $ git checkout master
$ cp .env.dist .env
$ cp docker-compose.prod.yml docker-compose.yml
```

### Populate env file for development

The following values can be used in the `.env` file

#### NESTJS CONFIG

NESTJS_PORT=

#### DB Config

DB_HOST=postgres\
DB_PORT=5432\
DB_USERNAME=postgres\
DB_PASSWORD=password\
DB_NAME=dev

#### Redis

REDIS_VERSION=6.0.8\
REDIS_PASSWORD="password"\
REDIS_PORT=6379\
REDIS_HOST=redis

#### NATS.IO CONFIG

NATS_VERSION=2.1.8\
NATS_CLIENTS_URL=nats:4222
In `production` empty values need to be populated in `.env` file, while `development` is prepopulated with sample values

## Installation

Expand All @@ -63,10 +36,6 @@ $ npm run generate:jwtkeys

## Running the app

### Populate env file for development

The values from .env.dev can be used to run locally

```bash
# development
$ npm run docker:watch
Expand Down
Loading