Skip to content

Commit

Permalink
feat: add all testnet cl under besu
Browse files Browse the repository at this point in the history
  • Loading branch information
eenagy committed Sep 12, 2024
1 parent 7397db7 commit 1940093
Show file tree
Hide file tree
Showing 25 changed files with 1,160 additions and 276 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
matrix:
cl_name:
- lighthouse
# - lodestar
# - nimbus-eth2
# - prysm
- lodestar
- nimbus-eth2
- prysm
- teku
fail-fast: false
steps:
Expand Down
2 changes: 0 additions & 2 deletions network-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ runs:
java --version
which java
sudo dpkg -i $HOME/packages/eth-node-${{ inputs.network }}-config_0.0.1-1_amd64.deb
sudo dpkg -i $HOME/packages/eth-node-config-${{ inputs.network }}-${{ inputs.el_name }}_0.0.1-1_amd64.deb
sudo dpkg -i $HOME/packages/eth-node-config-${{ inputs.network }}-${{ inputs.cl_name }}_0.0.1-1_amd64.deb
# have to install in one go
sudo dpkg -i $HOME/packages/eth-node-${{ inputs.network }}_1.0.0-1_amd64.deb \
$HOME/packages/eth-node-${{ inputs.el_name }}-${{ inputs.network }}_0.0.1-1_all.deb \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,177 @@
name = "eth-node-lodestar-testnet"
bin_package = "eth-node-config-testnet-lodestar"
binary = "/usr/lib/eth-node-config-testnet/bin/run-lodestar.sh"
conf_param = "--conf-file"
user = { group = true, create = { home = false } }
bin_package = "eth-node-lodestar"
binary = "/usr/lib/eth-node-lodestar-testnet/run-lodestar-service.sh"
user = { name = "eth-node-lodestar-testnet", group = true, create = { home = false } }
runtime_dir = { mode = "750" }
# Service Fields
after = "multi-user.target"
service_type = "simple"
extra_service_config = """
# no need to specify, these come from debcrafter
# User=eth-node-lodestar-testnet
# NoNewPrivileges=true
# ProtectHome=true
# PrivateTmp=true
# PrivateDevices=true
# additional flags not specified by debcrafter
CapabilityBoundingSet=
IPAddressDeny=none
LockPersonality=true
PrivateIPC=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ReadWritePaths=/var/lib/eth-node-testnet/lodestar
ReadOnlyPaths=/var/lib/eth-node-testnet
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
# TODO: this specially not working with only lodestar
# SystemCallFilter=@system-service
# does not work with lodestar as well
#SystemCallFilter=~@privileged @resources @obsolete
UMask=0077
WorkingDirectory=/var/lib/eth-node-testnet/lodestar
"""
## hack to actually use system.d but let debcrafter manage the user creation
add_files = ["debian/lib/systemd/system/eth-node-lodestar-testnet.service /lib/systemd/system/"]
add_files = [
"debian/scripts/run-lodestar-service.sh /usr/lib/eth-node-lodestar-testnet/",
"debian/scripts/run-lodestar.sh /usr/lib/eth-node-lodestar-testnet/bin/",
"debian/scripts/postprocess.sh /usr/lib/eth-node-lodestar-testnet",
"debian/tmp/eth-node-lodestar-testnet.service /lib/systemd/system/",
]
provides = ["eth-node-testnet-cl-service"]
conflicts = ["eth-node-testnet-cl-service"]
depends=["eth-node-config-testnet-lodestar", "eth-node-testnet-config", "eth-node-testnet"]
summary = "systemd service files for eth-node-lodestar using eth-node-config-testnet-lodestar and eth-node-testnet-config"

# TODO debcrafter should do this
# [config."vars"]
# format = "plain"

# [config."vars.toml".ivars.base_dir]
# type = "path"
# file_type = "dir"
# create = { mode = 755, owner = "$service", group = "$service" }
# default = "/var/lib/eth-node-testnet/besu"
depends=["eth-node-testnet-config", "eth-node-testnet"]
summary = "service file for eth-node-lodestar for network: testnet"

[config."lodestar-testnet.conf".postprocess]
command = ["bash", "/usr/lib/eth-node-lodestar-testnet/postprocess.sh"]

[config."lodestar-testnet.conf"]
format = "plain"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_DATA_DIR"]
type = "string"
default = "$BASE_CONFIG_DATA_DIR/lodestar"
priority = "low"
summary = "Lodestar root data directory"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_ETH1_DEPOSIT_CONTRACT_DEPLOY_BLOCK"]
type = "string"
default = "0"
priority = "low"
summary = "Eth1 deposit contract deploy block number"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_NETWORK_CONNECT_TO_DISCV5_BOOTNODES"]
type = "string"
default = "false"
priority = "low"
summary = "Whether to connect to discv5 bootnodes"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_DEV_DISCV5"]
type = "string"
default = "true"
priority = "low"
summary = "Enable discv5 discovery"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_ETH1"]
type = "string"
default = "true"
priority = "low"
summary = "Follow the Eth1 chain"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_ETH1_PROVIDER_URLS"]
type = "string"
default = ""
priority = "low"
summary = "URLs to Eth1 node with enabled RPC"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_REST"]
type = "string"
default = "true"
priority = "low"
summary = "Enable HTTP API"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_DEV_REST_PORT"]
type = "string"
default = "9597"
priority = "low"
summary = "Set port for HTTP API"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_DEV_PORT"]
type = "string"
default = "9000"
priority = "low"
summary = "TCP/UDP port for Lodestar"

# [config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_REST_NAMESPACE"]
# type = "string"
# default = "localhost"
# priority = "low"
# summary = "Node working directory"
# summary = "Pick namespaces to expose for HTTP API"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_REST_ADDRESS"]
type = "string"
default = "127.0.0.1"
priority = "low"
summary = "Set host for HTTP API"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_NAT"]
type = "string"
default = "true"
priority = "low"
summary = "Allow non-local addresses configuration"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_SUBSCRIBE_ALL_SUBNETS"]
type = "string"
default = "true"
priority = "low"
summary = "Subscribe to all subnets regardless of validator count"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_JWT_SECRET"]
type = "string"
default = "$BASE_CONFIG_SECRETS_FILE"
priority = "low"
summary = "Path to shared JWT secret for authentication with EL client's RPC server"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_PARAMS_FILE"]
type = "string"
default = "$BASE_CONFIG_CUSTOM_NETWORK_CHAINCONFIG"
priority = "low"
summary = "Network configuration file"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_GENSIS_STATE_FILE"]
type = "string"
default = "$BASE_CONFIG_CUSTOM_NETWORK_GENESIS_STATE"
priority = "low"
summary = "Genesis state file for custom network"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_DEV_BOOTNODES"]
type = "string"
default = ""
priority = "low"
summary = "Bootnodes for discv5 discovery"


[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_REST_NAMESPACE"]
type = "string"
default = "eth"
priority = "low"
summary = "Pick namespaces to expose for HTTP API"

[config."lodestar-testnet.conf".ivars."LODESTAR_CLI_BN_REST_PORT"]
type = "string"
default = "$BASE_CONFIG_CL_RPC_PORT"
priority = "low"
summary = "Set port for HTTP API (custom config)"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package_hash=[
# { hash="9ec55e9c0b1ac0a7ef744e02f2080f361c703c1f", name= "eth-node-lodestar-testnet_0.0.1-1.dsc"},
{ hash="b35f46d5fb424aee57b5d666e61b2eff83543aad", name= "eth-node-lodestar-testnet_0.0.1.orig.tar.gz"},
# { hash="dd7da20cafcbbeaf2a8fcb79aaedcfebc2681842", name= "eth-node-lodestar-testnet_0.0.1-1.debian.tar.xz"},
{ hash="8ded844a7431050dbe67709eb3d6cc6e2f69418b", name= "eth-node-lodestar-testnet_0.0.1-1_all.deb"},
{ hash="f607421efcc07ce39269f9614cc86c6e7fee288e", name= "eth-node-lodestar-testnet_0.0.1-1_all.deb"},

]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ export SOURCE_DATE_EPOCH=1720044000
dh $@

override_dh_dwz:

override_dh_prep:
mkdir debian/tmp
cp debian/eth-node-lodestar-testnet.eth-node-lodestar-testnet.service debian/tmp/eth-node-lodestar-testnet.service
chmod a+x debian/scripts/run-lodestar-service.sh
chmod a+x debian/scripts/run-lodestar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e
set -o pipefail

trap 'echo "Error: Command \"$BASH_COMMAND\" failed with exit code $?"' ERR

echo "Creating user and group eth-node-testnet"
adduser --system --quiet --group eth-node-testnet || true


echo "Creating /var/lib/eth-node-testnet directory"
mkdir -p /var/lib/eth-node-testnet

echo "Setting ownership of /var/lib/eth-node-testnet to eth-node-testnet"
chown eth-node-testnet:eth-node-testnet /var/lib/eth-node-testnet

echo "Creating /var/lib/eth-node-testnet/lodestar directory"
mkdir -p /var/lib/eth-node-testnet/lodestar

echo "Setting ownership of /var/lib/eth-node-testnet/lodestar to eth-node-lodestar-testnet"
chown -R eth-node-lodestar-testnet:eth-node-lodestar-testnet /var/lib/eth-node-testnet/lodestar

echo "Adding eth-node-lodestar-testnet to eth-node-testnet group"
usermod -aG eth-node-testnet eth-node-lodestar-testnet || true

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash


exec /usr/lib/eth-node-lodestar-testnet/bin/run-lodestar.sh \
--conf-file /etc/eth-node-testnet-config/testnet.conf \
--conf-file /etc/eth-node-lodestar-testnet/lodestar-testnet.conf
Loading

0 comments on commit 1940093

Please sign in to comment.