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

Commit 83e61ad

Browse files
authored
Merge branch 'staging' into chart-resources
2 parents b4d3816 + db066cf commit 83e61ad

File tree

83 files changed

+847
-1145
lines changed

Some content is hidden

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

83 files changed

+847
-1145
lines changed

.circleci/config.yml

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -171,44 +171,12 @@ jobs:
171171
resource_class: xlarge
172172
steps:
173173
- checkout
174-
- setup_remote_docker
174+
- setup_remote_docker:
175+
docker_layer_caching: true
175176
- run:
176177
command: |
177178
/scripts/build-image.sh web3f/otv-backend . --build-arg PACKAGE=core
178179
179-
buildGatewayImage:
180-
docker:
181-
- image: web3f/ci-commons:v3.2.3
182-
resource_class: xlarge
183-
steps:
184-
- checkout
185-
- setup_remote_docker
186-
- run:
187-
command: |
188-
/scripts/build-image.sh web3f/otv-gateway . --build-arg PACKAGE=gateway
189-
190-
buildTelemetryImage:
191-
docker:
192-
- image: web3f/ci-commons:v3.2.3
193-
resource_class: xlarge
194-
steps:
195-
- checkout
196-
- setup_remote_docker
197-
- run:
198-
command: |
199-
/scripts/build-image.sh web3f/otv-telemetry . --build-arg PACKAGE=telemetry
200-
201-
buildWorkerImage:
202-
docker:
203-
- image: web3f/ci-commons:v3.2.3
204-
resource_class: xlarge
205-
steps:
206-
- checkout
207-
- setup_remote_docker
208-
- run:
209-
command: |
210-
/scripts/build-image.sh web3f/otv-worker . --build-arg PACKAGE=worker
211-
212180
integrationTests:
213181
docker:
214182
- image: web3f/ci-commons:v3.2.3
@@ -344,21 +312,6 @@ workflows:
344312
filters:
345313
tags:
346314
only: /.*/
347-
- buildGatewayImage:
348-
context: dockerhub-bot
349-
filters:
350-
tags:
351-
only: /.*/
352-
- buildTelemetryImage:
353-
context: dockerhub-bot
354-
filters:
355-
tags:
356-
only: /.*/
357-
- buildWorkerImage:
358-
context: dockerhub-bot
359-
filters:
360-
tags:
361-
only: /.*/
362315
- integrationTests:
363316
filters:
364317
tags:

.dockerignore

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
alice
2-
bob
3-
.dockerignore
4-
node_modules
5-
scripts
6-
test
7-
zero
8-
*.db
9-
charts
10-
helmfile.d
11-
build
12-
.circleci
13-
.editorconfig
14-
.git
15-
.github
16-
.gitignore
17-
.idea
18-
combined.log
19-
docker-compose.yml
20-
node_modules/
21-
22-
*/**/node_modules/
1+
*
2+
!docs
3+
!packages
4+
!package.json
5+
!tsconfig.json
6+
!turbo.json
7+
!.yarnrc.yml
8+
!yarn.lock
9+
!.yarn/patches
10+
!.yarn/releases
11+
!.yarn/plugins
12+
!.yarn/sdks
13+
!.yarn/versions

Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ ARG MATRIX_TOKEN
33
ARG PACKAGE
44
ENV PACKAGE ${PACKAGE}
55
WORKDIR /code
6+
7+
COPY docs docs
8+
RUN cd docs && npm install && npm run build
9+
610
COPY . .
7-
RUN echo "building ${PACKAGE}... "; \
8-
yarn install; \
9-
echo "yarn install done. Building...." ; \
10-
yarn build; \
11-
echo "building ${PACKAGE} done."; \
12-
apt-get update && \
13-
apt-get clean
14-
CMD yarn run start:js:${PACKAGE}
11+
12+
RUN --mount=type=cache,target=/code/.yarn/cache \
13+
--mount=type=cache,target=/turbo_cache \
14+
yarn install --immutable && \
15+
yarn turbo --cache-dir /turbo_cache
16+
17+
CMD yarn run start:js:${PACKAGE}

Dockerfile-dev

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ ARG PACKAGE
55
ENV PACKAGE ${PACKAGE}
66
COPY . /code
77
WORKDIR /code
8-
RUN echo "building ${PACKAGE}... "; \
9-
yarn install; \
10-
echo "yarn install done. Building...." ; \
11-
yarn build; \
12-
echo "building ${PACKAGE} done."; \
8+
RUN echo "building ${PACKAGE}... " && \
9+
yarn install && \
10+
echo "yarn install done. Building...." && \
11+
yarn build && \
12+
echo "building ${PACKAGE} done." && \
1313
apt-get update && \
1414
apt-get install -y libssl-dev && \
1515
apt-get clean
16-
CMD yarn run start:dev:${PACKAGE}
16+
CMD yarn run start:dev:${PACKAGE}

apps/1kv-backend-staging/templates/kusama-otv-backend.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,24 @@ spec:
5151
"wss://rpc.dotters.network/kusama",
5252
"wss://ksm-rpc.stakeworld.io"
5353
],
54+
"apiPeopleEndpoints": ["wss://kusama-people-rpc.polkadot.io"],
5455
"candidatesUrl": "https://raw.githubusercontent.com/w3f/1k-validators-be/master/candidates/kusama.json"
5556
},
5657
"constraints": {
5758
"skipConnectionTime": true,
58-
"skipIdentity": true,
59-
"skipClientUpgrade": false,
59+
"skipIdentity": false,
6060
"skipUnclaimed": true,
61+
"clientUpgrade": {
62+
"skip": false
63+
},
6164
"minSelfStake": 10000000000000,
6265
"commission": 150000000,
6366
"unclaimedEraThreshold": 4,
6467
"sanctionedGeoArea": {
6568
"skip": false,
6669
"sanctionedCountries": ["RU", "IR", "CU", "KP", "SY"],
6770
"sanctionedRegions": ["Crimea", "Autonomous Republic of Crimea", "Republic of Crimea", "Luhansk", "Luhanska Oblast", "Luhanska", "Luganskaya Oblast’", "Luganskaya", "Donetsk", "Donetska Oblast", "Donetskaya Oblast’", "Donetska", "Donetskaya", "Sevastopol City", "Sevastopol", "Gorod Sevastopol"]
68-
},
69-
"forceClientVersion": "v1.10.0"
71+
}
7072
},
7173
"cron": {
7274
"monitor": "0 */15 * * * *",

apps/1kv-backend-staging/templates/polkadot-otv-backend.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,18 @@ spec:
5555
"constraints": {
5656
"skipConnectionTime": false,
5757
"skipIdentity": false,
58-
"skipClientUpgrade": false,
5958
"skipUnclaimed": true,
59+
"clientUpgrade": {
60+
"skip": false
61+
},
6062
"minSelfStake": 50000000000000,
6163
"commission": 50000000,
6264
"unclaimedEraThreshold": 1,
6365
"sanctionedGeoArea": {
6466
"skip": false,
6567
"sanctionedCountries": ["RU", "IR", "CU", "KP", "SY"],
6668
"sanctionedRegions": ["Crimea", "Autonomous Republic of Crimea", "Republic of Crimea", "Luhansk", "Luhanska Oblast", "Luhanska", "Luganskaya Oblast’", "Luganskaya", "Donetsk", "Donetska Oblast", "Donetskaya Oblast’", "Donetska", "Donetskaya", "Sevastopol City", "Sevastopol", "Gorod Sevastopol"]
67-
},
68-
"forceClientVersion": "v1.10.0"
69+
}
6970
},
7071
"cron": {
7172
"monitor": "0 */15 * * * *",

apps/1kv-backend/templates/kusama-otv-backend.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
source:
1818
repoURL: https://w3f.github.io/helm-charts/
1919
chart: otv-backend
20-
targetRevision: v3.2.2
20+
targetRevision: v3.3.0
2121
plugin:
2222
env:
2323
- name: HELM_VALUES
@@ -48,23 +48,25 @@ spec:
4848
"wss://rpc.dotters.network/kusama",
4949
"wss://ksm-rpc.stakeworld.io"
5050
],
51+
"apiPeopleEndpoints": ["wss://kusama-people-rpc.polkadot.io"],
5152
"candidatesUrl": "https://raw.githubusercontent.com/w3f/1k-validators-be/master/candidates/kusama.json"
5253
},
5354
"constraints": {
5455
"skipConnectionTime": false,
55-
"skipIdentity": true,
56+
"skipIdentity": false,
5657
"skipStakedDestination": true,
57-
"skipClientUpgrade": false,
5858
"skipUnclaimed": true,
59+
"clientUpgrade": {
60+
"skip": false
61+
},
5962
"minSelfStake": 10000000000000,
6063
"commission": 150000000,
6164
"unclaimedEraThreshold": 4,
6265
"sanctionedGeoArea": {
6366
"skip": false,
6467
"sanctionedCountries": ["RU", "IR", "CU", "KP", "SY"],
6568
"sanctionedRegions": ["Crimea", "Autonomous Republic of Crimea", "Republic of Crimea", "Luhansk", "Luhanska Oblast", "Luhanska", "Luganskaya Oblast’", "Luganskaya", "Donetsk", "Donetska Oblast", "Donetskaya Oblast’", "Donetska", "Donetskaya", "Sevastopol City", "Sevastopol", "Gorod Sevastopol"]
66-
},
67-
"forceClientVersion": "v1.10.0"
69+
}
6870
},
6971
"cron": {
7072
"monitor": "0 */15 * * * *",

apps/1kv-backend/templates/polkadot-otv-backend.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
source:
1818
repoURL: https://w3f.github.io/helm-charts/
1919
chart: otv-backend
20-
targetRevision: v3.2.2
20+
targetRevision: v3.3.0
2121
plugin:
2222
env:
2323
- name: HELM_VALUES
@@ -53,17 +53,18 @@ spec:
5353
"skipConnectionTime": false,
5454
"skipIdentity": false,
5555
"skipStakedDestination": true,
56-
"skipClientUpgrade": false,
5756
"skipUnclaimed": true,
57+
"clientUpgrade": {
58+
"skip": false
59+
},
5860
"minSelfStake": 50000000000000,
5961
"commission": 50000000,
6062
"unclaimedEraThreshold": 1,
6163
"sanctionedGeoArea": {
6264
"skip": false,
6365
"sanctionedCountries": ["RU", "IR", "CU", "KP", "SY"],
6466
"sanctionedRegions": ["Crimea", "Autonomous Republic of Crimea", "Republic of Crimea", "Luhansk", "Luhanska Oblast", "Luhanska", "Luganskaya Oblast’", "Luganskaya", "Donetsk", "Donetska Oblast", "Donetskaya Oblast’", "Donetska", "Donetskaya", "Sevastopol City", "Sevastopol", "Gorod Sevastopol"]
65-
},
66-
"forceClientVersion": "v1.10.0"
67+
}
6768
},
6869
"cron": {
6970
"monitor": "0 */15 * * * *",

charts/otv-backend/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
description: 1K Validators Backend
22
name: otv-backend
3-
version: v3.2.3
4-
appVersion: v3.2.2
3+
version: v3.3.0
4+
appVersion: v3.3.0
55
apiVersion: v2

docs/docs/backend/config.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ An example config may look something like:
4242

4343
- `dryRun`: Boolean (true/false). If set to true, the Nominator accounts that are added will calculate what a nomination would look like (how many and which validators), but not craft or submit any transactions. No nominations will be done when this flag is set. In the `nominate` function of the `Nominator` class, the `dryRun` flag is checked, and if it is set to true, the function will return after logging the validators it would nominate without doing anything. This flag is optional and set to `false` by default.
4444
- `networkPrefix`: Integer. Defines the network prefix. For Kusama, this is `2`, and for Polkadot, this is `0`. It can be set to `3` for running a local test network, although this isn't used much anymore. **This flag is required for `core` and `worker` services.**
45-
- `apiEndpoints`: Array of strings. Lists the RPC endpoints for the chain. When given a list of multiple, it will pick one at random to create a websocket connection to - this single connection is used throughout the entire service for any queries or submitting transactions. **This is required for `core` and `worker` services.
45+
- `apiEndpoints`: Array of strings. Lists the RPC endpoints for the chain. When given a list of multiple, it will pick one at random to create a websocket connection to - this single connection is used throughout the entire service for any queries or submitting transactions. **This is required for `core` and `worker` services.**
46+
- `apiPeopleEndpoints`: Optional array of strings. Lists the RPC endpoints for People parachain, if it's enabled on the network.
4647
- `bootstrap`: Boolean. An **optional** flag that can be set to `true` to enable the bootstrap process. This can be used when running a instance of the backend and would query the main Kusama or Polkadot instances at the api endpoints specified below to populate the db with non-deterministic values like `rank` or `discoveredAt`. _This isn't currently used anywhere yet_
4748
- `kusamaBootstrapEndpoint`: String. URL for the Kusama bootstrap endpoint. **optional**. _This isn't currently used anywhere yet_.
4849
- `polkadotBootstrapEndpoint`: String. URL for the Polkadot bootstrap endpoint. **optional**. _This isn't currently used anywhere yet_.
@@ -56,9 +57,10 @@ An example config may look something like:
5657
"constraints": {
5758
"skipConnectionTime": true,
5859
"skipIdentity": false,
59-
"skipClientUpgrade": false,
6060
"skipUnclaimed": false,
61-
"forceClientVersion": "v0.9.30",
61+
"clientUpgrade": {
62+
"skip": false
63+
},
6264
"minSelfStake": 10000000000000,
6365
"commission": 150000000,
6466
"unclaimedEraThreshold": 4
@@ -69,9 +71,9 @@ The `constraints` section defines validity constraint parameters for validators,
6971

7072
- `skipConnectionTime`: Boolean. Skips checking the 7 day required connection time if set to true. __optional__, defaults to `false`.
7173
- `skipIdentity`: Boolean. Skips the check for a verified identity. __optional__, defaults to `false`.
72-
- `skipClientUpgrade`: Boolean. Skips client version upgrade check. __optional__, defaults to `false`.
7374
- `skipUnclaimed`: Boolean. Skips the check for unclaimed rewards. __optional__, defaults to `false`.
74-
- `forceClientVersion`: String. Specific client version to be enforced. __optional__, if this is set, it will allow versions higher than what is specified.
75+
- `clientUpgrade.skip`: Boolean. Skips client version upgrade check. __optional__, defaults to `false`.
76+
- `clientUpgrade.forceVersion`: String. Specific client version to be enforced. __optional__, if this is set, it will allow versions >= than what is specified.
7577
- `minSelfStake`: Integer. Minimum self-stake required. **required**. This number needs to be specified in `Plancks` (1 DOT = 10^10 Plancks, 1 KSM = 10^12 Plancks).
7678
- `commission`: Integer. Max commission rate. **required**. This number needs to be specified in chain units that have 6 decimal places - for example `150000000` corresponds to 15% commission.
7779
- `unclaimedEraThreshold`: Integer. Threshold for unclaimed eras. **required**. A validator having pending rewards for past eras longer than this threshold will be deemed invalid. This gets skipped if `skipUnclaimed` is set to `true`. This number is speciefied as number of eras, so `4` for example means validators are invalid if they have pending rewards older than 4 eras ago.
@@ -459,9 +461,10 @@ An example `core` config run as microservices may look something like:
459461
"constraints": {
460462
"skipConnectionTime": true,
461463
"skipIdentity": false,
462-
"skipClientUpgrade": false,
463464
"skipUnclaimed": false,
464-
"forceClientVersion": "v0.9.30",
465+
"clientUpgrade": {
466+
"skip": false
467+
},
465468
"minSelfStake": 10000000000000,
466469
"commission": 150000000,
467470
"unclaimedEraThreshold": 4
@@ -645,4 +648,4 @@ An example Worker config run as microservices may look something like:
645648
}
646649
}
647650

648-
```
651+
```

0 commit comments

Comments
 (0)