Skip to content

Commit

Permalink
Add lodestar ropsten merge support
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed May 28, 2022
1 parent 9c8b34e commit 04028d0
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 22 deletions.
2 changes: 1 addition & 1 deletion besu/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN set -eux; \
gosu nobody true

# Create data mount point with permissions
RUN mkdir -p /var/lib/besu/secrets && chown -R besu:besu /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 755 /var/lib/besu/secrets
RUN mkdir -p /var/lib/besu/secrets && chown -R besu:besu /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 750 /var/lib/besu/secrets

COPY ./docker-entrypoint.sh /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion besu/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

RUN mkdir -p /var/lib/besu/secrets && chown -R besu:besu /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 755 /var/lib/besu/secrets
RUN mkdir -p /var/lib/besu/secrets && chown -R besu:besu /var/lib/besu && chmod -R 700 /var/lib/besu && chmod 750 /var/lib/besu/secrets

# Copy executable
COPY --from=builder /usr/src/besu/build/install/besu/. /opt/besu/
Expand Down
2 changes: 1 addition & 1 deletion default.env
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ PRYSM_DOCKERFILE=Dockerfile.binary

# Lodestar
LS_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
LS_DOCKER_TAG=latest
LS_DOCKER_TAG=next
LS_DOCKERFILE=Dockerfile.binary

# Erigon
Expand Down
2 changes: 1 addition & 1 deletion erigon/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ USER root

RUN apk --no-cache add shadow bash su-exec && groupmod -g "${GID}" erigon && usermod -u "${UID}" -g "${GID}" erigon

RUN mkdir -p /var/lib/erigon/secrets && chown -R erigon:erigon /var/lib/erigon && chmod -R 700 /var/lib/erigon && chmod 755 /var/lib/erigon/secrets
RUN mkdir -p /var/lib/erigon/secrets && chown -R erigon:erigon /var/lib/erigon && chmod -R 700 /var/lib/erigon && chmod 750 /var/lib/erigon/secrets

COPY ./docker-entrypoint.sh /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion erigon/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

RUN mkdir -p /var/lib/erigon/secrets && chown -R erigon:erigon /var/lib/erigon && chmod -R 700 /var/lib/erigon && chmod 755 /var/lib/erigon/secrets
RUN mkdir -p /var/lib/erigon/secrets && chown -R erigon:erigon /var/lib/erigon && chmod -R 700 /var/lib/erigon && chmod 750 /var/lib/erigon/secrets

# Copy executable
COPY --from=builder /src/erigon/build/bin/erigon /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion geth/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

RUN mkdir -p /var/lib/goethereum/secrets && chown -R ${USER}:${USER} /var/lib/goethereum && chmod -R 700 /var/lib/goethereum && chmod 755 /var/lib/goethereum/secrets
RUN mkdir -p /var/lib/goethereum/secrets && chown -R ${USER}:${USER} /var/lib/goethereum && chmod -R 700 /var/lib/goethereum && chmod 750 /var/lib/goethereum/secrets

COPY ./docker-entrypoint.sh /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion geth/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN adduser \
--ingroup "${USER}" \
"${USER}"

RUN mkdir -p /var/lib/goethereum/secrets && chown -R ${USER}:${USER} /var/lib/goethereum && chmod -R 700 /var/lib/goethereum && chmod 755 /var/lib/goethereum/secrets
RUN mkdir -p /var/lib/goethereum/secrets && chown -R ${USER}:${USER} /var/lib/goethereum && chmod -R 700 /var/lib/goethereum && chmod 750 /var/lib/goethereum/secrets

# Copy executable
COPY --from=builder /src/go-ethereum/build/bin/geth /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion lighthouse/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN adduser \
"${USER}"

# Create data mount point with permissions
RUN mkdir -p /var/lib/lighthouse/beacon/secrets && chown -R ${USER}:${USER} /var/lib/lighthouse/beacon && chmod -R 700 /var/lib/lighthouse/beacon && chmod 755 /var/lib/lighthouse/beacon/secrets
RUN mkdir -p /var/lib/lighthouse/beacon/secrets && chown -R ${USER}:${USER} /var/lib/lighthouse/beacon && chmod -R 700 /var/lib/lighthouse/beacon && chmod 750 /var/lib/lighthouse/beacon/secrets
COPY ./docker-entrypoint.sh /usr/local/bin/

ARG USER=lhvalidator
Expand Down
2 changes: 1 addition & 1 deletion lighthouse/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN adduser \
"${USER}"

# Create data mount point with permissions
RUN mkdir -p /var/lib/lighthouse/beacon/secrets && chown -R ${USER}:${USER} /var/lib/lighthouse/beacon && chmod -R 700 /var/lib/lighthouse/beacon && chmod 755 /var/lib/lighthouse/beacon/secrets
RUN mkdir -p /var/lib/lighthouse/beacon/secrets && chown -R ${USER}:${USER} /var/lib/lighthouse/beacon && chmod -R 700 /var/lib/lighthouse/beacon && chmod 750 /var/lib/lighthouse/beacon/secrets
COPY ./docker-entrypoint.sh /usr/local/bin/

ARG USER=lhvalidator
Expand Down
10 changes: 8 additions & 2 deletions lodestar-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ services:
volumes:
- lsconsensus-data:/var/lib/lodestar/consensus
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/lodestar/consensus/secrets
environment:
- RAPID_SYNC_URL=${RAPID_SYNC_URL}
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
Expand All @@ -46,8 +49,10 @@ services:
- "/ip4/0.0.0.0/udp/${CL_P2P_PORT:-9000}"
- --network.localMultiaddrs
- "/ip4/0.0.0.0/tcp/${CL_P2P_PORT:-9000}"
- --eth1.providerUrls
- ${EL_NODE:-http://execution:8545}
- --execution.urls
- ${EL_NODE}
- --jwt-secret
- /var/lib/lodestar/consensus/secrets/jwtsecret
- --logLevel
- ${LOG_LEVEL}
- --network
Expand Down Expand Up @@ -165,3 +170,4 @@ services:
volumes:
lsconsensus-data:
lsvalidator-data:
jwtsecret:
2 changes: 1 addition & 1 deletion lodestar/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN adduser \
--uid "${UID}" \
"${USER}"

RUN mkdir -p /var/lib/lodestar/consensus && chown ${USER}:${USER} /var/lib/lodestar/consensus && chmod 700 /var/lib/lodestar/consensus
RUN mkdir -p /var/lib/lodestar/consensus/secrets && chown -R ${USER}:${USER} /var/lib/lodestar/consensus && chmod -R 700 /var/lib/lodestar/consensus && chmod 750 /var/lib/lodestar/consensus/secrets

ARG USER=lsvalidator
ARG UID=10000
Expand Down
4 changes: 2 additions & 2 deletions lodestar/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY --from=build /usr/app/lodestar/node_modules ./node_modules/
COPY --from=build /usr/app/lodestar/packages ./packages


# Scripts
# Scripts
COPY ./validator-import.sh /usr/local/bin/
COPY ./docker-entrypoint.sh /usr/local/bin/

Expand All @@ -38,7 +38,7 @@ RUN adduser \
--uid "${UID}" \
"${USER}"

RUN mkdir -p /var/lib/lodestar/consensus && chown ${USER}:${USER} /var/lib/lodestar/consensus && chmod 700 /var/lib/lodestar/consensus
RUN mkdir -p /var/lib/lodestar/consensus/secrets && chown -R ${USER}:${USER} /var/lib/lodestar/consensus && chmod -R 700 /var/lib/lodestar/consensus && chmod 750 /var/lib/lodestar/consensus/secrets

ARG USER=lsvalidator
ARG UID=10000
Expand Down
17 changes: 15 additions & 2 deletions lodestar/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@ if [ ! -f /var/lib/lodestar/consensus/api-token.txt ]; then
echo $__token > /var/lib/lodestar/consensus/api-token.txt
fi

if [ -n "${JWT_SECRET}" ]; then
echo -n ${JWT_SECRET} > /var/lib/lodestar/consensus/secrets/jwtsecret
echo "JWT secret was supplied in .env"
fi

# Check whether we should override TTD
if [ -n "${OVERRIDE_TTD}" ]; then
__override_ttd="--terminal-total-difficulty-override ${OVERRIDE_TTD}"
echo "Overriding TTD to ${OVERRIDE_TTD}"
else
__override_ttd=""
fi

if [ -n "${RAPID_SYNC_URL:+x}" -a ! -f "/var/lib/lodestar/consensus/setupdone" ]; then
touch /var/lib/lodestar/consensus/setupdone
exec $@ --weakSubjectivitySyncLatest=true --weakSubjectivityServerUrl=${RAPID_SYNC_URL}
exec $@ --weakSubjectivitySyncLatest=true --weakSubjectivityServerUrl=${RAPID_SYNC_URL} ${__override_ttd}
fi

exec $@
exec $@ ${__override_ttd}
2 changes: 1 addition & 1 deletion nethermind/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN set -eux; \
gosu nobody true

RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/secrets && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 755 /var/lib/nethermind/secrets
RUN mkdir -p /var/lib/nethermind/secrets && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 750 /var/lib/nethermind/secrets
COPY ./docker-entrypoint.sh /usr/local/bin/

USER ${USER}
Expand Down
2 changes: 1 addition & 1 deletion nethermind/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ WORKDIR /nethermind
COPY --from=build /nethermind/out .

RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/secrets && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 755 /var/lib/nethermind/secrets
RUN mkdir -p /var/lib/nethermind/secrets && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 750 /var/lib/nethermind/secrets
COPY ./docker-entrypoint.sh /usr/local/bin/

USER ${USER}
Expand Down
2 changes: 1 addition & 1 deletion nimbus/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN set -eux; \
gosu nobody true

# Create data mount point with permissions
RUN mkdir -p /var/lib/nimbus/secrets && chown -R user:user /var/lib/nimbus && chmod -R 700 /var/lib/nimbus && chmod 755 /var/lib/nimbus/secrets
RUN mkdir -p /var/lib/nimbus/secrets && chown -R user:user /var/lib/nimbus && chmod -R 700 /var/lib/nimbus && chmod 750 /var/lib/nimbus/secrets

# Copy beacon_node into $PATH
RUN cp /home/user/nimbus-eth2/build/nimbus_beacon_node /usr/local/bin/nimbus_beacon_node
Expand Down
2 changes: 1 addition & 1 deletion nimbus/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN adduser \
--uid "${UID}" \
"${USER}"

RUN mkdir -p /var/lib/nimbus/secrets && chown -R ${USER}:${USER} /var/lib/nimbus && chmod 700 /var/lib/nimbus && chmod 755 /var/lib/nimbus/secrets
RUN mkdir -p /var/lib/nimbus/secrets && chown -R ${USER}:${USER} /var/lib/nimbus && chmod 700 /var/lib/nimbus && chmod 750 /var/lib/nimbus/secrets

# Copy executable
COPY --from=builder /usr/src/nim-beacon-chain/build/nimbus_beacon_node /usr/local/bin/nimbus_beacon_node
Expand Down
2 changes: 1 addition & 1 deletion teku/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN set -eux; \
gosu nobody true

# Create data mount point with permissions
RUN mkdir -p /var/lib/teku/validator-keys && mkdir -p /var/lib/teku/validator-passwords && chown -R teku:teku /var/lib/teku && chmod -R 700 /var/lib/teku
RUN mkdir -p /var/lib/teku/validator-keys && mkdir -p /var/lib/teku/validator-passwords && mkdir -p /var/lib/teku/secrets && chown -R teku:teku /var/lib/teku && chmod -R 700 /var/lib/teku && chmod 750 /var/lib/teku/secrets
# Script to query and store validator key passwords
COPY ./validator-import.sh /usr/local/bin/
COPY ./docker-entrypoint.sh /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion teku/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN adduser \
--uid "${UID}" \
"${USER}"

RUN mkdir -p /var/lib/teku/validator-keys && mkdir -p /var/lib/teku/validator-passwords && chown -R ${USER}:${USER} /var/lib/teku && chmod -R 700 /var/lib/teku
RUN mkdir -p /var/lib/teku/validator-keys && mkdir -p /var/lib/teku/validator-passwords && mkdir -p /var/lib/teku/secrets && chown -R ${USER}:${USER} /var/lib/teku && chmod -R 700 /var/lib/teku && chmod 750 /var/lib/teku/secrets

# Copy executable
COPY --from=builder /usr/src/teku/build/install/teku/. /opt/teku/
Expand Down

0 comments on commit 04028d0

Please sign in to comment.