Skip to content

Commit

Permalink
Merge branch 'migrate-to-mongodb' of github.com:blockcoders/ink-subst…
Browse files Browse the repository at this point in the history
…rate-explorer-api into migrate-to-mongodb
  • Loading branch information
rubenguc committed Dec 8, 2022
2 parents 00965cf + c77e1dd commit 88ce24f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
10 changes: 5 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NODE_ENV=production
PORT=5000
PORT=8080
LOG_NAME=ink-substrate-explorer-api
LOG_LEVEL=debug

Expand All @@ -8,11 +8,11 @@ GRAPHQL_PLAYGROUND=true
GRAPHQL_SORT_SCHEMA=true
GRAPHQL_INTROSPECTION=true

DATABASE_HOST=postgres
DATABASE_HOST=mongo
DATABASE_NAME=ink
DATABASE_USERNAME=root
DATABASE_PASSWORD=password
DATABASE_PORT=5432
DATABASE_USERNAME=mongodb
DATABASE_PASSWORD=mongodb
DATABASE_PORT=27017
DATABASE_SSL_CA=""
DATABASE_RETRY_ATTEMPTS=5
DATABASE_RETRY_DELAY=3000
Expand Down
35 changes: 19 additions & 16 deletions dev-docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
version: '3.7'
services:
postgres:
image: postgres:14.4
mongo:
image: mongo:latest
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=root
- MONGO_INITDB_DATABASE=ink
- MONGO_INITDB_USER=mongodb
- MONGO_INITDB_PWD=mongodb
ports:
- '27017:27017'
volumes:
- ./initdb.d/:/docker-entrypoint-initdb.d/
mongo-express:
image: mongo-express
restart: always
ports:
- 5432:5432
- 8081:8081
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=password
- POSTGRES_DB=ink
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
ME_CONFIG_MONGODB_URL: mongodb://root:root@mongo:27017
substrate:
image: blockcoders/substrate-contracts-node
restart: on-failure
ports:
- 9944:9944
command: '--dev --ws-external'
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: "admin@admin.com"
PGADMIN_DEFAULT_PASSWORD: "admin"
ports:
- 80:80
depends_on:
- postgres
command: '--dev --ws-external'
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ services:
mongo-express:
image: mongo-express
restart: always
depends_on:
- mongo
ports:
- 8081:8081
environment:
Expand Down
2 changes: 1 addition & 1 deletion src/subscriptions/subscriptions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { ApiPromise } from '@polkadot/api'
import { BlockHash, Header } from '@polkadot/types/interfaces'
import { InjectPinoLogger, PinoLogger } from 'nestjs-pino'
import PQueue from 'p-queue'
import { DbService } from 'src/db/db.service'
import { BlocksService } from '../blocks/blocks.service'
import { DbService } from '../db/db.service'
import { EnvService } from '../env/env.service'
import { EventsService } from '../events/events.service'
import { SyncService } from '../sync/sync.service'
Expand Down

0 comments on commit 88ce24f

Please sign in to comment.