Skip to content
Merged
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 docker/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ L2_TEST_RPC_URL=https://opt-mainnet.g.alchemy.com/v2/<API_KEY>
# ------------------------------ Do not modify ------------------------------
COMPOSE_PROJECT_NAME=$NETWORK
COMPOSE_PROFILES=hildr-node,metrics,${EXECUTION_CLIENT}

LOG_LEVEL=DEBUG
19 changes: 18 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,30 @@ RUN tar -zxvf /tmp/jdk.tar.gz --directory $JAVA_HOME --strip-components 1
ENV PATH=$JAVA_HOME/bin:$PATH
RUN java -version
RUN native-image --version
ENV MUSL_PKG=https://more.musl.cc/10/x86_64-linux-musl/x86_64-linux-musl-native.tgz \
TOOLCHAIN_DIR=/usr/musl
RUN wget -c $MUSL_PKG -O /tmp/musl.tgz
RUN mkdir -p $TOOLCHAIN_DIR
RUN tar -zxvf /tmp/musl.tgz --directory $TOOLCHAIN_DIR --strip-components 1
ENV CC=$TOOLCHAIN_DIR/bin/gcc
ENV ZLIB_PKG=https://zlib.net/current/zlib.tar.gz \
ZLIB_DIR=/usr/zlib
RUN wget -c $ZLIB_PKG -O /tmp/zlib.tgz
RUN mkdir -p $ZLIB_DIR
RUN tar -zxvf /tmp/zlib.tgz --directory $ZLIB_DIR --strip-components 1
WORKDIR $ZLIB_DIR
RUN ./configure --prefix=$TOOLCHAIN_DIR --static
RUN make
RUN make install
ENV PATH=$TOOLCHAIN_DIR/bin:$PATH
RUN x86_64-linux-musl-gcc --version
WORKDIR /root/hildr
COPY . .
#RUN ./gradlew -Pagent run --args="--network optimism-goerli --jwt-secret bf549f5188556ce0951048ef467ec93067bc4ea21acebe46ef675cd4e8e015ff --l1-rpc-url https://eth-goerli.g.alchemy.com/v2/4fUcO9-bSvCtGYwwibuWbz7ktjWwuoN3 --l2-rpc-url http://192.168.3.230:8545 --l2-engine-url http://192.168.3.230:8551 --rpc-port 9545 --sync-mode full"
#RUN ./gradlew metadataCopy --task run --dir src/main/resources/META-INF/native-image
#RUN ./gradlew buildJarForDocker
#RUN ./gradlew :hildr-node:clean :hildr-node:nativeCompile -Pmusl
RUN ./gradlew :hildr-node:clean :hildr-node:buildBinary
RUN ./gradlew :hildr-node:clean :hildr-node:buildBinaryStatic
#RUN cd /root/hildr/hildr-node/build/docker && \
#native-image -jar hildr-node.jar --no-fallback --enable-http --enable-https --enable-preview --add-modules jdk.incubator.concurrent -H:EnableURLProtocols=http,https --initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback.core.CoreConstants,ch.qos.logback.core.util.Loader,ch.qos.logback.core.util.StatusPrinter,ch.qos.logback.core.status.InfoStatus,ch.qos.logback.classic.Logger,ch.qos.logback.core.rolling.helper.FileNamePattern,ch.qos.logback.classic.Level,ch.qos.logback.core.status.StatusBase,io.opentelemetry.api.trace.ArrayBasedTraceStateBuilder,io.opentelemetry.context.LazyStorage,ch.qos.logback.core.util.FileSize,ch.qos.logback.core.rolling.helper.RollingCalendar,io.opentelemetry.api.internal.ImmutableSpanContext,io.opentelemetry.api.internal.OtelEncodingUtils,ch.qos.logback.classic.PatternLayout,io.opentelemetry.context.ThreadLocalContextStorage,io.opentelemetry.api.trace.PropagatedSpan,io.opentelemetry.context.ContextStorageWrappers,ch.qos.logback.core.rolling.helper.Compressor$1,io.opentelemetry.api.trace.ImmutableTraceFlags,ch.qos.logback.core.rolling.helper.RollingCalendar$1,ch.qos.logback.classic.model.ConfigurationModel,ch.qos.logback.core.model.processor.DefaultProcessor$1,ch.qos.logback.core.model.processor.ImplicitModelHandler$1,ch.qos.logback.core.subst.Token,ch.qos.logback.core.pattern.parser.Parser,ch.qos.logback.core.subst.Parser$1,ch.qos.logback.core.util.Duration,ch.qos.logback.core.model.processor.ChainedModelFilter$1,ch.qos.logback.classic.model.processor.ConfigurationModelHandler,ch.qos.logback.classic.model.processor.LogbackClassicDefaultNestedComponentRules,ch.qos.logback.core.subst.NodeToStringTransformer$1,ch.qos.logback.core.pattern.parser.TokenStream$1,ch.qos.logback.core.subst.Tokenizer$1 --initialize-at-run-time=io.netty.channel.AbstractChannel,io.netty.channel.socket.nio.SelectorProviderUtil,io.netty.util.concurrent.DefaultPromise,io.netty,org.slf4j.MDC,org.github.gestalt.config hildr-node

Expand Down
26 changes: 25 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ x-logging: &logging

services:
hildr-node:
image: ghcr.io/optimism-java/hildr:latest
# image: ghcr.io/optimism-java/hildr:latest
container_name: hildr-node
build:
dockerfile: ./docker/jvm.dock
Expand All @@ -32,6 +32,30 @@ services:
- ${OP_ROLLUP_JSON_FILEPATH:-.}:/rollup.json
<<: *logging

hildr-node-native:
# image: ghcr.io/optimism-java/hildr:latest
container_name: hildr-node
build:
dockerfile: ./docker/Dockerfile
context: ../
profiles:
- hildr-node-native
restart: unless-stopped
stop_grace_period: 3m
entrypoint: /scripts/start-hildr-node.sh
depends_on:
- op-geth
env_file:
- .env
ports:
- 9200:9200
- "${RPC_PORT}:${RPC_PORT}"
volumes:
- ./:/scripts
- data:/data
- ${OP_ROLLUP_JSON_FILEPATH:-.}:/rollup.json
<<: *logging

op-geth:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101304.2
container_name: op-geth
Expand Down
2 changes: 1 addition & 1 deletion docker/start-hildr-node-java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ then
fi
fi

if [ $LOG_LEVEL = "" ]
if [[ $LOG_LEVEL = "" ]]
then
LOG_LEVEL="INFO"
fi
Expand Down