Rename the binary to allmende, add a Makefile with Bonn as default region
- cmd/node -> cmd/allmende; usage, messages and docs use the new name - Makefile: build, init, run (REGION defaults to u1j, Bonn), vet, test, web, web-test, check, clean Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
BIN := bin/allmende
|
||||
REGION ?= u1j# Bonn; several are allowed: make run REGION="u1j u1h" (u1h is Cologne)
|
||||
DATA ?=
|
||||
FLAGS := $(if $(DATA),--data $(DATA))
|
||||
|
||||
.PHONY: help build run init test vet web web-test check clean
|
||||
|
||||
help: ## list the targets
|
||||
@grep -E '^[a-z-]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf " %-10s %s\n", $$1, $$2}'
|
||||
|
||||
build: ## build the node into bin/allmende (the UI is already embedded)
|
||||
go build -o $(BIN) ./cmd/allmende
|
||||
|
||||
init: build ## create your identity (once): make init [DATA=dir]
|
||||
$(BIN) init $(FLAGS)
|
||||
|
||||
run: build ## run a node (default region Bonn): make run [REGION=u1j] [DATA=dir]
|
||||
$(BIN) run $(FLAGS) $(foreach r,$(REGION),--region $(r))
|
||||
|
||||
vet: ## go vet
|
||||
go vet ./...
|
||||
|
||||
test: ## Go tests with the race detector
|
||||
go test -race ./...
|
||||
|
||||
web: ## rebuild web/dist after changing web/src (needs Node.js)
|
||||
cd web && npm ci && npm run build
|
||||
|
||||
web-test: ## type-check and test the web UI (needs Node.js)
|
||||
cd web && npm ci && npm run typecheck && npm test
|
||||
|
||||
check: vet test web-test ## everything: vet, Go tests, web checks
|
||||
|
||||
clean: ## remove built binaries
|
||||
rm -rf bin
|
||||
Reference in New Issue
Block a user