Skip to content

Commit dba13db

Browse files
authored
Merge pull request #2 from lukso-network/feat/add-lukso-chains
Add LUKSO chains
2 parents 69f331e + f3972d2 commit dba13db

10 files changed

Lines changed: 151 additions & 8 deletions

.github/workflows/pr_build.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: ci-build
2+
run-name: ${{ github.actor }} is building binaries, building the docker image and drafting a release
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build-binaries:
11+
runs-on: ${{ matrix.os }}
12+
permissions:
13+
id-token: write
14+
contents: read
15+
attestations: write
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-13, macos-latest, windows-latest, windows-11-arm]
20+
python-version: ["3.12"]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: 'pip'
28+
- name: Install rustup (Windows 11 ARM64)
29+
if: matrix.os == 'windows-11-arm'
30+
shell: pwsh
31+
run: |
32+
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe" -OutFile rustup-init.exe
33+
.\rustup-init.exe --default-toolchain none -y
34+
"$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
35+
"CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV
36+
- name: Install Rust (Windows 11 ARM64)
37+
if: matrix.os == 'windows-11-arm'
38+
shell: pwsh
39+
run: |
40+
rustup install stable
41+
rustup target add aarch64-pc-windows-msvc
42+
- name: Set up variables (Linux & macOS)
43+
if: ${{ startsWith(matrix.os, 'ubuntu-') || startsWith(matrix.os, 'macos-') }}
44+
env:
45+
MATRIX_OS: '${{ matrix.os }}'
46+
run: |
47+
echo "PYTHONHASHSEED=42" >> "$GITHUB_ENV"
48+
SHORT_SHA=$(echo ${{ github.sha }} | cut -c -7)
49+
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
50+
if [[ $MATRIX_OS == ubuntu-* ]] ;
51+
then
52+
BUILD_SYSTEM=linux
53+
BUILD_CONFIGS_PATH=./build_configs/linux
54+
fi
55+
if [[ $MATRIX_OS == macos-* ]] ;
56+
then
57+
BUILD_SYSTEM=darwin
58+
BUILD_CONFIGS_PATH=./build_configs/macos
59+
brew install coreutils
60+
fi
61+
BUILD_ARCHITECTURE=amd64
62+
if [[ $MATRIX_OS == *arm* ]] || [[ $MATRIX_OS == macos-latest ]] ;
63+
then
64+
BUILD_ARCHITECTURE=arm64
65+
fi
66+
BUILD_FILE_NAME=ethstaker_deposit-cli-${SHORT_SHA}-${BUILD_SYSTEM}-${BUILD_ARCHITECTURE}
67+
mkdir "${BUILD_FILE_NAME}"
68+
echo "BUILD_FILE_NAME=${BUILD_FILE_NAME}" >> "$GITHUB_ENV"
69+
echo "BUILD_CONFIGS_PATH=${BUILD_CONFIGS_PATH}" >> "$GITHUB_ENV"
70+
- name: Setup variables (Windows)
71+
if: ${{ startsWith(matrix.os, 'windows-') }}
72+
env:
73+
MATRIX_OS: '${{ matrix.os }}'
74+
run: |
75+
echo "PYTHONHASHSEED=42" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
76+
$env:SHORT_SHA = "${{ github.sha }}".Substring(0, 7)
77+
echo ("SHORT_SHA=" + $env:SHORT_SHA) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
78+
if ($env:MATRIX_OS.Contains("arm")) {
79+
$env:BUILD_ARCHITECTURE = "arm64"
80+
}
81+
else {
82+
$env:BUILD_ARCHITECTURE = "amd64"
83+
}
84+
$env:BUILD_FILE_NAME = ("ethstaker_deposit-cli-" + $env:SHORT_SHA + "-windows-" + $env:BUILD_ARCHITECTURE)
85+
echo ("BUILD_FILE_NAME=" + $env:BUILD_FILE_NAME) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
86+
mkdir $env:BUILD_FILE_NAME
87+
$env:BUILD_FILE_NAME_PATH = (".\" + $env:BUILD_FILE_NAME)
88+
echo ("BUILD_FILE_NAME_PATH=" + $env:BUILD_FILE_NAME_PATH) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
89+
- name: Build on Linux & macOS
90+
if: ${{ startsWith(matrix.os, 'ubuntu-') || startsWith(matrix.os, 'macos-') }}
91+
run: |
92+
python -m pip install --upgrade pip
93+
pip install -r "${BUILD_CONFIGS_PATH}"/requirements.txt -r requirements.txt
94+
pyinstaller --distpath ./"${BUILD_FILE_NAME}" "${BUILD_CONFIGS_PATH}"/build.spec
95+
export ARCHIVE_FILE_NAME="${BUILD_FILE_NAME}".tar.gz
96+
echo "ARCHIVE_FILE_NAME=${ARCHIVE_FILE_NAME}" >> "$GITHUB_ENV"
97+
tar -zcvf "${ARCHIVE_FILE_NAME}" ./"${BUILD_FILE_NAME}"
98+
mkdir -p output/artifacts
99+
cp "${ARCHIVE_FILE_NAME}" output/artifacts
100+
sha256sum "${ARCHIVE_FILE_NAME}" | head -c 64 > output/artifacts/"${ARCHIVE_FILE_NAME}".sha256
101+
- name: Build on Windows
102+
if: ${{ startsWith(matrix.os, 'windows-') }}
103+
run: |
104+
python -m pip install --upgrade pip
105+
pip install -r build_configs/windows/requirements.txt -r requirements.txt
106+
pyinstaller --distpath $env:BUILD_FILE_NAME .\build_configs\windows\build.spec
107+
$env:ZIP_FILE_NAME = ($env:BUILD_FILE_NAME + ".zip")
108+
echo ("ZIP_FILE_NAME=" + $env:ZIP_FILE_NAME) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
109+
Compress-Archive -Path $env:BUILD_FILE_NAME_PATH -DestinationPath $env:ZIP_FILE_NAME
110+
mkdir output\artifacts
111+
copy $env:ZIP_FILE_NAME output\artifacts
112+
$env:CHECKSUM_FILE_NAME_PATH = ("output\artifacts\" + $env:ZIP_FILE_NAME + ".sha256")
113+
certUtil -hashfile $env:ZIP_FILE_NAME SHA256 | findstr /i /v "SHA256" | findstr /i /v "CertUtil" > $env:CHECKSUM_FILE_NAME_PATH
114+
- name: Generate artifacts attestation
115+
uses: actions/attest-build-provenance@v2
116+
with:
117+
subject-path: output/artifacts/*
118+
- name: Archive production artifacts
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: binary-${{ matrix.os }}-${{ github.sha }}-${{ github.run_id }}
122+
path: output/artifacts
123+

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ethstaker-deposit-cli docs
1+
# LUKSO key-gen-cli-v2
22

33
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
44
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -10,6 +10,8 @@
1010

1111
## Introduction
1212

13+
This is a forked version of `ethstaker-deposit-cli` tool for the LUKSO Mainnet and Testnet networks.
14+
1315
`ethstaker-deposit-cli` is a tool for creating [EIP-2335 format](https://eips.ethereum.org/EIPS/eip-2335) BLS12-381 keystores and a corresponding `deposit_data*.json` file for [Ethereum Staking Launchpad](https://github.com/ethereum/staking-launchpad) or the [Gnosis Beacon Chain deposit UI](https://github.com/gnosischain/gbc-deposit-ui/). One can also provide a keystore file to generate a `signed_exit_transaction*.json` file to be broadcast at a later date to exit a validator.
1416

1517
- **Warning: Please generate your keystores on your own safe, completely offline device.**

docs/src/existing_mnemonic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Uses an existing BIP-39 mnemonic phrase for key generation.
77

88
## Optional Arguments
99

10-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
10+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1111

1212
- **`--mnemonic`**: The mnemonic you used to create withdrawal credentials. <span class="warning"></span>
1313

docs/src/exit_transaction_keystore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Creates an exit transaction using a keystore file.
77

88
## Optional Arguments
99

10-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
10+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1111

1212
- **`--keystore`**: The keystore file associating with the validator you wish to exit.
1313

docs/src/exit_transaction_mnemonic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Creates an exit transaction using a mnemonic phrase.
77

88
## Optional Arguments
99

10-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
10+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1111

1212
- **`--mnemonic`**: The mnemonic you used during key generation. <span class="warning"></span>
1313

docs/src/generate_bls_to_execution_change.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Generates a BLS to execution address change message. This is used to add a withd
99

1010
- **`--bls_to_execution_changes_folder`**: The path to store the change JSON file.
1111

12-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
12+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1313

1414
- **`--mnemonic`**: The mnemonic you used to create withdrawal credentials. <span class="warning"></span>
1515

docs/src/generate_bls_to_execution_change_keystore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Signs a withdrawal credential update message using the provided keystore. This s
1111

1212
## Optional Arguments
1313

14-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
14+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1515

1616
- **`--keystore`**: The keystore file associating with the validator you wish to sign with. This keystore file should match the provided validator index.
1717

docs/src/new_mnemonic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Generates a new BIP-39 mnemonic along with validator keystore and deposit files
99

1010
- **`--mnemonic_language`**: The language of the BIP-39 mnemonic. Options are: 'chinese_simplified', 'chinese_traditional', 'czech', 'english', 'french', 'italian', 'japanese', 'korean', 'portuguese', 'spanish'.
1111

12-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
12+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1313

1414
- **`--num_validators`**: Number of validators to create.
1515

docs/src/partial_deposit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you wish to create a validator with 0x00 credentials, you must use the **[new
88

99
## Optional Arguments
1010

11-
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', or 'chiado'.
11+
- **`--chain`**: The chain to use for generating the deposit data. Options are: 'mainnet', 'sepolia', 'holesky', 'hoodi', 'ephemery', 'gnosis', 'chiado', 'lukso' or 'lukso-testnet'.
1212

1313
- **`--keystore`**: The keystore file associating with the validator you wish to deposit to.
1414

ethstaker_deposit/settings.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ def __str__(self) -> str:
3333
EPHEMERY = 'ephemery'
3434
GNOSIS = 'gnosis'
3535
CHIADO = 'chiado'
36+
LUKSO = 'lukso'
37+
LUKSO_MAINNET = 'lukso-mainnet'
38+
LUKSO_TESTNET = 'lukso-testnet'
3639

3740
# Mainnet setting
3841
MainnetSetting = BaseChainSetting(
@@ -86,6 +89,18 @@ def __str__(self) -> str:
8689
MULTIPLIER=32,
8790
MIN_ACTIVATION_AMOUNT=1,
8891
MIN_DEPOSIT_AMOUNT=0.03125)
92+
# LUKSO Mainnet setting
93+
LuksoMainnetSetting = BaseChainSetting(
94+
NETWORK_NAME=LUKSO,
95+
GENESIS_FORK_VERSION=bytes.fromhex('42000001'),
96+
EXIT_FORK_VERSION=bytes.fromhex('42000004'),
97+
GENESIS_VALIDATORS_ROOT=bytes.fromhex('a27edd68cde5c396f499157945d062a010308ce5ed5719a6b1e12ad2a51b97e6'))
98+
# LUKSO Testnet setting
99+
LuksoTestnetSetting = BaseChainSetting(
100+
NETWORK_NAME=LUKSO_TESTNET,
101+
GENESIS_FORK_VERSION=bytes.fromhex('42010001'),
102+
EXIT_FORK_VERSION=bytes.fromhex('42010004'),
103+
GENESIS_VALIDATORS_ROOT=bytes.fromhex('341d6608917174b97bac3e45d080e8115cccb39b9d5a2ee18136600ab7336442'))
89104

90105

91106
ALL_CHAINS: Dict[str, BaseChainSetting] = {
@@ -96,6 +111,9 @@ def __str__(self) -> str:
96111
EPHEMERY: EphemerySetting,
97112
GNOSIS: GnosisSetting,
98113
CHIADO: ChiadoSetting,
114+
LUKSO: LuksoMainnetSetting,
115+
LUKSO_MAINNET: LuksoMainnetSetting,
116+
LUKSO_TESTNET: LuksoTestnetSetting,
99117
}
100118

101119
ALL_CHAIN_KEYS: tuple[str, ...] = tuple(ALL_CHAINS.keys())

0 commit comments

Comments
 (0)