Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ validator_keys/
docker-compose.override.yaml
docker-compose.override.yml
jwttoken
besu-data/
nethermind-data/
17 changes: 17 additions & 0 deletions besu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.0"

services:
besu:
image: hyperledger/besu:${DC_BESU_VERSION}
volumes:
- ./besu-data:/var/lib/besu
- ./jwttoken:/home/besu/jwttoken:ro
- ./config:/home/besu/config:ro
ports:
- 30303:30303/tcp
- 30303:30303/udp
expose:
- 8551
env_file: .env
restart: on-failure
stop_grace_period: 3m
8 changes: 8 additions & 0 deletions config/besu_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
network="mainnet"
sync-mode="X_CHECKPOINT"
data-path="/var/lib/besu"
data-storage-format="BONSAI"
engine-rpc-port=8551
engine-jwt-secret="/home/besu/jwttoken/jwtsecret.hex"
engine-host-allowlist=["*"]
Xplugin-rocksdb-high-spec-enabled=true
29 changes: 29 additions & 0 deletions dc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

# ////////////////////////////////////////////////////////////////
# DC - DOCKER COMPOSE HELPER
# ////////////////////////////////////////////////////////////////
# This script is used as a helper to run docker-compose commands
# directly against one of the preconfigured environments
# For the Lighthouse-Besu environment use: ./dc lb docker_compose_command with args
# For the Lighthouse-Nethermind environment use: ./dc ln docker_compose_command with args
# For the Lighthouse-Geth environment use: ./dc lg docker_compose_command with args
if [ "$1" == "lb" ]; then
shift
exec docker-compose -f lighthouse.yml -f besu.yml "$@"
elif [ "$1" == "lg" ]; then
shift
exec docker-compose -f lighthouse.yml -f geth.yml "$@"
elif [ "$1" == "ln" ]; then
shift
exec docker-compose -f lighthouse.yml -f nethermind.yml "$@"
elif [ "$1" == "--help" ]; then
echo "Usage: This script is used as a helper to run docker-compose commands directly against one of the preconfigured environments (Lighthouse-Geth or Lighthouse-Besu)"
echo "For the Lighthouse-Nethermind environment use: ./dc ln docker_compose_command with args"
echo "For the Lighthouse-Besu environment use: ./dc lb docker_compose_command with args"
echo "For the Lighthouse-Geth environment use: ./dc lg docker_compose_command with args"
else
echo "Unknown command $0"
exit 1
fi

88 changes: 68 additions & 20 deletions default.env
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Docker tags to pull. Can be used to control which Lighthouse and Geth
# versions are deployed.
#
# ////////////////////////////////////////////////////////////////
# LIGHTHOUSE CONFIGURATION
# ////////////////////////////////////////////////////////////////
# Search for a valid Docker tag on https://hub.docker.com/r/sigp/lighthouse/tags
LIGHTHOUSE_VERSION=latest
# Search for a valid Docker tag on https://hub.docker.com/r/ethereum/client-go/tags
GETH_VERSION=stable

# The logging level.
#
Expand All @@ -13,7 +11,7 @@ DEBUG_LEVEL=info

# To specify a specific network (Lighthouse defaults to mainnet) set this value.
# Allowed values are: mainnet and pyrmont (others may work, but are deprecated)
NETWORK=
NETWORK=mainnet

# Add an arbitrary string to the proposing block
GRAFFITI=
Expand Down Expand Up @@ -43,16 +41,6 @@ LAUNCHPAD_KEYSTORE_PASSWD=
# that should be created on first boot.
VALIDATOR_COUNT=1

# Set to anything other than empty to initiate pruning of the Geth state
# NOTE: must be unset after successful prune to return to normal operations
PRUNE_GETH=

# Set to anything other than empty to start a geth instance.
#
# Only required if `VALIDATOR_COUNT` is greater than zero or `VOTING_ETH1_NODE`
# is not set to some external geth node.
START_GETH=

# These are the beacon nodes the validator client will attempt to contact to
# perform duties. To specify fallback nodes add them comma separated.
VOTING_ETH2_NODES=http://beacon_node:5052
Expand Down Expand Up @@ -92,9 +80,69 @@ START_SLASHER=
# this folder only contains old information and does not necessarily have to be on a fast SSD
GETH_ANCIENT_CHAINDATA_DIR=./geth-ancient-data

# This specifies to url to the local Geth node. In the vast majority of cases this
# should not be changed
EXECUTION_ENDPOINT=http://geth:8551

# Set to your ETH address to define a fee recipient
SUGGESTED_FEE_RECIPIENT=


# ////////////////////////////////////////////////////////////////
# EXECUTION ENDPOINT
# ////////////////////////////////////////////////////////////////

# This should specify the excution client that you want to use.
# Uncomment the line for either geth or besu below
# EXECUTION_ENDPOINT=http://geth:8551
# EXECUTION_ENDPOINT=http://besu:8551
# EXECUTION_ENDPOINT=http://nethermind:8551


# ////////////////////////////////////////////////////////////////
# GETH CONFIGURATION
# ////////////////////////////////////////////////////////////////

# Search for a valid Docker tag on https://hub.docker.com/r/ethereum/client-go/tags
GETH_VERSION=stable

# Set to anything other than empty to start a geth instance.
#
# Only required if `VALIDATOR_COUNT` is greater than zero or `VOTING_ETH1_NODE`
# is not set to some external geth node.
START_GETH=

# Set to anything other than empty to initiate pruning of the Geth state
# NOTE: must be unset after successful prune to return to normal operations
PRUNE_GETH=


# ////////////////////////////////////////////////////////////////
# BESU CONFIGURATION
# ////////////////////////////////////////////////////////////////

# Besu version to use https://hub.docker.com/r/hyperledger/besu/tags
DC_BESU_VERSION=latest
# See config/besu_config.toml for Besu related configuration
BESU_CONFIG_FILE=/home/besu/config/besu_config.toml
# Allow Besu to use up to 8GB of memory, lower this you have less than 16GB of RAM
# minimum recommended is 3GB
JAVA_OPTS=-Xmx8g


# ////////////////////////////////////////////////////////////////
# NETHERMIND
# //////////////////////////////////////////////////////////////*/

# Nethermind version to use https://hub.docker.com/r/nethermind/nethermind/tags
DC_NETHERMIND_VERSION=latest
NETHERMIND_PRUNINGCONFIG_MODE=Full
NETHERMIND_PRUNINGCONFIG_FULLPRUNINGTRIGGER=VolumeFreeSpace
NETHERMIND_PRUNINGCONFIG_FULLPRUNINGMINIMUMDELAYHOURS=240
NETHERMIND_PRUNINGCONFIG_FULLPRUNINGMAXDEGREEOFPARALLELISM=0
NETHERMIND_PRUNINGCONFIG_CACHEMB=2048
NETHERMIND_PRUNINGCONFIG_FULLPRUNINGTHRESHOLDMB=100000


# ////////////////////////////////////////////////////////////////
# MEV-BOOST
# ////////////////////////////////////////////////////////////////

# A comma separated list of MEV-Boost compatible relayer urls
MEV_RELAYS=https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net,https://0xad0a8bb54565c2211cee576363f3a347089d2f07cf72679d16911d740262694cadb62d7fd7483f27afd714ca0f1b9118@bloxroute.ethical.blxrbdn.com
20 changes: 20 additions & 0 deletions geth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.0"

services:
geth:
image: ethereum/client-go:${GETH_VERSION}
entrypoint: /bin/sh
volumes:
- ./geth-data:/root/.ethereum
- ${GETH_ANCIENT_CHAINDATA_DIR}:/root/ancient-data
- ./scripts:/root/scripts:ro
- ./jwttoken:/root/jwttoken:ro
ports:
- 30303:30303/tcp
- 30303:30303/udp
expose:
- 8551
env_file: .env
command: /root/scripts/start-geth.sh
restart: on-failure
stop_grace_period: 3m
19 changes: 4 additions & 15 deletions docker-compose.yml → lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,10 @@ services:
command: sh /root/scripts/start-validator-client.sh
restart: on-failure
stop_grace_period: 3m
geth:
image: ethereum/client-go:${GETH_VERSION}
entrypoint: /bin/sh
volumes:
- ./geth-data:/root/.ethereum
- ${GETH_ANCIENT_CHAINDATA_DIR}:/root/ancient-data
- ./scripts:/root/scripts:ro
- ./jwttoken:/root/jwttoken:ro
ports:
- 30303:30303/tcp
- 30303:30303/udp
mev_boost:
image: flashbots/mev-boost:latest
expose:
- 8551
- 18550
command: -addr 0.0.0.0:18550 -mainnet -relay-check -relays ${MEV_RELAYS}
env_file: .env
command: /root/scripts/start-geth.sh
restart: on-failure
stop_grace_period: 3m

24 changes: 24 additions & 0 deletions nethermind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.0"

services:
nethermind:
image: nethermind/nethermind:${DC_NETHERMIND_VERSION}
volumes:
- ./nethermind-data:/nethermind/data
- ./jwttoken:/jwttoken:ro
ports:
- 30303:30303/tcp
- 30303:30303/udp
expose:
- 8551
env_file: .env
restart: on-failure
stop_grace_period: 3m
command: >
--config mainnet
--JsonRpc.Enabled true
--JsonRpc.JwtSecretFile=/jwttoken/jwtsecret.hex
--datadir /nethermind/data
--JsonRpc.EngineHost=0.0.0.0
--JsonRpc.EnginePort=8551
--Sync.SnapSync=true
9 changes: 7 additions & 2 deletions scripts/start-beacon-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ if [ "$SUGGESTED_FEE_RECIPIENT" != "" ]; then
FEE_RECIPIENT="--suggested-fee-recipient $SUGGESTED_FEE_RECIPIENT"
fi

EXECUTION_JWT="/root/jwttoken/jwtsecret.hex"

BUILDER_PARAM="--builder http://mev_boost:18550"

exec lighthouse \
--debug-level $DEBUG_LEVEL \
--network $NETWORK \
beacon_node \
--http \
--http-address 0.0.0.0 \
--execution-endpoint $EXECUTION_ENDPOINT \
--execution-jwt /root/jwttoken/jwtsecret.hex \
--execution-jwt $EXECUTION_JWT \
$METRICS_PARAMS \
$GRAFFITI_PARAM \
$ETH1_FLAG \
Expand All @@ -75,4 +79,5 @@ exec lighthouse \
$ENABLE_FULL_NETWORK_VIEW_PARAMS \
$MONITORING_SERVICE_PARAMS \
$CHECKPOINT_SYNC_URL_PARAM \
$FEE_RECIPIENT
$FEE_RECIPIENT \
$BUILDER_PARAM
5 changes: 4 additions & 1 deletion scripts/start-validator-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ DATADIR=/root/.lighthouse/$NETWORK
WALLET_NAME=validators
WALLET_PASSFILE=$DATADIR/secrets/$WALLET_NAME.pass

BUILDER_PARAM="--builder-proposals"


if [ "$START_VALIDATOR" != "" ]; then
if [ "$IMPORT_LAUNCHPAD_KEYSTORES" != "" ]; then
Expand Down Expand Up @@ -75,5 +77,6 @@ if [ "$START_VALIDATOR" != "" ]; then
$MONITORING_SERVICE_PARAMS \
--beacon-nodes $VOTING_ETH2_NODES \
$DOPPELGANGER_PROTECTION \
$FEE_RECIPIENT
$FEE_RECIPIENT \
$BUILDER_PARAM
fi