You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+4-95Lines changed: 4 additions & 95 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,52 +26,30 @@ The nominating backend will routinely change its nominations at every era. The b
26
26
27
27
> A monorepo containing TypeScript microservices for the Thousand Validators Program.
28
28
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.
30
30
31
31
The monorepo is managed using Yarn workspaces, and contains the following packages:
32
32
-[`packages/common`](packages/common): A package containing common code shared across all microservices.
33
33
-[`packages/core`](packages/core): A package containing the core logic of the Thousand Validators Program.
34
34
-[`packages/gateway`](packages/gateway): A package for an API gateway that exposes the backend with a REST API.
35
35
-[`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
-
39
36
40
37
## Installation & Setup
41
38
42
39
### Instances
43
40
44
41
There's a few ways of running the backend with docker containers, either in kubernetes, or with docker-compose.
45
42
46
-
There is the `Current / Monolith` way of running instances, and the `Microservice` way of running instances.
The following are different ways of running in either `Current` or `Microservice` architecture with either `Kusama` or `Polkadot`, and either `Development` or `Production`:
58
48
59
49
-`Kusama Current`
60
50
- Running as a monolith with production values
61
51
-`Polkadot Current`
62
52
- 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
75
53
76
54
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.
77
55
@@ -86,8 +64,7 @@ cd 1k-validators-be
86
64
### Installing System Dependencies
87
65
88
66
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)
91
68
-[Docker](https://www.docker.com/) (v19 or higher)
92
69
93
70
@@ -121,30 +98,6 @@ Polkadot Current / Monolith Dev:
121
98
yarn docker:polkadot-current-dev:start
122
99
```
123
100
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
-
148
101
### Install Yarn Dependencies
149
102
```bash
150
103
yarn install
@@ -170,50 +123,6 @@ This will create a configuration file for a Kusama instance that mirrors what is
170
123
yarn create-config-polkadot-current
171
124
```
172
125
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
-
217
126
### Viewing Logs
218
127
219
128
To view the aggregated logs of all the containers:
0 commit comments