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
41 changes: 0 additions & 41 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ LOTUS_1_PATH=${LOTUS_1_DATA_DIR}/lotus1-net
LOTUS_1_API_LISTENADDRESS=/dns/lotus1/tcp/${LOTUS_RPC_PORT}/http
LOTUS_1_LIBP2P_LISTENADDRESSES=/ip4/lotus1/tcp/${LOTUS_P2P_PORT}

# Lotus 2
LOTUS_2_DATA_DIR=/lotus2
LOTUS_2_PATH=${LOTUS_2_DATA_DIR}/lotus2-net
LOTUS_2_API_LISTENADDRESS=/dns/lotus2/tcp/${LOTUS_RPC_PORT}/http
LOTUS_2_LIBP2P_LISTENADDRESSES=/ip4/lotus2/tcp/${LOTUS_P2P_PORT}

# Lotus 3
LOTUS_3_DATA_DIR=/lotus3
LOTUS_3_PATH=${LOTUS_3_DATA_DIR}/lotus3-net
LOTUS_3_API_LISTENADDRESS=/dns/lotus3/tcp/${LOTUS_RPC_PORT}/http
LOTUS_3_LIBP2P_LISTENADDRESSES=/ip4/lotus3/tcp/${LOTUS_P2P_PORT}

# Lotus 4
LOTUS_4_DATA_DIR=/lotus4
LOTUS_4_PATH=${LOTUS_4_DATA_DIR}/lotus4-net
LOTUS_4_API_LISTENADDRESS=/dns/lotus4/tcp/${LOTUS_RPC_PORT}/http
LOTUS_4_LIBP2P_LISTENADDRESSES=/ip4/lotus4/tcp/${LOTUS_P2P_PORT}

# Lotus Miner 0
LOTUS_MINER_0_ACTOR_ADDRESS=t01000
LOTUS_MINER_0_PATH=${LOTUS_0_DATA_DIR}/lotus-miner0-net
Expand All @@ -77,21 +59,6 @@ LOTUS_MINER_1_ACTOR_ADDRESS=t01001
LOTUS_MINER_1_PATH=${LOTUS_1_DATA_DIR}/lotus-miner1-net
LOTUS_MINER_1_API_LISTENADDRESS=/dns/lotus-miner1/tcp/${LOTUS_MINER_RPC_PORT}/http

# Lotus Miner 2
LOTUS_MINER_2_ACTOR_ADDRESS=t01002
LOTUS_MINER_2_PATH=${LOTUS_2_DATA_DIR}/lotus-miner2-net
LOTUS_MINER_2_API_LISTENADDRESS=/dns/lotus-miner2/tcp/${LOTUS_MINER_RPC_PORT}/http

# Lotus Miner 3
LOTUS_MINER_3_ACTOR_ADDRESS=t01003
LOTUS_MINER_3_PATH=${LOTUS_3_DATA_DIR}/lotus-miner3-net
LOTUS_MINER_3_API_LISTENADDRESS=/dns/lotus-miner3/tcp/${LOTUS_MINER_RPC_PORT}/http

# Lotus Miner 4
LOTUS_MINER_4_ACTOR_ADDRESS=t01004
LOTUS_MINER_4_PATH=${LOTUS_4_DATA_DIR}/lotus-miner4-net
LOTUS_MINER_4_API_LISTENADDRESS=/dns/lotus-miner4/tcp/${LOTUS_MINER_RPC_PORT}/http


# ----------------------------- FOREST -----------------------------

Expand Down Expand Up @@ -122,14 +89,6 @@ FOREST_F3_SIDECAR_FFI_ENABLED=1
FOREST_0_DATA_DIR=/forest0
FOREST_0_F3_SIDECAR_RPC_ENDPOINT=forest0:${F3_RPC_PORT}

# Forest 1
FOREST_1_DATA_DIR=/forest1
FOREST_1_F3_SIDECAR_RPC_ENDPOINT=forest1:${F3_RPC_PORT}

# Forest 2
FOREST_2_DATA_DIR=/forest2
FOREST_2_F3_SIDECAR_RPC_ENDPOINT=forest2:${F3_RPC_PORT}


# ----------------------------- CURIO -----------------------------

Expand Down
37 changes: 29 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Filecoin Antithesis Docker Build Makefile
# ==========================================
-include versions.env

# Git tags/commits for each image
drand_tag = $(shell git ls-remote --tags https://github.com/drand/drand.git | grep -E 'refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$$' | tail -n1 | sed 's/.*refs\/tags\///')
Expand Down Expand Up @@ -84,24 +85,37 @@ build-workload:
@echo "Building workload for $(TARGET_ARCH)..."
$(BUILD_CMD) -t workload:latest -f workload/Dockerfile workload

.PHONY: build-filwizard
build-filwizard:
@echo "Building filwizard for $(TARGET_ARCH)..."
$(BUILD_CMD) -t filwizard:latest -f filwizard/Dockerfile filwizard

# ==========================================
# Compose commands
# ==========================================
.PHONY: up
up:
cd config && $(builder) compose up -d
$(builder) compose up -d

.PHONY: up-foc
up-foc:
$(builder) compose --profile foc up -d

.PHONY: down
down:
cd config && $(builder) compose down
$(builder) compose down

.PHONY: down-foc
down-foc:
$(builder) compose --profile foc down

.PHONY: logs
logs:
cd config && $(builder) compose logs -f
$(builder) compose logs -f

.PHONY: restart
restart:
cd config && $(builder) compose restart
$(builder) compose restart

# ==========================================
# Build groups
Expand All @@ -115,7 +129,7 @@ build-nodes: build-lotus build-forest build-curio
@echo "Node images built."

.PHONY: build-all
build-all: build-drand build-lotus build-forest build-curio build-workload
build-all: build-drand build-lotus build-forest build-curio build-workload build-filwizard
@echo "All images built."

# ==========================================
Expand All @@ -129,9 +143,13 @@ all: build-all up
rebuild: down cleanup build-all up
@echo "Clean rebuild complete."

.PHONY: rebuild-foc
rebuild-foc: down-foc cleanup build-all up-foc
@echo "Clean rebuild (FOC) complete."

.PHONY: cleanup
cleanup:
cd config && $(builder) compose down 2>/dev/null || true
$(builder) compose down 2>/dev/null || true
./cleanup.sh

# ==========================================
Expand All @@ -146,6 +164,7 @@ help:
@echo " make build-lotus Build lotus image"
@echo " make build-forest Build forest image"
@echo " make build-curio Build curio image"
@echo " make build-filwizard Build filwizard image"
@echo " make build-workload Build workload image"
@echo ""
@echo "Build groups:"
Expand All @@ -154,8 +173,10 @@ help:
@echo " make build-all Build all images"
@echo ""
@echo "Docker Compose:"
@echo " make up Start localnet (docker compose up -d)"
@echo " make down Stop localnet (docker compose down)"
@echo " make up Start all default services (drand + lotus + miners + forest + workload)"
@echo " make up-foc Start all + FOC services (curio + filwizard + yugabyte)"
@echo " make down Stop all default services"
@echo " make down-foc Stop all services including FOC"
@echo " make logs Follow logs (docker compose logs -f)"
@echo " make restart Restart all containers"
@echo ""
Expand Down
3 changes: 1 addition & 2 deletions curio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN set -eux; \
cargo --version; \
rustc --version;


RUN git clone https://github.com/filecoin-project/curio.git /opt/curio
WORKDIR /opt/curio

Expand All @@ -60,7 +60,6 @@ RUN git submodule update --init
COPY ./go_exclude.txt ./go_exclude.txt

RUN go get github.com/antithesishq/antithesis-sdk-go@latest
RUN go get github.com/filecoin-project/go-jsonrpc@v0.8.0
RUN go install github.com/antithesishq/antithesis-sdk-go/tools/antithesis-go-instrumentor@latest
RUN go mod tidy

Expand Down
126 changes: 86 additions & 40 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ x-templates:
depends_on:
lotus1:
condition: service_healthy
needs_filwizard_healthy: &needs_filwizard_healthy
depends_on:
filwizard:
condition: service_healthy
healthcheck_settings: &healthcheck_settings
interval: 5s
timeout: 2s
Expand Down Expand Up @@ -84,75 +88,95 @@ services:
<<: *healthcheck_settings
test: curl --fail http://lotus1:1234/health/livez

lotus-miner0:
<<: [ *filecoin_service, *needs_lotus0_healthy ]
image: lotus:latest
container_name: lotus-miner0
entrypoint: [ "./scripts/start-lotus-miner.sh", "0" ]

lotus-miner1:
<<: [ *filecoin_service, *needs_lotus1_healthy ]
image: lotus:latest
container_name: lotus-miner1
entrypoint: [ "./scripts/start-lotus-miner.sh", "1" ]

forest0:
<<: [ *filecoin_service, *needs_lotus0_healthy ]
image: forest:latest
container_name: forest0
entrypoint: [ "./scripts/start-forest.sh", "0" ]

# Curio service
curio:
<<: [ *filecoin_service ]
image: curio:${CURIO_TAG:-latest}
container_name: curio
ports:
- "4433:443"
- "8080:80"
- "12300:12300"
- "4701:4701"
- "32100:32100"
entrypoint: [ "${CURIO_DATA_DIR}/curio-init.sh" ]
depends_on:
lotus0:
condition: service_healthy
yugabyte:
condition: service_started
workload:
condition: service_started

#Workload service
workload:
<<: [ *filecoin_service ]
image: workload:latest
container_name: workload
environment:
- STRESS_NODES=lotus0,lotus1,forest0
- STRESS_RPC_PORT=1234
- STRESS_FOREST_RPC_PORT=3456
- STRESS_KEYSTORE_PATH=/shared/configs/stress_keystore.json
- STRESS_WAIT_HEIGHT=10
- STRESS_WEIGHT_TRANSFER=2
- STRESS_WEIGHT_GAS_WAR=1
- STRESS_WEIGHT_ADVERSARIAL=2
- STRESS_WEIGHT_HEAVY_COMPUTE=3
- STRESS_WEIGHT_CHAIN_MONITOR=6
- STRESS_WEIGHT_DEPLOY=1
- STRESS_WEIGHT_CONTRACT_CALL=1
- STRESS_WEIGHT_SELFDESTRUCT=1
- STRESS_WEIGHT_CONTRACT_RACE=1
- STRESS_WEIGHT_GAS_GUZZLER=2
- STRESS_WEIGHT_LOG_BLASTER=2
- STRESS_WEIGHT_MEMORY_BOMB=1
- STRESS_WEIGHT_STORAGE_SPAM=2
- STRESS_WEIGHT_REORG=3
- STRESS_DEBUG=1
volumes:
- ./data/lotus0:${LOTUS_0_DATA_DIR}
- ./data/lotus1:${LOTUS_1_DATA_DIR}
- ./data/forest0:${FOREST_0_DATA_DIR}
- ./shared/configs:${SHARED_CONFIGS}
- ./data/curio:/var/lib/curio:rw
- ./shared/configs:/shared/configs
- ./shared:/shared
- ./data/lotus0:/root/devgen/lotus0
- ./data/lotus1:/root/devgen/lotus1
- ./data/forest0:/root/devgen/forest0
- ./data/curio:/root/devgen/curio

lotus-miner0:
<<: [ *filecoin_service, *needs_lotus0_healthy ]
image: lotus:latest
container_name: lotus-miner0
entrypoint: [ "./scripts/start-lotus-miner.sh", "0" ]

lotus-miner1:
<<: [ *filecoin_service, *needs_lotus1_healthy ]
image: lotus:latest
container_name: lotus-miner1
entrypoint: [ "./scripts/start-lotus-miner.sh", "1" ]

# ===========================================================================
# foc profile: Filecoin On-Chain Cloud services (filwizard + yugabyte + curio)
# Start with: docker compose --profile foc up -d
# ===========================================================================

# FilWizard: contract deployment + environment wiring
filwizard:
<<: [ *filecoin_service ]
image: filwizard:latest
container_name: filwizard
entrypoint: [ "/filwizard-entrypoint.sh" ]
volumes:
- ./shared/configs:/shared/configs
- ./data/lotus0:/shared/lotus0
- ./data/curio:/shared/curio
- ./shared:/shared
- ./filwizard/entrypoint.sh:/filwizard-entrypoint.sh
depends_on:
lotus0:
condition: service_healthy
healthcheck:
test: [ "CMD", "test", "-f", "/tmp/healthy" ]
interval: 5s
timeout: 2s
retries: 120
profiles: [ foc ]

# Yugabyte Database Service
yugabyte:
<<: [ *filecoin_service ]
image: yugabytedb/yugabyte:latest
container_name: yugabyte
init: true
# command: [ "bin/yugabyted", "start", "--base_dir=/home/yugabyte/yb_data", "--background=false", "--ui=false" ]
command: >
bash -lc '
bin/yugabyted start --base_dir=/home/yugabyte/yb_data --background=true --ui=false
tail -F \
/home/yugabyte/yb_data/data/yb-data/tserver/logs/yb-tserver.INFO
/home/yugabyte/yb_data/data/yb-data/tserver/logs/yb-tserver.INFO
'
ports:
- "5433:5433"
Expand All @@ -162,3 +186,25 @@ services:
- TINI_SUBREAPER=true
volumes:
- ./data/yugabyte:/home/yugabyte/yb_data
profiles: [ foc ]

# Curio service
curio:
<<: [ *filecoin_service ]
image: curio:${CURIO_TAG:-latest}
container_name: curio
ports:
- "4433:443"
- "8080:80"
- "12300:12300"
- "4701:4701"
- "32100:32100"
entrypoint: [ "${CURIO_DATA_DIR}/curio-init.sh" ]
depends_on:
lotus0:
condition: service_healthy
yugabyte:
condition: service_started
filwizard:
condition: service_started
profiles: [ foc ]
4 changes: 2 additions & 2 deletions forest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ ENV FIL_PROOFS_PARAMETER_CACHE="/var/tmp/filecoin-proof-parameters"
RUN forest-tool fetch-params --keys

# Step 7: Cache actor bundle
#ENV FOREST_ACTOR_BUNDLE_PATH="/var/tmp/forest_actor_bundle.car.zst"
#RUN forest-tool state-migration actor-bundle $FOREST_ACTOR_BUNDLE_PATH
ENV FOREST_ACTOR_BUNDLE_PATH="/var/tmp/forest_actor_bundle.car.zst"
RUN forest-tool state-migration actor-bundle $FOREST_ACTOR_BUNDLE_PATH

COPY scripts/start-forest.sh ./scripts/start-forest.sh

Expand Down
4 changes: 2 additions & 2 deletions forest/scripts/start-forest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if [ ! -f "${FOREST_DATA_DIR}/jwt" ]; then
--config "${FOREST_DATA_DIR}/forest_config.toml" \
--save-token "${FOREST_DATA_DIR}/jwt" \
--no-healthcheck \
--skip-load-actors \
--exit-after-init
else
echo "forest${no}: Node already initialized, skipping init..."
Expand All @@ -69,8 +70,7 @@ forest --genesis "${SHARED_CONFIGS}/devgen.car" \
--config "${FOREST_DATA_DIR}/forest_config.toml" \
--rpc-address "${host_ip}:${FOREST_RPC_PORT}" \
--p2p-listen-address "/ip4/${host_ip}/tcp/${FOREST_P2P_PORT}" \
--healthcheck-address "${host_ip}:${FOREST_HEALTHZ_RPC_PORT}" \
--skip-load-actors &
--healthcheck-address "${host_ip}:${FOREST_HEALTHZ_RPC_PORT}" &

# Admin token is required for connection commands and wallet management.
export TOKEN=$(cat "${FOREST_DATA_DIR}/jwt")
Expand Down
Loading