Add e2e script to the repo, Dockerfile, and a Nix flake with a NixOS module

- scripts/e2e.sh (+ scripts/e2e/*.ts): the two-node end-to-end test, now
  self-contained and cleaning up after itself; `make e2e`, part of `make check`
- Dockerfile/.dockerignore: static Go build in a non-root alpine image, data in
  /data, defaults to region u1j; `make docker`
- flake.nix, nix/: package (buildGoModule), dev shell, NixOS module
  services.allmende (hardened systemd unit that waits for `allmende-admin init`),
  and a NixOS VM test run by `nix flake check`
- README: running a node with Docker and NixOS

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 21:21:21 +01:00
co-authored by Claude Sonnet 5.5
parent dc690a72c9
commit 20ea9b32f7
13 changed files with 604 additions and 2 deletions
+8 -2
View File
@@ -3,7 +3,7 @@ REGION ?= u1j# Bonn; several are allowed: make run REGION="u1j u1h" (u1h is Colo
DATA ?=
FLAGS := $(if $(DATA),--data $(DATA))
.PHONY: help build run init test vet web web-test check clean
.PHONY: help build run init test vet web web-test e2e check clean docker
help: ## list the targets
@grep -E '^[a-z-]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf " %-10s %s\n", $$1, $$2}'
@@ -17,6 +17,9 @@ init: build ## create your identity (once): make init [DATA=dir]
run: build ## run a node (default region Bonn): make run [REGION=u1j] [DATA=dir]
$(BIN) run $(FLAGS) $(foreach r,$(REGION),--region $(r))
docker: ## build the container image (allmende:dev)
docker build -t allmende:dev .
vet: ## go vet
go vet ./...
@@ -29,7 +32,10 @@ web: ## rebuild web/dist after changing web/src (needs Node.js)
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
e2e: ## two real nodes end to end (needs Node.js and web/node_modules)
scripts/e2e.sh
check: vet test web-test e2e ## everything: vet, Go tests, web checks, end to end
clean: ## remove built binaries
rm -rf bin