-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (79 loc) · 3.78 KB
/
Makefile
File metadata and controls
94 lines (79 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.PHONY: up down restart nuke restart-gui build logs dev dev-build dev-local wallet-cli nft-images-public pending-transactions list-utxos
ACCOUNT ?= 0
## Start all services
up:
docker compose up -d
## Stop and remove all containers (including optional profiles and orphaned run containers)
down:
docker compose --profile indexer --profile wallet_cli down --remove-orphans
## Full clean restart: tear down everything, fix stuck networks, then bring up fresh
## Fixes "Network still in use" / "network not found" errors from dangling containers.
restart: down
@# Disconnect any containers still clinging to the project network
@NETWORK=mintlayer-web-gui_default; \
CONTAINERS=$$(docker network inspect $$NETWORK --format '{{range .Containers}}{{.Name}} {{end}}' 2>/dev/null || true); \
if [ -n "$$CONTAINERS" ]; then \
echo "Disconnecting dangling containers from $$NETWORK: $$CONTAINERS"; \
for c in $$CONTAINERS; do docker network disconnect -f $$NETWORK $$c 2>/dev/null || true; done; \
fi
@# Remove the network if it still exists so Docker recreates it cleanly
@docker network rm mintlayer-web-gui_default 2>/dev/null || true
docker compose up -d
## Nuclear option: remove ALL stopped containers and unused networks project-wide,
## then restart. Use when restart still fails.
nuke:
docker compose --profile indexer --profile wallet_cli down --remove-orphans --volumes 2>/dev/null || true
docker container prune -f
docker network prune -f
docker compose up -d
## Rebuild and restart only the web-gui container
restart-gui:
docker compose up -d --build web-gui
## Rebuild all images without starting
build:
docker compose build
## Tail logs for all services (Ctrl+C to stop)
logs:
docker compose logs -f
## Start all services in dev mode with HMR (rebuilds web-gui image, includes indexer stack)
## Tears down existing containers first so you always start clean.
dev:
docker compose --profile indexer -f docker-compose.yml -f docker-compose.dev.yml down --remove-orphans 2>/dev/null || true
docker compose --profile indexer -f docker-compose.yml -f docker-compose.dev.yml up --build
## Like dev, but uses locally-built core images (run ./build-core-images.sh first)
dev-local:
docker compose --profile indexer -f docker-compose.yml -f docker-compose.dev.yml up
## Rebuild dev image only (run after adding npm packages, then re-run make dev)
dev-build:
docker compose --profile indexer -f docker-compose.yml -f docker-compose.dev.yml build web-gui
## Open an interactive wallet-cli session connected to the running wallet-rpc-daemon
wallet-cli:
docker compose --profile wallet_cli run --rm wallet-cli
## List pending transactions for account ACCOUNT (default 0) via wallet RPC.
## Usage: make pending-transactions or make pending-transactions ACCOUNT=1
pending-transactions:
docker run --rm \
--network web-gui_default \
-v "$(CURDIR)/tools:/tools:ro" \
-v "$(CURDIR)/.env:/.env:ro" \
-e WALLET_RPC_HOST=wallet-rpc-daemon \
alpine sh -c 'apk add -q bash curl jq >/dev/null && bash /tools/list-pending-transactions.sh $(ACCOUNT)'
## List UTXOs for account ACCOUNT (default 0) via wallet RPC.
## Usage: make list-utxos or make list-utxos ACCOUNT=1
list-utxos:
docker run --rm \
--network web-gui_default \
-v "$(CURDIR)/tools:/tools:ro" \
-v "$(CURDIR)/.env:/.env:ro" \
-e WALLET_RPC_HOST=wallet-rpc-daemon \
alpine sh -c 'apk add -q bash curl jq >/dev/null && bash /tools/list-utxos.sh $(ACCOUNT)'
## Ensure all NFT images stored on Pinata are publicly accessible.
## Runs inside Docker so it can reach wallet-rpc-daemon on the internal network.
nft-images-public:
docker run --rm \
--network mintlayer-web-gui_default \
-v "$(CURDIR)/tools:/tools:ro" \
-v "$(CURDIR)/.env:/.env:ro" \
-e WALLET_RPC_URL=http://wallet-rpc-daemon:3034 \
node:lts-alpine \
node /tools/make-nft-images-public.mjs