Skip to content

Commit b5bfa98

Browse files
committed
Makefile:
- "build" target was failing (circular dependency) - now it only checks that the network is not running docker-compose: - update to use the latest api image - use sha256 layers for all external images - set variables for external images to make it easier to use differnet versions
1 parent 37de848 commit b5bfa98

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ $(CHAINSTATE_DIR): /usr/bin/tar /usr/bin/zstd
3737
fi
3838

3939
# Boot the network from the local chainstate archive
40+
# up: check-not-running | $(CHAINSTATE_DIR)
4041
up: check-not-running | build $(CHAINSTATE_DIR)
4142
@echo "Starting $(PROJECT) network from chainstate archive"
4243
@echo " Chainstate Dir: $(CHAINSTATE_DIR)"
@@ -72,18 +73,18 @@ down: backup-logs current-chainstate-dir
7273
# if the network is in a weird state - this target will force kill (bypassing error checks)
7374
down-force:
7475
@echo "Force Shutting down $(PROJECT) network"
75-
$(eval ACTIVE_CHAINSTATE_DIR=$(shell cat .current-chainstate-dir))
7676
docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) down
7777
@if [ -f .current-chainstate-dir ]; then \
7878
rm -f .current-chainstate-dir
7979
fi
80+
sudo rm -rf ./docker/chainstate/*
8081

8182
# Build the images with a cache if present
82-
build: down
83+
build: check-not-running
8384
COMPOSE_BAKE=true PWD=$(PWD) docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) build
8485

8586
# Build the images without a cache (default uses cache)
86-
build-no-cache: down
87+
build-no-cache: check-not-running
8788
COMPOSE_BAKE=true PWD=$(PWD) docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) build --no-cache
8889

8990
# Stream specified service logs to STDOUT. does not validate if PARAMS is supplied
@@ -201,7 +202,6 @@ check-params: | check-running
201202

202203
# force stop and remove any existing chainstates (leaving all docker images/layers)
203204
clean: down-force
204-
sudo rm -rf ./docker/chainstate/*
205205

206206

207207
.PHONY: up genesis up-genesis down-genesis down down-force build build-no-cache log log-all backup-logs current-chainstate-dir snapshot pause unpause stop start restart stress test monitor check-not-running check-running check-params clean

docker/docker-compose.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ x-common-vars:
5353
- &BITCOIN_IP 10.0.0.250
5454
- &BITCOIN_MINER_IP 10.0.0.251
5555

56+
# External Docker Images
57+
- &IMAGE_STACKS_API hirosystems/stacks-blockchain-api:8.13.0@sha256:8352985823154b41d38abab07c95b5b469450760c902210b3280bf5e8170d5f3
58+
- &IMAGE_POSTGRES postgres:16.6-bookworm@sha256:c965017e1d29eb03e18a11abc25f5e3cd78cb5ac799d495922264b8489d5a3a1
59+
- &IMAGE_BITCOIN bitcoin/bitcoin:25.2@sha256:14b4777166cba8de36b62ce72801038760a8f490122781b66d40592c8c69ebda
60+
5661
# Bitcoin env vars
5762
- &BITCOIN_PEER_PORT 18444
5863
- &BITCOIN_RPC_PORT 18443
@@ -172,7 +177,8 @@ services:
172177
# --------------------
173178
bitcoin:
174179
container_name: bitcoin
175-
image: bitcoin/bitcoin:25.2
180+
# image: bitcoin/bitcoin:25.2
181+
image: *IMAGE_BITCOIN
176182
ports:
177183
- "127.0.0.1:18443:18443"
178184
- "127.0.0.1:18444:18444"
@@ -198,7 +204,8 @@ services:
198204

199205
bitcoin-miner:
200206
container_name: bitcoin-miner
201-
image: bitcoin/bitcoin:25.2
207+
# image: bitcoin/bitcoin:25.2
208+
image: *IMAGE_BITCOIN
202209
depends_on:
203210
bitcoin:
204211
condition: service_healthy
@@ -385,7 +392,8 @@ services:
385392
# Hiro API.
386393
# ------------------
387394
postgres:
388-
image: postgres:16.6-bookworm@sha256:c965017e1d29eb03e18a11abc25f5e3cd78cb5ac799d495922264b8489d5a3a1
395+
image: *IMAGE_POSTGRES
396+
# image: postgres:16.6-bookworm@sha256:c965017e1d29eb03e18a11abc25f5e3cd78cb5ac799d495922264b8489d5a3a1
389397
container_name: postgres
390398
stop_grace_period: 5s
391399
volumes:
@@ -405,7 +413,8 @@ services:
405413
ipv4_address: *POSTGRES_IP
406414

407415
stacks-api:
408-
image: hirosystems/stacks-blockchain-api:8.12.0
416+
# image: hirosystems/stacks-blockchain-api:8.12.0
417+
image: *IMAGE_STACKS_API
409418
container_name: stacks-api
410419
stop_grace_period: 5s
411420
ports:

0 commit comments

Comments
 (0)