-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (41 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
56 lines (41 loc) · 1.72 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
# Canopy node stack
SHELL := /bin/bash
# Load environment variables from .env if it exists
ifneq (,$(wildcard .env))
include .env
export
endif
NODE_COMPOSE := docker-compose.yml
MONITORING_COMPOSE := docker-compose.monitoring.yml
FULL_COMPOSE := docker compose -f $(NODE_COMPOSE) -f $(MONITORING_COMPOSE)
.PHONY: help hash-password up down restart logs status validate snapshot init-keys
help: ## Show available targets
@grep -hE '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf " %-16s %s\n", $$1, $$2}'
hash-password: ## Generate a bcrypt hash for AUTH_PASSWORDHASH (prompts for password)
@read -s -p "Password: " pw; echo; \
printf "AUTH_PASSWORDHASH="; \
docker run --rm -i caddy:2.10-alpine caddy hash-password -p "$$pw" | sed 's/\$$/\$$\$$/g'
@echo "Copy the exact line above into .env"
pull: ## Pull the latest canopynetwork/canopy image
$(FULL_COMPOSE) pull node
node-up: ## Start the node only (no monitoring)
docker compose -f $(NODE_COMPOSE) up -d node
up: ## Starts everything (node, monitoring, etc.)
$(FULL_COMPOSE) up -d
down: ## Stop everything
$(FULL_COMPOSE) --profile monitoring down
restart: ## Restart the nodes (reload config.json changes)
$(FULL_COMPOSE) restart node
logs: ## Tail node logs
docker compose -f $(NODE_COMPOSE) logs -f node --tail 200
status: ## Show container status
$(FULL_COMPOSE) ps
snapshot: ## Download mainnet snapshots into data/ (stops nodes first)
./scripts/snapshot.sh
snapshot-up: snapshot up ## Download mainnet snapshots into data/ and start nodes
gen-key: ## First-boot: generate validator key
@docker run --rm -it \
--entrypoint /bin/cli \
-v "$(CURDIR)/config:/app/config" \
canopynetwork/canopy:latest \
new-validator-key --data-dir /app/config