diff --git a/stack-orchestrator/container-build/cerc-lotus-node/Dockerfile b/stack-orchestrator/container-build/cerc-lotus-node/Dockerfile index 43736a5..80a5112 100644 --- a/stack-orchestrator/container-build/cerc-lotus-node/Dockerfile +++ b/stack-orchestrator/container-build/cerc-lotus-node/Dockerfile @@ -1,3 +1,6 @@ +# 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 @@ -45,10 +48,11 @@ ARG GOFLAGS="" RUN make buildall -### build for calibnet +### Create separate directory for calibnet COPY ./ /opt/filecoin-calibnet WORKDIR /opt/filecoin-calibnet +### Build for calibnet RUN make clean deps RUN make calibnet @@ -78,6 +82,7 @@ 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 @@ -126,6 +131,7 @@ 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 diff --git a/stack-orchestrator/container-build/cerc-lotus-node/build.sh b/stack-orchestrator/container-build/cerc-lotus-node/build.sh index 42c490a..7a4d45f 100755 --- a/stack-orchestrator/container-build/cerc-lotus-node/build.sh +++ b/stack-orchestrator/container-build/cerc-lotus-node/build.sh @@ -3,9 +3,6 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -git stash - - # Replace repo's Dockerfile with modified one cp ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/lotus/Dockerfile diff --git a/stack-orchestrator/stacks/lotus-node/README.md b/stack-orchestrator/stacks/lotus-node/README.md index f15202b..2f31c5d 100644 --- a/stack-orchestrator/stacks/lotus-node/README.md +++ b/stack-orchestrator/stacks/lotus-node/README.md @@ -15,7 +15,7 @@ Downloaded chain snapshot ``` - For Calibration Testnet - ``` + ```bash aria2c -o calibnet-snapshot.car.zst -x5 https://forest-archive.chainsafe.dev/latest/calibnet/ # or using wget @@ -31,7 +31,7 @@ $ laconic-so fetch-stack git.vdb.to/cerc-io/lotus-stack ## Clone required repositories ```bash -$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node setup-repositories +$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node setup-repositories --branches git.vdb.to/cerc-io/lotus@v1.27.0-rc3-interal-0.0.1 ``` ## Build the Lotus containers @@ -42,34 +42,32 @@ $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node bui ## Create a deployment -```bash -$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy init --map-ports-to-host any-same --output lotus-node.yml -$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy create --spec-file lotus-node.yml --deployment-dir lotus-node-deployment -``` +- Create deployment spec file + + - For Mainnet + ```bash + $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy init --map-ports-to-host any-same --output lotus-node.yml --config CERC_LOTUS_NETWORK=mainnet,CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/mainnet-snapshot.car.zst + ``` + + - For Calibration + ```bash + $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy init --map-ports-to-host any-same --output lotus-node.yml --config CERC_LOTUS_NETWORK=calibration,CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/calibnet-snapshot.car.zst + ``` + + NOTE: In commands above, set `CERC_LOTUS_SNAPSHOT_PATH` to the absolute file path of the downloaded snapshot ([Prerequisite](#prerequisite)) + +- Create deployment directory + ```bash + $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy create --spec-file lotus-node.yml --deployment-dir lotus-node-deployment + ``` ## Setup config -Inside deployment directory, open the `config.env` file and set following env variables: +Environment variables for Lotus node can be configured by setting them in `config.env` inside deployment directory -- For Mainnet - ```bash - CERC_LOTUS_NETWORK=mainnet +- Check [compose file](../../compose/docker-compose-lotus-node.yml) for configured environment variables - # File path of downloaded snapshot - CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/mainnet-snapshot.car.zst - ``` - -- For Calibration - ```bash - CERC_LOTUS_NETWORK=calibration - - # File path of downloaded snapshot - CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/calibnet-snapshot.car.zst - ``` - -- Environment variables for Lotus node can be configured by setting them in `config.env` inside deployment directory - - Check [compose file](../../compose/docker-compose-lotus-node.yml) for configured environment variables - - Refer to [default Lotus config](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml) +- Refer to [default Lotus config](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml) ## Start the container diff --git a/stack-orchestrator/stacks/lotus-node/stack.yml b/stack-orchestrator/stacks/lotus-node/stack.yml index 807afbb..b989d90 100644 --- a/stack-orchestrator/stacks/lotus-node/stack.yml +++ b/stack-orchestrator/stacks/lotus-node/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: lotus-node description: "Lotus node stack" repos: - - git.vdb.to/cerc-io/lotus@v1.27.0-rc3-interal-0.0.1 + - git.vdb.to/cerc-io/lotus containers: - cerc/lotus-node pods: