Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit c628503

Browse files
Dropping microservices setup
* Removed Dockerfiles in all auxiliary packages * Removed entrypoints (e.g. run.ts) in all auxiliary packages * Removed Dockerfile-dev's, as they served no purpose * Removed esbuild and build:prod commands, as they weren't used in production setup * Removed worker package, as it's not used in monolith setup * Removed everything regarding redis * Removed docker-compose.yml and docker-compose.microservice.yml (docker-compose.current.yml became docker-compose.yml) * Removed configs for microservices setup * Updated docs
1 parent db066cf commit c628503

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+69
-2834
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ dist
2828
**/config/main.json
2929
**/config/secret.json
3030

31-
redis/
32-
3331
docs/.DS_Store
3432
/packages/core/kusama-matrix.txt
3533
/packages/core/polkadot-matrix.txt
@@ -43,4 +41,4 @@ docs/.DS_Store
4341
build/**
4442
dist/**
4543
.next/**
46-
coverage/**
44+
coverage/**

Dockerfile-dev

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -26,52 +26,30 @@ The nominating backend will routinely change its nominations at every era. The b
2626

2727
> A monorepo containing TypeScript microservices for the Thousand Validators Program.
2828
29-
The following is a monorepo of packages for the Thousand Validators Program. Each package is a microservice that can be run independently or together with other microservices.
29+
The following is a monorepo of packages for the Thousand Validators Program.
3030

3131
The monorepo is managed using Yarn workspaces, and contains the following packages:
3232
- [`packages/common`](packages/common): A package containing common code shared across all microservices.
3333
- [`packages/core`](packages/core): A package containing the core logic of the Thousand Validators Program.
3434
- [`packages/gateway`](packages/gateway): A package for an API gateway that exposes the backend with a REST API.
3535
- [`packages/telemetry`](packages/telemetry): A package for a telemetry client that monitors uptime
36-
- [`packages/worker`](packages/worker): A packages for job queue workers that perform background tasks.
37-
38-
3936

4037
## Installation & Setup
4138

4239
### Instances
4340

4441
There's a few ways of running the backend with docker containers, either in kubernetes, or with docker-compose.
4542

46-
There is the `Current / Monolith` way of running instances, and the `Microservice` way of running instances.
47-
48-
`Current / Monolith` Architecture:
49-
50-
![Current / Monolith Architecture](./docs/architecture/monolith.png)
43+
Current architecture:
5144

52-
53-
`Microservice` Architecture:
54-
55-
![Microservice Architecture](./docs/architecture/microservice.png)
45+
![Current Architecture](./docs/architecture/monolith.png)
5646

5747
The following are different ways of running in either `Current` or `Microservice` architecture with either `Kusama` or `Polkadot`, and either `Development` or `Production`:
5848

5949
- `Kusama Current`
6050
- Running as a monolith with production values
6151
- `Polkadot Current`
6252
- Running as a monolith with production values
63-
- `Kusama Microservice`
64-
- Running as microservices with production values
65-
- `Polkadot Microservice`
66-
- Running as microservices with production values
67-
- `Polkadot Current Dev`
68-
- Running as a monolith with development values
69-
- `Kusama Current Dev`
70-
- Running as a monolith with development values
71-
- `Kusama Microservice Dev`
72-
- Running as microservices with development values
73-
- `Polkadot Microservice Dev`
74-
- Running as microservices with development values
7553

7654
Each package contains a `Dockerfile`, which is used for running in production, and `Dockerfile-dev`, which is used for development. The development images will use run with `nodemon` so that each time files is saved/changed it will rebuild the image and restart the container. Any changes for the regular run `Dockerfile` will need a manual rebuilding of the docker image.
7755

@@ -86,8 +64,7 @@ cd 1k-validators-be
8664
### Installing System Dependencies
8765

8866
Ensure the following are installed on your machine:
89-
- [Node.js](https://nodejs.org/en/) (v12 or higher)
90-
- [Yarn](https://yarnpkg.com/) (v1.22 or higher)
67+
- [Node.js](https://nodejs.org/en/) (v21 or higher)
9168
- [Docker](https://www.docker.com/) (v19 or higher)
9269

9370

@@ -121,30 +98,6 @@ Polkadot Current / Monolith Dev:
12198
yarn docker:polkadot-current-dev:start
12299
```
123100

124-
Kusama Microservice Production:
125-
126-
```bash
127-
yarn docker:kusama-microscervice:start
128-
```
129-
130-
Kusama Microservice Dev:
131-
132-
```bash
133-
yarn docker:kusama-microservice-dev:start
134-
```
135-
136-
Polkadot Microservice Production:
137-
138-
```bash
139-
yarn docker:polkadot-current:start
140-
```
141-
142-
Polkadot Microservice Dev:
143-
144-
```bash
145-
yarn docker:polkadot-current-dev:start
146-
```
147-
148101
### Install Yarn Dependencies
149102
```bash
150103
yarn install
@@ -170,50 +123,6 @@ This will create a configuration file for a Kusama instance that mirrors what is
170123
yarn create-config-polkadot-current
171124
```
172125

173-
Kusama Microservice Config:
174-
This will create configuration files for a Kusama instance for each microservice that runs with production values. This runs `core`, `gateway`, `telemetry`, and `worker` as separate processes in their own container - each one needs it's own configuration file.
175-
```bash
176-
yarn create-config-kusama-microservice
177-
```
178-
179-
Polkadot Microservice Config:
180-
This will create configuration files for a Polkadot instance for each microservice that runs with production values. This runs `core`, `gateway`, `telemetry`, and `worker` as separate processes in their own container - each one needs it's own configuration file.
181-
```bash
182-
yarn create-config-polkadot-microservice
183-
```
184-
185-
186-
187-
### Running the Microservices
188-
189-
#### Running `Kusama Current` or `Polkadot Current`:
190-
191-
Either is from the same `docker-compose.current.yml` file, and runs only the `core` container, `mongo` container, and `mongo-express` container.
192-
193-
Build and run as detached daemon:
194-
```bash
195-
docker compose -f docker-compose.current.yml up -d --build
196-
```
197-
198-
#### Running `Kusama Microservice` or `Polkadot Microservice`:
199-
200-
Either is from the same `docker-compose.microservice.yml` file. This runs `core`, `gateway`, `telemetry`, and `worker` as separate processes in their own container - each one needs it's own configuration file. It additionally runs a `redis`, `mongo`, and `mongo-express` container.
201-
202-
Build and run as detached daemon:
203-
```bash
204-
docker compose -f docker-compose.microservice.yml up -d --build
205-
```
206-
207-
#### Running `Kusama Current Dev`, `Polkadot Current Dev`, `Kusama Microservice Dev`, or `Polkadot Microservice Dev`
208-
209-
Either is from the same `docker-compose.yml` file.
210-
211-
Build and run as detached daemon:
212-
```bash
213-
docker compose -f docker-compose.yml up -d --build
214-
```
215-
216-
217126
### Viewing Logs
218127

219128
To view the aggregated logs of all the containers:

docker-compose.current.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

docker-compose.microservice.yml

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)