-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
geth-data/ | ||
reth-data/ | ||
nethermind-data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.idea/ | ||
/geth-data/ | ||
/reth-data/ | ||
/nethermind-data/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM golang:1.21 AS op | ||
|
||
WORKDIR /app | ||
|
||
ENV REPO=https://github.com/ethereum-optimism/optimism.git | ||
ENV VERSION=v1.9.1 | ||
ENV COMMIT=4797ddb70e05d4952685bad53e608cb5606284e6 | ||
RUN git clone $REPO --branch op-node/$VERSION --single-branch . && \ | ||
git switch -c branch-$VERSION && \ | ||
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]' | ||
|
||
RUN cd op-node && \ | ||
make VERSION=$VERSION op-node | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build | ||
|
||
ARG BUILD_CONFIG=release | ||
ARG TARGETARCH | ||
|
||
WORKDIR /app | ||
|
||
ENV REPO=https://github.com/nethermindeth/nethermind | ||
ENV VERSION=1.28.0 | ||
RUN git clone $REPO . && git checkout $VERSION | ||
|
||
RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \ | ||
dotnet publish src/Nethermind/Nethermind.Runner -c $BUILD_CONFIG -a $arch -o /publish --sc false | ||
|
||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y jq curl supervisor && \ | ||
rm -rf /var/lib/apt/lists | ||
|
||
RUN mkdir -p /var/log/supervisor | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build /publish ./ | ||
COPY --from=op /app/op-node/bin/op-node ./ | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
COPY nethermind/nethermind-entrypoint ./execution-entrypoint | ||
COPY op-node-entrypoint . | ||
|
||
CMD ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# Default configurations | ||
NETHERMIND_DATA_DIR=${NETHERMIND_DATA_DIR:-/data} | ||
NETHERMIND_LOG_LEVEL=${NETHERMIND_LOG_LEVEL:-Info} | ||
NETWORK=${NETWORK:-mainnet} | ||
|
||
RPC_PORT="${RPC_PORT:-8545}" | ||
WS_PORT="${WS_PORT:-8546}" | ||
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}" | ||
METRICS_PORT="${METRICS_PORT:-6060}" | ||
DISCOVERY_PORT="${DISCOVERY_PORT:-30303}" | ||
|
||
JWT_SECRET_FILE=${JWT_SECRET_FILE:-/tmp/jwt/jwtsecret} | ||
ADDITIONAL_ARGS="" | ||
|
||
# Check if required variables are set | ||
if [[ -z "$NETWORK" ]]; then | ||
echo "Expected NETWORK to be set" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# Create necessary directories | ||
mkdir -p "$NETHERMIND_DATA_DIR" | ||
|
||
# Write the JWT secret | ||
if [[ -z "${OP_NODE_L2_ENGINE_AUTH_RAW:-}" ]]; then | ||
echo "Expected OP_NODE_L2_ENGINE_AUTH_RAW to be set" 1>&2 | ||
exit 1 | ||
fi | ||
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH" | ||
|
||
# Additional arguments based on environment variables | ||
if [[ -n "${OP_NETHERMIND_ETHSTATS_ENABLED:-}" ]]; then | ||
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --EthStats.Enabled=$OP_NETHERMIND_ETHSTATS_ENABLED" | ||
fi | ||
|
||
if [[ -n "${OP_NETHERMIND_ETHSTATS_ENDPOINT:-}" ]]; then | ||
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --EthStats.NodeName=${OP_NETHERMIND_ETHSTATS_NODE_NAME:-NethermindNode} --EthStats.Endpoint=$OP_NETHERMIND_ETHSTATS_ENDPOINT" | ||
fi | ||
|
||
# Execute Nethermind | ||
exec ./nethermind \ | ||
--config="$OP_NODE_NETWORK" \ | ||
--datadir="$NETHERMIND_DATA_DIR" \ | ||
--log="$NETHERMIND_LOG_LEVEL" \ | ||
--JsonRpc.Enabled=true \ | ||
--JsonRpc.Host=0.0.0.0 \ | ||
--JsonRpc.WebSocketsPort="$WS_PORT" \ | ||
--JsonRpc.Port="$RPC_PORT" \ | ||
--JsonRpc.JwtSecretFile="$OP_NODE_L2_ENGINE_AUTH" \ | ||
--JsonRpc.EngineHost=0.0.0.0 \ | ||
--JsonRpc.EnginePort="$AUTHRPC_PORT" \ | ||
--HealthChecks.Enabled=true \ | ||
--Metrics.Enabled=true \ | ||
--Metrics.ExposePort="$METRICS_PORT" \ | ||
$ADDITIONAL_ARGS |