Skip to content

Commit f56146b

Browse files
authored
Merge pull request #442 from dappnode/feat/gloas-builder-config-reviewed
Add Gloas builder configuration management
2 parents 4b73069 + 839617e commit f56146b

142 files changed

Lines changed: 8858 additions & 10522 deletions

File tree

Some content is hidden

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

‎.github/workflows/main.yml‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v7
1717
# Set up Docker Buildx for multi-arch support
1818
- name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v3
20-
# Build multi-arch image
19+
uses: docker/setup-buildx-action@v4
20+
# Build multi-arch image
2121
- name: Build Docker image (multi-arch)
2222
run: |
23-
docker buildx create --use
2423
docker buildx build --platform linux/amd64,linux/arm64 .
2524
# Docker development
2625
- name: Docker development
@@ -29,25 +28,25 @@ jobs:
2928
runs-on: ubuntu-latest
3029
steps:
3130
- name: Checkout
32-
uses: actions/checkout@v4
33-
34-
- name: Enable Corepack
35-
run: corepack enable
31+
uses: actions/checkout@v7
3632

3733
- name: Setup Node.js
38-
uses: actions/setup-node@v4
34+
uses: actions/setup-node@v7
3935
with:
40-
node-version: 20
36+
node-version: 24
37+
38+
- name: Enable Corepack
39+
run: corepack enable
4140

4241
- name: Install dependencies
43-
run: yarn install
42+
run: yarn install --immutable
4443

4544
# Lint and format and prettier
4645
- name: Lint
4746
run: yarn lint
4847

4948
- name: Prettier
50-
run: yarn format
49+
run: yarn format:check
5150

5251
# Build
5352
- name: Build

‎.github/workflows/release.yml‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,27 @@ on:
1010
jobs:
1111
push-to-ghcr:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
1316
steps:
1417
- name: Checkout
15-
uses: actions/checkout@v4
18+
uses: actions/checkout@v7
1619

1720
- name: Login to GHCR
18-
uses: docker/login-action@v3
21+
uses: docker/login-action@v4
1922
with:
2023
registry: ghcr.io
2124
username: ${{ github.repository_owner }}
2225
password: ${{ secrets.GITHUB_TOKEN }}
2326

2427
# Set up Docker Buildx for multi-arch support
2528
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v3
29+
uses: docker/setup-buildx-action@v4
2730

2831
# Build and push multi-arch Docker image
2932
- name: Build and push Staking brain docker monorepo
30-
uses: docker/build-push-action@v3
33+
uses: docker/build-push-action@v7
3134
with:
3235
file: Dockerfile
3336
push: true
@@ -37,17 +40,14 @@ jobs:
3740
gh-release:
3841
runs-on: ubuntu-latest
3942
needs: push-to-ghcr
43+
permissions:
44+
contents: write
4045
steps:
4146
- name: Checkout
42-
uses: actions/checkout@v3
47+
uses: actions/checkout@v7
4348

4449
- name: Create Release
45-
id: create_release
46-
uses: actions/create-release@v1
4750
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
with:
50-
tag_name: ${{ github.event.inputs.tag }}
51-
release_name: Release v${{ github.event.inputs.tag }}
52-
draft: false
53-
prerelease: true
51+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
RELEASE_TAG: ${{ inputs.tag }}
53+
run: gh release create "$RELEASE_TAG" --title "Release v$RELEASE_TAG" --prerelease --generate-notes

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ packages/brain/uiBuild
99

1010
# Brain db
1111
packages/brain/brain-db.json
12+
packages/brain/builder-config-imported
1213

1314
# Keystores
1415
packages/brain/keystores

‎.prettierrc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"jsxSingleQuote": false,
99
"trailingComma": "none",
1010
"bracketSpacing": true,
11-
"jsxBracketSameLine": false,
11+
"bracketSameLine": false,
1212
"arrowParens": "always",
1313
"endOfLine": "auto"
1414
}

‎Dockerfile‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
ARG DOCKER_IMAGE=node:20.17.0-alpine3.20
1+
ARG DOCKER_IMAGE=node:24.21.0-alpine
22

33
# Build
4-
FROM --platform=$TARGETPLATFORM ${DOCKER_IMAGE} AS build-stage
4+
FROM ${DOCKER_IMAGE} AS build-stage
55

66
WORKDIR /app
77
COPY package.json yarn.lock tsconfig.json .yarnrc.yml ./
88
COPY packages packages
99

10-
# Required to build with vite
11-
RUN apk update && apk add --no-cache python3 py3-pip build-base
1210
# Enable corepack to use modern package manager
1311
RUN corepack enable
1412

1513
# Build but keep only production dependencies
1614
RUN yarn install --immutable && \
1715
yarn build && \
1816
yarn clean:libraries && \
19-
yarn workspaces focus --all --production
17+
yarn workspaces focus @stakingbrain/brain --production
2018

2119
# Production
22-
FROM --platform=$TARGETPLATFORM ${DOCKER_IMAGE}
20+
FROM ${DOCKER_IMAGE}
2321
ENV NODE_ENV=production
2422
WORKDIR /app
2523
COPY ./packages/brain/tls ./tls
@@ -36,4 +34,4 @@ COPY --from=build-stage /app/packages/ui/build ./uiBuild
3634
COPY --from=build-stage /app/packages/brain/dist /app/packages/brain/dist
3735
COPY --from=build-stage /app/packages/brain/package.json /app/packages/brain/package.json
3836

39-
CMD [ "node", "packages/brain/dist/index" ]
37+
CMD [ "node", "packages/brain/dist/index.js" ]

‎Dockerfile.brain.dev‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG DOCKER_IMAGE=node:20.17.0-alpine3.20
2-
FROM --platform=$TARGETPLATFORM ${DOCKER_IMAGE} as build-stage
1+
ARG DOCKER_IMAGE=node:24.21.0-alpine
2+
FROM ${DOCKER_IMAGE} AS build-stage
33

44
ENV NODE_ENV=development
55
WORKDIR /app
@@ -13,6 +13,6 @@ RUN apk add --no-cache --virtual .build-deps \
1313
curl \
1414
&& rm -rf /var/cache/apk/*
1515

16-
RUN corepack enable && yarn set version berry
16+
RUN corepack enable
1717

18-
ENTRYPOINT ["/bin/bash", "-c", "yarn && yarn build && yarn run dev"]
18+
ENTRYPOINT ["/bin/bash", "-c", "yarn && yarn build && yarn run dev"]

‎README.md‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
Staking Brain is a critical logical component for Staking in DAppNode. It provides a user interface and a Launchpad API that allow manual and automatic keystore management. Designed to support not only solo stakers, but also DVT/LSD technologies, Staking Brain streamlines the staking process for all users.
44

5-
Within the Dappnode environment, Staking Brain is incorporated into the Web3Signer packages (gnosis, mainnet, prater, lukso, holesky, hoodi). It ensures that user configurations for validators are reliably maintained. Please note that Staking Brain does not store keystores itself, but ensures their storage in the web3signer. It also maintains consistency between the validator service and web3signer service, as the validator must recognize all the pubkeys of validators whose keystores have been imported into the signer.
5+
Within the Dappnode environment, Staking Brain is incorporated into the Web3Signer packages (gnosis, mainnet, lukso, hoodi). It ensures that user configurations for validators are reliably maintained. Please note that Staking Brain does not store keystores itself, but ensures their storage in the web3signer. It also maintains consistency between the validator service and web3signer service, as the validator must recognize all the pubkeys of validators whose keystores have been imported into the signer.
6+
7+
Supported `NETWORK` values are `mainnet`, `gnosis`, `lukso`, and `hoodi`. Retired testnets are rejected at startup. Update the network and corresponding client environment variables when moving an older deployment to a supported network; network names are not automatically remapped.
68

79
Each Web3Signer package includes four services:
810

@@ -26,7 +28,9 @@ The new functionalities that the StakingBrain brings are:
2628

2729
Follow these steps to develop with Staking Brain:
2830

29-
1. Connect to your DAppNode (which should be running an instance of web3signer and validator in a network, e.g., Prater).
31+
Use Node.js 24 LTS (at least 24.11) and Yarn 4.18.1, pinned in `package.json`. Enable Corepack with `corepack enable`.
32+
33+
1. Connect to your DAppNode (which should be running an instance of web3signer and validator in a network, e.g., Hoodi).
3034

3135
2. Clone the repository:
3236

@@ -37,9 +41,9 @@ git clone https://github.com/dappnode/StakingBrain
3741
3. Set your current DAppNode staker config in `packages/brain/.env` :
3842

3943
```
40-
NETWORK="prater"
41-
_DAPPNODE_GLOBAL_EXECUTION_CLIENT_PRATER="goerli-erigon.dnp.dappnode.eth"
42-
_DAPPNODE_GLOBAL_CONSENSUS_CLIENT_PRATER="prysm-prater.dnp.dappnode.eth"
44+
NETWORK="hoodi"
45+
_DAPPNODE_GLOBAL_EXECUTION_CLIENT_HOODI="hoodi-geth.dnp.dappnode.eth"
46+
_DAPPNODE_GLOBAL_CONSENSUS_CLIENT_HOODI="lighthouse-hoodi.dnp.dappnode.eth"
4347
```
4448

4549
### A) Local development
@@ -52,10 +56,10 @@ yarn build
5256
yarn dev
5357
```
5458

55-
5.Access the KeyManager UI (e.g. Prater)
59+
5.Access the KeyManager UI (e.g. Hoodi)
5660

5761
```
58-
http://localhost/?network=prater&signerUrl=http://web3signer.web3signer-prater.dappnode:9000/
62+
http://localhost:3000/
5963
```
6064

6165
### B) Docker development
@@ -76,15 +80,15 @@ docker logs -f brain (To watch status)
7680
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' brain
7781
```
7882

79-
6. Access the KeyManager UI (e.g. Prater)
83+
6. Access the KeyManager UI (e.g. Hoodi)
8084

8185
```
8286
http://<obtainedIP>
8387
```
8488

8589
### Development Recommendations
8690

87-
1. Connect to your DAppNode using SSH and stop the brain container of your Prater web3signer:
91+
1. Connect to your DAppNode using SSH and stop the brain container of your Hoodi web3signer:
8892

8993
```
9094
docker ps | grep brain

‎docker-compose-dev.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.9"
21
services:
32
brain:
43
build:

0 commit comments

Comments
 (0)