-
Notifications
You must be signed in to change notification settings - Fork 160
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
1 parent
a7e996c
commit 0a6a635
Showing
4 changed files
with
126 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Docker compose file to run a local devnet. | ||
# The devnet consists of a: | ||
# - Lotus node (2k build), | ||
# - Lotus miner (2k build), | ||
# - Forest node. | ||
|
||
version: "3.7" | ||
|
||
services: | ||
lotus_init: | ||
build: | ||
context: . | ||
dockerfile: lotus.dockerfile | ||
volumes: | ||
- filecoin-proofs:/var/tmp/filecoin-proof-parameters | ||
- lotus-data:/lotus_data | ||
env_file: | ||
- lotus.env | ||
entrypoint: ["/bin/bash", "-c" ] | ||
command: | ||
- | | ||
lotus fetch-params 2048 | ||
# TODO check this already exists, only do the init if it doesn't | ||
lotus-seed --sector-dir /lotus_data/genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2 | ||
lotus-seed --sector-dir /lotus_data/genesis-sectors genesis new /lotus_data/localnet.json | ||
lotus-seed --sector-dir /lotus_data/genesis-sectors genesis add-miner /lotus_data/localnet.json /lotus_data/genesis-sectors/pre-seal-t01000.json | ||
lotus_node: | ||
depends_on: | ||
lotus_init: | ||
condition: service_completed_successfully | ||
build: | ||
context: . | ||
dockerfile: lotus.dockerfile | ||
container_name: lotus | ||
networks: | ||
- devnet | ||
volumes: | ||
- filecoin-proofs:/var/tmp/filecoin-proof-parameters | ||
- lotus-data:/lotus_data | ||
entrypoint: ["/bin/bash", "-c" ] | ||
ports: | ||
- 1234:1234 | ||
- 9090:9090 | ||
env_file: | ||
- lotus.env | ||
command: | ||
- | | ||
lotus daemon --lotus-make-genesis=/lotus_data/devgen.car --genesis-template=/lotus_data/localnet.json --bootstrap=false | ||
lotus_miner_init: | ||
depends_on: | ||
lotus_init: | ||
condition: service_completed_successfully | ||
build: | ||
context: . | ||
dockerfile: lotus.dockerfile | ||
container_name: lotus-miner | ||
networks: | ||
- devnet | ||
volumes: | ||
- filecoin-proofs:/var/tmp/filecoin-proof-parameters | ||
- lotus-data:/lotus_data | ||
entrypoint: ["/bin/bash", "-c" ] | ||
ports: | ||
- 2345:2345 | ||
env_file: | ||
- lotus-miner.env | ||
command: | ||
- | | ||
sleep 10 | ||
lotus wallet import --as-default /lotus_data/genesis-sectors/pre-seal-t01000.key | ||
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=/lotus_data/genesis-sectors --pre-sealed-metadata=/lotus_data/genesis-sectors/pre-seal-t01000.json --nosync | ||
# TODO above is a init, run it once, same as the node, then run the miner normally | ||
lotus-miner run --no-sync | ||
volumes: | ||
filecoin-proofs: | ||
lotus-data: | ||
|
||
networks: | ||
devnet: |
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,7 @@ | ||
LOTUS_PATH=/lotus_data/lotus-local-net | ||
LOTUS_MINER_PATH=/lotus_data/lotus-miner-local-net | ||
LOTUS_SKIP_GENESIS_CHECK=_yes_ | ||
CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" | ||
CGO_CFLAGS="-D__BLST_PORTABLE__" | ||
LOTUS_API_LISTENADDRESS=/dns/lotus/tcp/2345/http | ||
LOTUS_API_LISTENADDRESS=/dns/lotus-miner/tcp/2345/http |
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,30 @@ | ||
# Lotus binaries image, to be used in the local devnet with Forest. | ||
FROM golang:1.19.7-buster AS lotus-builder | ||
|
||
ARG LOTUS_TAG=v1.23.0 | ||
|
||
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev | ||
|
||
WORKDIR /lotus | ||
RUN git clone --depth 1 --branch ${LOTUS_TAG} https://github.com/filecoin-project/lotus.git . && make 2k | ||
|
||
FROM ubuntu:22.04 | ||
|
||
# Need to copy the relevant shared libraries from the builder image. | ||
# See https://github.com/filecoin-project/lotus/blob/master/Dockerfile | ||
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.5 /lib/ | ||
COPY --from=lotus-builder /usr/lib/*/libOpenCL.so.1 /lib/ | ||
|
||
# Copy only the binaries relevant for the devnet | ||
COPY --from=lotus-builder /lotus/lotus /lotus/lotus-miner /lotus/lotus-seed /usr/local/bin/ | ||
|
||
WORKDIR /lotus | ||
|
||
CMD ["/bin/bash"] |
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,6 @@ | ||
LOTUS_PATH=/lotus_data/lotus-local-net | ||
LOTUS_MINER_PATH=/lotus_data/lotus-miner-local-net | ||
LOTUS_SKIP_GENESIS_CHECK=_yes_ | ||
CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" | ||
CGO_CFLAGS="-D__BLST_PORTABLE__" | ||
LOTUS_API_LISTENADDRESS=/dns/lotus/tcp/1234/http |