Part of [Create stack for lotus mainnet and calibration](https://www.notion.so/Create-stack-for-lotus-mainnet-and-calibration-700b4903f2004a4fb440ebb6922da954) - This PR is based on stack [mainnet-lotus](https://git.vdb.to/cerc-io/stack-orchestrator/src/branch/lotus-stack/stack_orchestrator/data/stacks/mainnet-lotus) in SO branch [lotus-stack](https://git.vdb.to/cerc-io/stack-orchestrator/src/branch/lotus-stack) - Use manually downloaded snapshot for running Lotus node with `DOCKER_LOTUS_IMPORT_SNAPSHOT` env - Support running Lotus node for Calibration network - Use `cerc-io/lotus` release [v1.27.0-rc3-interal-0.0.1](https://git.vdb.to/cerc-io/lotus/releases/tag/v1.27.0-rc3-interal-0.0.1) - Add Lotus node config params with default values - `LOTUS_FEVM_ENABLEETHRPC`: true - [Enables eth_rpc](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml#L248) - `LOTUS_EVENTS_ENABLEACTOREVENTSAPI`: true - [Enables the Actor events API that enables clients to consume events](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml#L279) - `LOTUS_INDEX_ENABLEMSGINDEX`: true - [Enables indexing of messages on chain](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml#L325) - Should be the fix for incorrect `eth_call` behaviour - `LOTUS_CHAINSTORE_ENABLESPLITSTORE`: true - [Enable the splitstore](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/blockstore/splitstore#splitstore-an-actively-scalable-blockstore-for-the-filecoin-chain) - `LOTUS_FEVM_ETHTXHASHMAPPINGLIFETIMEDAYS`: 0 - [Delete mappings that have been stored for more than x day in transaction hash lookup database](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml#L255) - LOTUS_FVM_CONCURRENCY: 4 - [Adjust the amount of threads used for more concurrent FMV execution](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/CHANGELOG.md?display=source#L1179) - LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS: 0 - [If node is a Storage Provider and is pushing many messages within a short period of time, then set to 1](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/CHANGELOG.md?display=source#L1179) - Some config params that were set previously but no longer used in release [v1.27.0-rc3-interal-0.0.1](https://git.vdb.to/cerc-io/lotus/releases/tag/v1.27.0-rc3-interal-0.0.1) - `LOTUS_FEVM_EVENTS_MAXFILTERHEIGHTRANGE` - `LOTUS_FEVM_EVENTS_FILTERTTL` - `ALLOWED_DELAY` - `LOTUS_FEVM_ENABLEETHHASHTOFILECOINCIDMAPPING` Reviewed-on: #1 Reviewed-by: ashwin <ashwin@noreply.git.vdb.to> Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to> Co-authored-by: Nabarun <nabarun@deepstacksoft.com> Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
162 lines
5.7 KiB
Docker
162 lines
5.7 KiB
Docker
# Dockerfile is copied from https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/Dockerfile
|
|
# This file has changes for building Lotus binary for Calibration network and installing netcat for healthcheck
|
|
|
|
#####################################
|
|
FROM golang:1.21.7-bullseye AS lotus-builder
|
|
MAINTAINER Lotus Development Team
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
|
|
|
|
ENV XDG_CACHE_HOME="/tmp"
|
|
|
|
### taken from https://github.com/rust-lang/docker-rust/blob/master/1.63.0/buster/Dockerfile
|
|
ENV RUSTUP_HOME=/usr/local/rustup \
|
|
CARGO_HOME=/usr/local/cargo \
|
|
PATH=/usr/local/cargo/bin:$PATH \
|
|
RUST_VERSION=1.63.0
|
|
|
|
RUN set -eux; \
|
|
dpkgArch="$(dpkg --print-architecture)"; \
|
|
case "${dpkgArch##*-}" in \
|
|
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; \
|
|
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; \
|
|
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
|
esac; \
|
|
url="https://static.rust-lang.org/rustup/archive/1.25.1/${rustArch}/rustup-init"; \
|
|
wget "$url"; \
|
|
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
|
|
chmod +x rustup-init; \
|
|
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
|
|
rm rustup-init; \
|
|
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
|
|
rustup --version; \
|
|
cargo --version; \
|
|
rustc --version;
|
|
|
|
COPY ./ /opt/filecoin
|
|
|
|
WORKDIR /opt/filecoin
|
|
|
|
### make configurable filecoin-ffi build
|
|
ARG FFI_BUILD_FROM_SOURCE=0
|
|
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE}
|
|
|
|
RUN make clean deps
|
|
|
|
ARG RUSTFLAGS=""
|
|
ARG GOFLAGS=""
|
|
|
|
RUN make buildall
|
|
|
|
### Create separate directory for calibnet
|
|
COPY ./ /opt/filecoin-calibnet
|
|
WORKDIR /opt/filecoin-calibnet
|
|
|
|
### Build for calibnet
|
|
RUN make clean deps
|
|
RUN make calibnet
|
|
|
|
#####################################
|
|
FROM ubuntu:20.04 AS lotus-base
|
|
MAINTAINER Lotus Development Team
|
|
|
|
# Base resources
|
|
COPY --from=lotus-builder /etc/ssl/certs /etc/ssl/certs
|
|
COPY --from=lotus-builder /lib/*/libdl.so.2 /lib/
|
|
COPY --from=lotus-builder /lib/*/librt.so.1 /lib/
|
|
COPY --from=lotus-builder /lib/*/libgcc_s.so.1 /lib/
|
|
COPY --from=lotus-builder /lib/*/libutil.so.1 /lib/
|
|
COPY --from=lotus-builder /usr/lib/*/libltdl.so.7 /lib/
|
|
COPY --from=lotus-builder /usr/lib/*/libnuma.so.1 /lib/
|
|
COPY --from=lotus-builder /usr/lib/*/libhwloc.so.* /lib/
|
|
COPY --from=lotus-builder /usr/lib/*/libOpenCL.so.1 /lib/
|
|
|
|
RUN useradd -r -u 532 -U fc \
|
|
&& mkdir -p /etc/OpenCL/vendors \
|
|
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
|
|
|
|
#####################################
|
|
FROM lotus-base AS lotus
|
|
MAINTAINER Lotus Development Team
|
|
|
|
COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/
|
|
|
|
# Copy and create separate binaries for calibnet
|
|
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus /usr/local/bin/lotus-calibnet
|
|
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus-shed /usr/local/bin/lotus-calibnet-shed
|
|
|
|
COPY scripts/docker-lotus-entrypoint.sh /
|
|
|
|
ARG DOCKER_LOTUS_IMPORT_SNAPSHOT=https://forest-archive.chainsafe.dev/latest/mainnet/
|
|
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT ${DOCKER_LOTUS_IMPORT_SNAPSHOT}
|
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
|
ENV LOTUS_PATH /var/lib/lotus
|
|
ENV DOCKER_LOTUS_IMPORT_WALLET ""
|
|
|
|
RUN mkdir /var/lib/lotus /var/tmp/filecoin-proof-parameters
|
|
RUN chown fc: /var/lib/lotus /var/tmp/filecoin-proof-parameters
|
|
|
|
VOLUME /var/lib/lotus
|
|
VOLUME /var/tmp/filecoin-proof-parameters
|
|
|
|
USER fc
|
|
|
|
EXPOSE 1234
|
|
|
|
ENTRYPOINT ["/docker-lotus-entrypoint.sh"]
|
|
|
|
CMD ["-help"]
|
|
|
|
#####################################
|
|
FROM lotus-base AS lotus-all-in-one
|
|
|
|
# Install netcat for healthcheck
|
|
RUN apt-get update && apt-get install -y netcat && apt-get install -y iproute2
|
|
|
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
|
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
|
ENV LOTUS_PATH /var/lib/lotus
|
|
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
|
ENV WALLET_PATH /var/lib/lotus-wallet
|
|
|
|
COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-seed /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-miner /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-worker /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/curio /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-stats /usr/local/bin/
|
|
COPY --from=lotus-builder /opt/filecoin/lotus-fountain /usr/local/bin/
|
|
|
|
# Copy and create separate binaries for calibnet
|
|
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus /usr/local/bin/lotus-calibnet
|
|
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus-seed /usr/local/bin/lotus-calibnet-seed
|
|
|
|
RUN mkdir /var/tmp/filecoin-proof-parameters
|
|
RUN mkdir /var/lib/lotus
|
|
RUN mkdir /var/lib/lotus-miner
|
|
RUN mkdir /var/lib/lotus-worker
|
|
RUN mkdir /var/lib/lotus-wallet
|
|
RUN mkdir /var/lib/curio
|
|
RUN chown fc: /var/tmp/filecoin-proof-parameters
|
|
RUN chown fc: /var/lib/lotus
|
|
RUN chown fc: /var/lib/lotus-miner
|
|
RUN chown fc: /var/lib/lotus-worker
|
|
RUN chown fc: /var/lib/lotus-wallet
|
|
RUN chown fc: /var/lib/curio
|
|
|
|
|
|
VOLUME /var/tmp/filecoin-proof-parameters
|
|
VOLUME /var/lib/lotus
|
|
VOLUME /var/lib/lotus-miner
|
|
VOLUME /var/lib/lotus-worker
|
|
VOLUME /var/lib/lotus-wallet
|
|
VOLUME /var/lib/curio
|
|
|
|
EXPOSE 1234
|
|
EXPOSE 2345
|
|
EXPOSE 3456
|
|
EXPOSE 1777 |