Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Elshan Dzhafarov (CryptoBadBoy) committed Nov 18, 2021
1 parent da42b2b commit 0022c5d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .env-docker
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ POLKADOT_RPC_URL=wss://rpc.polkadot.io
KUSAMA_RPC_URL=wss://kusama-rpc.polkadot.io
HOST=localhost
PORT=3000
SUBSCRIBER_URL=http://fractapp-server_subscriber_1:9505
SUBSCRIBER_URL=http://127.0.0.1:9505
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
## Only android version

## Getting Started

1. Configure .env
## Configure
```sh
MONGODB_CONNECTION={mongodb connection string}
POLKADOT_RPC_URL={polkadot node}
KUSAMA_RPC_URL={kusama node}
SUBSCRIBER_URL={subscriber url}
SUBSCRIBER_URL={subscriber from fractapp-server url}
HOST=localhost
PORT=3000
```

## Manual
1. Create .env config

2. Install yarn packages
```sh
yarn install
Expand All @@ -22,22 +23,46 @@ yarn install
yarn build
```

4. Start scanner for Polkadot
4. Start api
```sh
yarn api
```

5. Start scanner for Polkadot
```sh
yarn scanner Polkadot {default height for first launch}
```

5. Start scanner for Kusama
6. Start scanner for Kusama
```sh
yarn scanner Kusama {default height for first launch}
```

6. Start notifier for Polkadot
7. Start notifier for Polkadot
```sh
yarn notifier Polkadot {default height for first launch}
```

7. Start notifier for Kusama
8. Start notifier for Kusama
```sh
yarn notifier Kusama {default height for first launch}
```

9. Start notifier for Kusama
```sh
yarn notifier Kusama {default height for first launch}
```

## Docker

Config for docker is in .env-docker

```sh
docker-compose up
```

## Tests

```sh
yarn test
```
17 changes: 0 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
version: "3.9" # optional since v1.27.0

networks:
notifier_network:
external:
name: fractapp-server_subscriber_network

services:
api:
build:
context: .
dockerfile: ./docker/api/Dockerfile
ports:
- "3000:3000"
networks:
- notifier_network

notifier-polkadot:
environment:
Expand All @@ -22,8 +15,6 @@ services:
build:
context: .
dockerfile: ./docker/notifier/Dockerfile
networks:
- notifier_network

notifier-kusama:
environment:
Expand All @@ -32,8 +23,6 @@ services:
build:
context: .
dockerfile: ./docker/notifier/Dockerfile
networks:
- notifier_network

scanner-polkadot:
environment:
Expand All @@ -42,8 +31,6 @@ services:
build:
context: .
dockerfile: ./docker/scanner/Dockerfile
networks:
- notifier_network

scanner-kusama:
environment:
Expand All @@ -52,8 +39,6 @@ services:
build:
context: .
dockerfile: ./docker/scanner/Dockerfile
networks:
- notifier_network

mongo:
image: mongo
Expand All @@ -62,6 +47,4 @@ services:
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
networks:
- notifier_network

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devScanner": "ts-node src/cmd/scanner.ts",
"devNotifier": "ts-node src/cmd/notifier.ts",
"devBot": "ts-node src/cmd/bot.ts",
"test": "jest"
"test": "jest --coverage"
},
"dependencies": {
"@polkadot/api": "^6.3.1",
Expand Down

0 comments on commit 0022c5d

Please sign in to comment.