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

Commit c5b49ee

Browse files
committed
chore: release 0.2.0
0 parents  commit c5b49ee

File tree

133 files changed

+15102
-0
lines changed

Some content is hidden

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

133 files changed

+15102
-0
lines changed

.dockerignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
5+
# Env
6+
.env
7+
.env.example
8+
.envrc
9+
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
pnpm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
lerna-debug.log*
18+
19+
# OS
20+
.DS_Store
21+
22+
# Tests
23+
/coverage
24+
/.nyc_output
25+
26+
# IDEs and editors
27+
/.idea
28+
.project
29+
.classpath
30+
.c9/
31+
*.launch
32+
.settings/
33+
*.sublime-workspace
34+
35+
# IDE - VSCode
36+
.vscode
37+
38+
# git
39+
.git
40+
**/.github

.env.example

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# App envrionment development|testnet|staging|production
2+
NODE_ENV=development
3+
4+
# Port to expose /metrics endpoint
5+
PORT=8080
6+
7+
# Block to start fetching from for the first run
8+
START_BLOCK=14281006
9+
10+
# Checkpoints' count to compute validators uptime
11+
STATS_CHECKPOINTS_DEPTH=200
12+
13+
# Start the app in dry run mode
14+
DRY_RUN=
15+
16+
# Sentry DSN (optional)
17+
SENTRY_DSN=
18+
19+
# Log level: debug, info, notice, warning or error
20+
LOG_LEVEL=debug
21+
22+
# Log format: simple or json
23+
LOG_FORMAT=simple
24+
25+
# Main worker update cron job interval (optional)
26+
WORKER_UPDATE_CRON="*/12 * * * * *"
27+
28+
# Stake events cron job interval (optional)
29+
STAKE_EVENTS_CRON="*/7 * * * * *"
30+
31+
# Metrics retention cron job interval (optional)
32+
METRICS_RETENTION_CRON="0 */1 * * * *"
33+
34+
# Metrics compute cron job interval (optional)
35+
METRICS_COMPUTE_CRON="*/12 * * * * *"
36+
37+
# Path to JSON file with monikers (optional)
38+
MONIKERS_JSON="./monikers.json"
39+
40+
# Execution layer chain id
41+
CHAIN_ID=1
42+
43+
# Validators ids to track, e.g. 42,16
44+
TRACKED_IDS=
45+
46+
# Execution layer RPC urls, separated by comma
47+
EL_API_URLS=https://infura/key,https://alchemy/key
48+
49+
# Database configs (postgresql is required)
50+
DB_PORT=5432
51+
DB_HOST=postgres
52+
DB_USER=postgres
53+
DB_PASS=postgres
54+
DB_NAME=postgres

.env.test.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Execution layer chain id
2+
CHAIN_ID=1
3+
4+
# Execution layer RPC url
5+
RPC_URL=

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dotenv_if_exists .env
2+
use node

.eslintrc.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
sourceType: 'module',
6+
},
7+
settings: {
8+
'import/resolver': {
9+
typescript: {
10+
project: './tsconfig.json',
11+
},
12+
},
13+
},
14+
plugins: ['@typescript-eslint', 'prettier', 'import'],
15+
extends: [
16+
'eslint:recommended',
17+
'plugin:@typescript-eslint/recommended',
18+
'plugin:prettier/recommended',
19+
'plugin:import/recommended',
20+
'plugin:import/typescript',
21+
],
22+
root: true,
23+
env: {
24+
node: true,
25+
jest: true,
26+
},
27+
ignorePatterns: ['.eslintrc.js'],
28+
rules: {
29+
'@typescript-eslint/interface-name-prefix': 'off',
30+
'@typescript-eslint/explicit-function-return-type': 'off',
31+
'@typescript-eslint/explicit-module-boundary-types': 'off',
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
'@typescript-eslint/no-empty-interface': 'off',
34+
'sort-imports': [
35+
'error',
36+
{
37+
ignoreCase: false,
38+
ignoreDeclarationSort: true, // don't want to sort import lines, use eslint-plugin-import instead
39+
ignoreMemberSort: false,
40+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
41+
allowSeparatedGroups: true,
42+
},
43+
],
44+
'import/no-unresolved': 'error',
45+
'import/order': [
46+
'error',
47+
{
48+
groups: [
49+
'builtin', // Built-in imports (come from NodeJS native) go first
50+
'external', // <- External imports
51+
'internal', // <- Absolute imports
52+
['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
53+
'index', // <- index imports
54+
'unknown', // <- unknown
55+
],
56+
'newlines-between': 'always',
57+
alphabetize: {
58+
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
59+
order: 'asc',
60+
/* ignore case. Options: [true, false] */
61+
caseInsensitive: true,
62+
},
63+
},
64+
],
65+
},
66+
};

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @lidofinance/automation
2+
.github @lidofinance/review-gh-workflows

.github/workflows/ci-dev.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI Dev
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
paths-ignore:
9+
- ".github/**"
10+
11+
permissions: {}
12+
13+
jobs:
14+
# test:
15+
# ...
16+
17+
deploy:
18+
runs-on: ubuntu-latest
19+
# needs: test
20+
name: Build and deploy
21+
steps:
22+
- name: Testnet deploy
23+
uses: lidofinance/dispatch-workflow@v1
24+
env:
25+
APP_ID: ${{ secrets.APP_ID }}
26+
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
27+
TARGET_REPO: "lidofinance/infra-mainnet"
28+
TARGET_WORKFLOW: "deploy_testnet_polygon_validators_monitoring.yaml"
29+
TARGET: "develop"

.github/workflows/ci-prod.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI Build prod image
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tag:
7+
description: "tag to deploy from"
8+
default: ""
9+
required: false
10+
type: string
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
# test:
17+
# ...
18+
19+
deploy:
20+
runs-on: ubuntu-latest
21+
# needs: test
22+
name: Build and deploy
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
with:
27+
persist-credentials: false
28+
29+
- name: Tag name
30+
id: tag_name
31+
run: |
32+
if [ '${{ inputs.tag }}' = '' ]; then
33+
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
34+
else
35+
echo "TAG=$TAG" >> $GITHUB_OUTPUT
36+
fi
37+
env:
38+
TAG: ${{ inputs.tag }}
39+
40+
- name: Build prod image
41+
uses: lidofinance/dispatch-workflow@v1
42+
env:
43+
APP_ID: ${{ secrets.APP_ID }}
44+
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
45+
TARGET_REPO: "lidofinance/infra-mainnet"
46+
TAG: "${{ steps.tag_name.outputs.TAG }}"
47+
TARGET_WORKFLOW: "build_mainnet_polygon_validators_monitoring.yaml"

.github/workflows/ci-staging.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI Staging
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths-ignore:
9+
- ".github/**"
10+
11+
permissions: {}
12+
13+
jobs:
14+
# test:
15+
# ...
16+
17+
deploy:
18+
runs-on: ubuntu-latest
19+
# needs: test
20+
name: Build and deploy
21+
steps:
22+
- name: Staging deploy
23+
uses: lidofinance/dispatch-workflow@v1
24+
env:
25+
APP_ID: ${{ secrets.APP_ID }}
26+
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
27+
TARGET_REPO: "lidofinance/infra-mainnet"
28+
TARGET_WORKFLOW: "deploy_staging_mainnet_polygon_validators_monitoring.yaml"
29+
TARGET: "master"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Create tag and trigger deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
bump:
12+
name: Create tag and release
13+
runs-on: ubuntu-latest
14+
if: "contains(github.event.head_commit.message, 'chore(release)')"
15+
outputs:
16+
tag: ${{ steps.tag.outputs.tag }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
persist-credentials: false
22+
- name: Get tag value
23+
id: tag
24+
run: |
25+
TAG="$(grep -oP '^chore\(release\).*\K(\d+\.\d+\.\d+)' <<< "$MESSAGE")"
26+
echo "$TAG"
27+
echo "tag=$TAG" >> $GITHUB_OUTPUT
28+
env:
29+
MESSAGE: ${{ github.event.head_commit.message }}
30+
- name: Create and push tag
31+
run: |
32+
git tag ${{ steps.tag.outputs.tag }}
33+
git push https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY --tags
34+
- name: Create release
35+
uses: lidofinance/action-gh-release@v1
36+
with:
37+
tag_name: ${{ steps.tag.outputs.tag }}
38+
39+
deploy-trigger:
40+
needs: bump
41+
name: Trigger build and PR creation in the infra-mainnet
42+
if: "contains(github.event.head_commit.message, 'chore(release)')"
43+
uses: ./.github/workflows/ci-prod.yml
44+
secrets: inherit
45+
with:
46+
tag: ${{ needs.bump.outputs.tag }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Fetch monikers.json file
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
fetch_monikers:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
with:
20+
ref: master
21+
22+
- name: Fetch monikers
23+
run: >-
24+
curl -sS https://sentinel.matic.network/api/v2/validators\?limit\=0\&sortBy\=id |
25+
jq '.result | reduce .[] as $item ({}; . + { ($item.id | tostring): ($item.name |
26+
gsub("^\\s+|\\s+$|[^\\x00-\\x7F]+";"")) }) | with_entries(select(.value != ""))'
27+
> monikers.json
28+
29+
- name: Create PR
30+
uses: peter-evans/create-pull-request@v4
31+
with:
32+
author: GitHub <[email protected]>
33+
commit-message: 'ci: update monikers.json'
34+
branch: monikers/patch
35+
title: Update monikers.json
36+
body: New monikers fetched

0 commit comments

Comments
 (0)