From 0ad1d381d7a3fb6763a64c76d066abdfa5cfb0d6 Mon Sep 17 00:00:00 2001 From: auricom <27022259+auricom@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:01:09 +0100 Subject: [PATCH 1/3] refactor: split justfile into imports --- .just/build.just | 145 +++++++++++++++++++ .just/dev.just | 147 +++++++++++++++++++ .just/gen.just | 53 +++++++ .just/help.just | 6 + justfile | 356 +---------------------------------------------- 5 files changed, 355 insertions(+), 352 deletions(-) create mode 100644 .just/build.just create mode 100644 .just/dev.just create mode 100644 .just/gen.just create mode 100644 .just/help.just diff --git a/.just/build.just b/.just/build.just new file mode 100644 index 000000000..cc277d84a --- /dev/null +++ b/.just/build.just @@ -0,0 +1,145 @@ +# Build + +# Build Testapp CLI +[group('build')] +build: + @echo "--> Building Testapp CLI" + @mkdir -p {{ build_dir }} + @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp . + @echo "--> Testapp CLI Built!" + @echo " Check the version with: build/testapp version" + @echo " Check the binary with: {{ build_dir }}/testapp" + +# Install Testapp CLI to Go bin directory +[group('build')] +install: + @echo "--> Installing Testapp CLI" + @cd apps/testapp && go install -ldflags "{{ ldflags }}" . + @echo "--> Testapp CLI Installed!" + @echo " Check the version with: testapp version" + @echo " Check the binary with: which testapp" + +# Build all ev-node binaries +[group('build')] +build-all: + @echo "--> Building all ev-node binaries" + @mkdir -p {{ build_dir }} + @echo "--> Building testapp" + @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp . + @echo "--> Building evm" + @cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm . + @echo "--> Building local-da" + @cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da . + @echo "--> All ev-node binaries built!" + +# Build Testapp Bench +[group('build')] +build-testapp-bench: + @echo "--> Building Testapp Bench" + @mkdir -p {{ build_dir }} + @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp-bench ./kv/bench + @echo " Check the binary with: {{ build_dir }}/testapp-bench" + +# Build EVM binary +[group('build')] +build-evm: + @echo "--> Building EVM" + @mkdir -p {{ build_dir }} + @cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm . + @echo " Check the binary with: {{ build_dir }}/evm" + +# Build local-da binary +[group('build')] +build-da: + @echo "--> Building local-da" + @mkdir -p {{ build_dir }} + @cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da . + @echo " Check the binary with: {{ build_dir }}/local-da" + +# Build Docker image for local testing +[group('build')] +docker-build: + @echo "--> Building Docker image for local testing" + @docker build -t evstack:local-dev -f apps/testapp/Dockerfile . + @echo "--> Docker image built: evstack:local-dev" + @echo "--> Checking if image exists locally..." + @docker images evstack:local-dev + +# Clean build artifacts +[group('build')] +clean: + @echo "--> Cleaning build directory" + @rm -rf {{ build_dir }} + @echo "--> Build directory cleaned!" + +# Tools + +# Build da-debug tool +[group('tools')] +build-tool-da-debug: + @echo "--> Building da-debug tool" + @mkdir -p {{ build_dir }} + @cd tools/da-debug && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/da-debug . + @echo "--> da-debug built: {{ build_dir }}/da-debug" + +# Build blob-decoder tool +[group('tools')] +build-tool-blob-decoder: + @echo "--> Building blob-decoder tool" + @mkdir -p {{ build_dir }} + @cd tools/blob-decoder && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/blob-decoder . + @echo "--> blob-decoder built: {{ build_dir }}/blob-decoder" + +# Build cache-analyzer tool +[group('tools')] +build-tool-cache-analyzer: + @echo "--> Building cache-analyzer tool" + @mkdir -p {{ build_dir }} + @cd tools/cache-analyzer && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/cache-analyzer . + @echo "--> cache-analyzer built: {{ build_dir }}/cache-analyzer" + +# Build all tools +[group('tools')] +build-tools: build-tool-da-debug build-tool-blob-decoder build-tool-cache-analyzer + @echo "--> All tools built successfully!" + +# Install da-debug tool to Go bin +[group('tools')] +install-tool-da-debug: + @echo "--> Installing da-debug tool" + @cd tools/da-debug && go install -ldflags "{{ tool_ldflags }}" . + @echo "--> da-debug installed to Go bin" + +# Install blob-decoder tool to Go bin +[group('tools')] +install-tool-blob-decoder: + @echo "--> Installing blob-decoder tool" + @cd tools/blob-decoder && go install -ldflags "{{ tool_ldflags }}" . + @echo "--> blob-decoder installed to Go bin" + +# Install cache-analyzer tool to Go bin +[group('tools')] +install-tool-cache-analyzer: + @echo "--> Installing cache-analyzer tool" + @cd tools/cache-analyzer && go install -ldflags "{{ tool_ldflags }}" . + @echo "--> cache-analyzer installed to Go bin" + +# Install all tools to Go bin +[group('tools')] +install-tools: install-tool-da-debug install-tool-blob-decoder install-tool-cache-analyzer + @echo "--> All tools installed successfully!" + +# Remove built tool binaries +[group('tools')] +clean-tools: + @echo "--> Cleaning built tools" + @rm -f {{ build_dir }}/da-debug {{ build_dir }}/blob-decoder {{ build_dir }}/cache-analyzer + @echo "--> Tools cleaned" + +# List available tools +[group('tools')] +list-tools: + @echo "Available tools:" + @echo " - da-debug" + @echo " - blob-decoder" + @echo " - cache-analyzer" diff --git a/.just/dev.just b/.just/dev.just new file mode 100644 index 000000000..8eab970c1 --- /dev/null +++ b/.just/dev.just @@ -0,0 +1,147 @@ +# Testing + +# Clear test cache +[group('test')] +clean-testcache: + @echo "--> Clearing testcache" + @go clean --testcache + +# Run unit tests for all go.mods +[group('test')] +test: + @echo "--> Running unit tests" + @go run -tags='run integration' scripts/test.go + +# Run all tests including Docker E2E +[group('test')] +test-all: test test-docker-e2e + @echo "--> All tests completed" + +# Run integration tests +[group('test')] +test-integration: + @echo "--> Running integration tests" + @cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' ./... + +# Run e2e tests +[group('test')] +test-e2e: build build-da build-evm docker-build-if-local + @echo "--> Running e2e tests" + @cd test/e2e && go test -mod=readonly -failfast -timeout=15m -tags='e2e evm' ./... --binary=../../build/testapp --evm-binary=../../build/evm + +# Run integration tests with coverage +[group('test')] +test-integration-cover: + @echo "--> Running integration tests with coverage" + @cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' -coverprofile=coverage.txt -covermode=atomic ./... + +# Generate code coverage report +[group('test')] +test-cover: + @echo "--> Running unit tests" + @go run -tags=cover -race scripts/test_cover.go + +# Run micro-benchmarks for internal cache +[group('test')] +bench: + @echo "--> Running internal cache benchmarks" + @go test -bench=. -benchmem -run='^$' ./block/internal/cache + +# Run EVM tests +[group('test')] +test-evm: + @echo "--> Running EVM tests" + @cd execution/evm/test && go test -mod=readonly -failfast -timeout=15m ./... -tags=evm + +# Run Docker E2E tests +[group('test')] +test-docker-e2e: docker-build-if-local + @echo "--> Running Docker E2E tests" + @echo "--> Verifying Docker image exists locally..." + @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "ev-node" ]; then \ + echo "--> Verifying Docker image exists locally..."; \ + docker image inspect evstack:local-dev >/dev/null 2>&1 || (echo "ERROR: evstack:local-dev image not found. Run 'just docker-build' first." && exit 1); \ + fi + @cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e' -timeout=30m ./... + @just docker-cleanup-if-local + +# Run Docker E2E Upgrade tests +[group('test')] +test-docker-upgrade-e2e: + @echo "--> Running Docker Upgrade E2E tests" + @cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e evm' -timeout=30m -run '^TestEVMSingleUpgradeSuite$$/^TestEVMSingleUpgrade$$' ./... + +# Run Docker E2E cross-version compatibility tests +[group('test')] +test-docker-compat: + @echo "--> Running Docker Sync Compatibility E2E tests" + @cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e evm' -timeout=30m -run '^TestEVMCompatSuite$$/^TestCrossVersionSync$$' ./... + +# Build Docker image if using local repository +[group('test')] +docker-build-if-local: + @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \ + if docker image inspect evstack:local-dev >/dev/null 2>&1; then \ + echo "--> Found local Docker image: evstack:local-dev (skipping build)"; \ + else \ + echo "--> Local repository detected, building Docker image..."; \ + just docker-build; \ + fi; \ + else \ + echo "--> Using remote repository: ${EV_NODE_IMAGE_REPO}"; \ + fi + +# Clean up local Docker image if using local repository +[group('test')] +docker-cleanup-if-local: + @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \ + echo "--> Untagging local Docker image (preserving layers for faster rebuilds)..."; \ + docker rmi evstack:local-dev --no-prune 2>/dev/null || echo "Image evstack:local-dev not found or already removed"; \ + else \ + echo "--> Using remote repository, no cleanup needed"; \ + fi + +# Lint + +# Run all linters +[group('lint')] +lint: vet + @echo "--> Running golangci-lint" + @golangci-lint run + @echo "--> Running markdownlint" + @markdownlint --config .markdownlint.yaml '**/*.md' + @echo "--> Running hadolint" + @hadolint test/docker/mockserv.Dockerfile + @echo "--> Running yamllint" + @yamllint --no-warnings . -c .yamllint.yml + @echo "--> Running goreleaser check" + @goreleaser check + @echo "--> Running actionlint" + @actionlint + +# Auto-fix linting issues +[group('lint')] +lint-fix: + @echo "--> Formatting go" + @golangci-lint run --fix + @echo "--> Formatting markdownlint" + @markdownlint --config .markdownlint.yaml --ignore './changelog.md' '**/*.md' -f + +# Run go vet +[group('lint')] +vet: + @echo "--> Running go vet" + @go vet ./... + +# Run + +# Run 'n' nodes (default: 1). Usage: just run-n 3 +[group('run')] +run-n nodes="1": build build-da + @go run -tags=run scripts/run.go --nodes={{ nodes }} + +# Run EVM nodes (one sequencer and one full node) +[group('run')] +run-evm-nodes nodes="1": build-da build-evm + @echo "Starting EVM nodes..." + @go run -tags=run_evm scripts/run-evm-nodes.go --nodes={{ nodes }} diff --git a/.just/gen.just b/.just/gen.just new file mode 100644 index 000000000..e66435c04 --- /dev/null +++ b/.just/gen.just @@ -0,0 +1,53 @@ +# Protobuf + +# Generate protobuf files +[group('proto')] +proto-gen: + @echo "--> Generating Protobuf files" + buf generate --path="./proto/evnode" --template="buf.gen.yaml" --config="buf.yaml" + buf generate --path="./proto/execution/evm" --template="buf.gen.evm.yaml" --config="buf.yaml" + +# Lint protobuf files (requires Docker) +[group('proto')] +proto-lint: + @echo "--> Linting Protobuf files" + @docker run --rm -v {{ justfile_directory() }}:/workspace --workdir /workspace bufbuild/buf:latest lint --error-format=json + +# Generate Rust protobuf files +[group('proto')] +rust-proto-gen: + @echo "--> Generating Rust protobuf files" + @cd client/crates/types && EV_TYPES_FORCE_PROTO_GEN=1 cargo build + +# Check if Rust protobuf files are up to date +[group('proto')] +rust-proto-check: + @echo "--> Checking Rust protobuf files" + @rm -rf client/crates/types/src/proto/*.rs + @cd client/crates/types && cargo build + @if ! git diff --exit-code client/crates/types/src/proto/; then \ + echo "Error: Generated Rust proto files are not up to date."; \ + echo "Run 'just rust-proto-gen' and commit the changes."; \ + exit 1; \ + fi + +# Codegen + +# Generate mocks +[group('codegen')] +mock-gen: + @echo "-> Generating mocks" + go run github.com/vektra/mockery/v3@latest + +# Install dependencies and tidy all modules +[group('codegen')] +deps: + @echo "--> Installing dependencies" + @go mod download + @go mod tidy + @go run scripts/tidy.go + +# Tidy all go.mod files +[group('codegen')] +tidy-all: + @go run -tags=tidy scripts/tidy.go diff --git a/.just/help.just b/.just/help.just new file mode 100644 index 000000000..69f883db3 --- /dev/null +++ b/.just/help.just @@ -0,0 +1,6 @@ +# Help + +# List available recipes when running `just` with no args +[group('help')] +default: + @just --list --unsorted diff --git a/justfile b/justfile index 95fd007c6..d74306d5d 100644 --- a/justfile +++ b/justfile @@ -11,355 +11,7 @@ tool_ldflags := "-X main.Version=" + version + " -X main.GitSHA=" + gitsha # Build directory build_dir := justfile_directory() / "build" -# List available recipes when running `just` with no args -[group('help')] -default: - @just --list --unsorted - -# ─── Build ──────────────────────────────────────────────────────────────────── - -# Build Testapp CLI -[group('build')] -build: - @echo "--> Building Testapp CLI" - @mkdir -p {{ build_dir }} - @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp . - @echo "--> Testapp CLI Built!" - @echo " Check the version with: build/testapp version" - @echo " Check the binary with: {{ build_dir }}/testapp" - -# Install Testapp CLI to Go bin directory -[group('build')] -install: - @echo "--> Installing Testapp CLI" - @cd apps/testapp && go install -ldflags "{{ ldflags }}" . - @echo "--> Testapp CLI Installed!" - @echo " Check the version with: testapp version" - @echo " Check the binary with: which testapp" - -# Build all ev-node binaries -[group('build')] -build-all: - @echo "--> Building all ev-node binaries" - @mkdir -p {{ build_dir }} - @echo "--> Building testapp" - @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp . - @echo "--> Building evm" - @cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm . - @echo "--> Building local-da" - @cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da . - @echo "--> All ev-node binaries built!" - -# Build Testapp Bench -[group('build')] -build-testapp-bench: - @echo "--> Building Testapp Bench" - @mkdir -p {{ build_dir }} - @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp-bench ./kv/bench - @echo " Check the binary with: {{ build_dir }}/testapp-bench" - -# Build EVM binary -[group('build')] -build-evm: - @echo "--> Building EVM" - @mkdir -p {{ build_dir }} - @cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm . - @echo " Check the binary with: {{ build_dir }}/evm" - -# Build local-da binary -[group('build')] -build-da: - @echo "--> Building local-da" - @mkdir -p {{ build_dir }} - @cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da . - @echo " Check the binary with: {{ build_dir }}/local-da" - -# Build Docker image for local testing -[group('build')] -docker-build: - @echo "--> Building Docker image for local testing" - @docker build -t evstack:local-dev -f apps/testapp/Dockerfile . - @echo "--> Docker image built: evstack:local-dev" - @echo "--> Checking if image exists locally..." - @docker images evstack:local-dev - -# Clean build artifacts -[group('build')] -clean: - @echo "--> Cleaning build directory" - @rm -rf {{ build_dir }} - @echo "--> Build directory cleaned!" - -# ─── Testing ────────────────────────────────────────────────────────────────── - -# Clear test cache -[group('test')] -clean-testcache: - @echo "--> Clearing testcache" - @go clean --testcache - -# Run unit tests for all go.mods -[group('test')] -test: - @echo "--> Running unit tests" - @go run -tags='run integration' scripts/test.go - -# Run all tests including Docker E2E -[group('test')] -test-all: test test-docker-e2e - @echo "--> All tests completed" - -# Run integration tests -[group('test')] -test-integration: - @echo "--> Running integration tests" - @cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' ./... - -# Run e2e tests -[group('test')] -test-e2e: build build-da build-evm docker-build-if-local - @echo "--> Running e2e tests" - @cd test/e2e && go test -mod=readonly -failfast -timeout=15m -tags='e2e evm' ./... --binary=../../build/testapp --evm-binary=../../build/evm - -# Run integration tests with coverage -[group('test')] -test-integration-cover: - @echo "--> Running integration tests with coverage" - @cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' -coverprofile=coverage.txt -covermode=atomic ./... - -# Generate code coverage report -[group('test')] -test-cover: - @echo "--> Running unit tests" - @go run -tags=cover -race scripts/test_cover.go - -# Run micro-benchmarks for internal cache -[group('test')] -bench: - @echo "--> Running internal cache benchmarks" - @go test -bench=. -benchmem -run='^$' ./block/internal/cache - -# Run EVM tests -[group('test')] -test-evm: - @echo "--> Running EVM tests" - @cd execution/evm/test && go test -mod=readonly -failfast -timeout=15m ./... -tags=evm - -# Run Docker E2E tests -[group('test')] -test-docker-e2e: docker-build-if-local - @echo "--> Running Docker E2E tests" - @echo "--> Verifying Docker image exists locally..." - @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "ev-node" ]; then \ - echo "--> Verifying Docker image exists locally..."; \ - docker image inspect evstack:local-dev >/dev/null 2>&1 || (echo "ERROR: evstack:local-dev image not found. Run 'just docker-build' first." && exit 1); \ - fi - @cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e' -timeout=30m ./... - @just docker-cleanup-if-local - -# Run Docker E2E Upgrade tests -[group('test')] -test-docker-upgrade-e2e: - @echo "--> Running Docker Upgrade E2E tests" - @cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e evm' -timeout=30m -run '^TestEVMSingleUpgradeSuite$$/^TestEVMSingleUpgrade$$' ./... - -# Run Docker E2E cross-version compatibility tests -[group('test')] -test-docker-compat: - @echo "--> Running Docker Sync Compatibility E2E tests" - @cd test/docker-e2e && go test -mod=readonly -failfast -v -tags='docker_e2e evm' -timeout=30m -run '^TestEVMCompatSuite$$/^TestCrossVersionSync$$' ./... - -# Build Docker image if using local repository -[group('test')] -docker-build-if-local: - @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \ - if docker image inspect evstack:local-dev >/dev/null 2>&1; then \ - echo "--> Found local Docker image: evstack:local-dev (skipping build)"; \ - else \ - echo "--> Local repository detected, building Docker image..."; \ - just docker-build; \ - fi; \ - else \ - echo "--> Using remote repository: ${EV_NODE_IMAGE_REPO}"; \ - fi - -# Clean up local Docker image if using local repository -[group('test')] -docker-cleanup-if-local: - @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \ - echo "--> Untagging local Docker image (preserving layers for faster rebuilds)..."; \ - docker rmi evstack:local-dev --no-prune 2>/dev/null || echo "Image evstack:local-dev not found or already removed"; \ - else \ - echo "--> Using remote repository, no cleanup needed"; \ - fi - -# ─── Protobuf ───────────────────────────────────────────────────────────────── - -# Generate protobuf files -[group('proto')] -proto-gen: - @echo "--> Generating Protobuf files" - buf generate --path="./proto/evnode" --template="buf.gen.yaml" --config="buf.yaml" - buf generate --path="./proto/execution/evm" --template="buf.gen.evm.yaml" --config="buf.yaml" - -# Lint protobuf files (requires Docker) -[group('proto')] -proto-lint: - @echo "--> Linting Protobuf files" - @docker run --rm -v {{ justfile_directory() }}:/workspace --workdir /workspace bufbuild/buf:latest lint --error-format=json - -# Generate Rust protobuf files -[group('proto')] -rust-proto-gen: - @echo "--> Generating Rust protobuf files" - @cd client/crates/types && EV_TYPES_FORCE_PROTO_GEN=1 cargo build - -# Check if Rust protobuf files are up to date -[group('proto')] -rust-proto-check: - @echo "--> Checking Rust protobuf files" - @rm -rf client/crates/types/src/proto/*.rs - @cd client/crates/types && cargo build - @if ! git diff --exit-code client/crates/types/src/proto/; then \ - echo "Error: Generated Rust proto files are not up to date."; \ - echo "Run 'just rust-proto-gen' and commit the changes."; \ - exit 1; \ - fi - -# ─── Lint ────────────────────────────────────────────────────────────────────── - -# Run all linters -[group('lint')] -lint: vet - @echo "--> Running golangci-lint" - @golangci-lint run - @echo "--> Running markdownlint" - @markdownlint --config .markdownlint.yaml '**/*.md' - @echo "--> Running hadolint" - @hadolint test/docker/mockserv.Dockerfile - @echo "--> Running yamllint" - @yamllint --no-warnings . -c .yamllint.yml - @echo "--> Running goreleaser check" - @goreleaser check - @echo "--> Running actionlint" - @actionlint - -# Auto-fix linting issues -[group('lint')] -lint-fix: - @echo "--> Formatting go" - @golangci-lint run --fix - @echo "--> Formatting markdownlint" - @markdownlint --config .markdownlint.yaml --ignore './changelog.md' '**/*.md' -f - -# Run go vet -[group('lint')] -vet: - @echo "--> Running go vet" - @go vet ./... - -# ─── Codegen ────────────────────────────────────────────────────────────────── - -# Generate mocks -[group('codegen')] -mock-gen: - @echo "-> Generating mocks" - go run github.com/vektra/mockery/v3@latest - -# Install dependencies and tidy all modules -[group('codegen')] -deps: - @echo "--> Installing dependencies" - @go mod download - @go mod tidy - @go run scripts/tidy.go - -# Tidy all go.mod files -[group('codegen')] -tidy-all: - @go run -tags=tidy scripts/tidy.go - -# ─── Run ────────────────────────────────────────────────────────────────────── - -# Run 'n' nodes (default: 1). Usage: just run-n 3 -[group('run')] -run-n nodes="1": build build-da - @go run -tags=run scripts/run.go --nodes={{ nodes }} - -# Run EVM nodes (one sequencer and one full node) -[group('run')] -run-evm-nodes nodes="1": build-da build-evm - @echo "Starting EVM nodes..." - @go run -tags=run_evm scripts/run-evm-nodes.go --nodes={{ nodes }} - -# ─── Tools ───────────────────────────────────────────────────────────────────── - -# Build da-debug tool -[group('tools')] -build-tool-da-debug: - @echo "--> Building da-debug tool" - @mkdir -p {{ build_dir }} - @cd tools/da-debug && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/da-debug . - @echo "--> da-debug built: {{ build_dir }}/da-debug" - -# Build blob-decoder tool -[group('tools')] -build-tool-blob-decoder: - @echo "--> Building blob-decoder tool" - @mkdir -p {{ build_dir }} - @cd tools/blob-decoder && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/blob-decoder . - @echo "--> blob-decoder built: {{ build_dir }}/blob-decoder" - -# Build cache-analyzer tool -[group('tools')] -build-tool-cache-analyzer: - @echo "--> Building cache-analyzer tool" - @mkdir -p {{ build_dir }} - @cd tools/cache-analyzer && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/cache-analyzer . - @echo "--> cache-analyzer built: {{ build_dir }}/cache-analyzer" - -# Build all tools -[group('tools')] -build-tools: build-tool-da-debug build-tool-blob-decoder build-tool-cache-analyzer - @echo "--> All tools built successfully!" - -# Install da-debug tool to Go bin -[group('tools')] -install-tool-da-debug: - @echo "--> Installing da-debug tool" - @cd tools/da-debug && go install -ldflags "{{ tool_ldflags }}" . - @echo "--> da-debug installed to Go bin" - -# Install blob-decoder tool to Go bin -[group('tools')] -install-tool-blob-decoder: - @echo "--> Installing blob-decoder tool" - @cd tools/blob-decoder && go install -ldflags "{{ tool_ldflags }}" . - @echo "--> blob-decoder installed to Go bin" - -# Install cache-analyzer tool to Go bin -[group('tools')] -install-tool-cache-analyzer: - @echo "--> Installing cache-analyzer tool" - @cd tools/cache-analyzer && go install -ldflags "{{ tool_ldflags }}" . - @echo "--> cache-analyzer installed to Go bin" - -# Install all tools to Go bin -[group('tools')] -install-tools: install-tool-da-debug install-tool-blob-decoder install-tool-cache-analyzer - @echo "--> All tools installed successfully!" - -# Remove built tool binaries -[group('tools')] -clean-tools: - @echo "--> Cleaning built tools" - @rm -f {{ build_dir }}/da-debug {{ build_dir }}/blob-decoder {{ build_dir }}/cache-analyzer - @echo "--> Tools cleaned" - -# List available tools -[group('tools')] -list-tools: - @echo "Available tools:" - @echo " - da-debug" - @echo " - blob-decoder" - @echo " - cache-analyzer" +import '.just/help.just' +import '.just/build.just' +import '.just/dev.just' +import '.just/gen.just' From 124627ccfd7e7d82e58659a13096e139ac527704 Mon Sep 17 00:00:00 2001 From: auricom <27022259+auricom@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:02:04 +0100 Subject: [PATCH 2/3] refactor: add helper recipes --- .just/build.just | 56 +++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/.just/build.just b/.just/build.just index cc277d84a..d848e57f1 100644 --- a/.just/build.just +++ b/.just/build.just @@ -1,11 +1,30 @@ # Build +# Helpers + +[private] +_build_go dir out pkg: + @mkdir -p {{ build_dir }} + @cd {{ dir }} && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/{{ out }} {{ pkg }} + +[private] +_install_go dir: + @cd {{ dir }} && go install -ldflags "{{ ldflags }}" . + +[private] +_build_tool dir out: + @mkdir -p {{ build_dir }} + @cd {{ dir }} && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/{{ out }} . + +[private] +_install_tool dir: + @cd {{ dir }} && go install -ldflags "{{ tool_ldflags }}" . + # Build Testapp CLI [group('build')] build: @echo "--> Building Testapp CLI" - @mkdir -p {{ build_dir }} - @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp . + @just _build_go "apps/testapp" "testapp" "." @echo "--> Testapp CLI Built!" @echo " Check the version with: build/testapp version" @echo " Check the binary with: {{ build_dir }}/testapp" @@ -14,7 +33,7 @@ build: [group('build')] install: @echo "--> Installing Testapp CLI" - @cd apps/testapp && go install -ldflags "{{ ldflags }}" . + @just _install_go "apps/testapp" @echo "--> Testapp CLI Installed!" @echo " Check the version with: testapp version" @echo " Check the binary with: which testapp" @@ -23,37 +42,33 @@ install: [group('build')] build-all: @echo "--> Building all ev-node binaries" - @mkdir -p {{ build_dir }} @echo "--> Building testapp" - @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp . + @just _build_go "apps/testapp" "testapp" "." @echo "--> Building evm" - @cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm . + @just _build_go "apps/evm" "evm" "." @echo "--> Building local-da" - @cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da . + @just _build_go "tools/local-da" "local-da" "." @echo "--> All ev-node binaries built!" # Build Testapp Bench [group('build')] build-testapp-bench: @echo "--> Building Testapp Bench" - @mkdir -p {{ build_dir }} - @cd apps/testapp && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/testapp-bench ./kv/bench + @just _build_go "apps/testapp" "testapp-bench" "./kv/bench" @echo " Check the binary with: {{ build_dir }}/testapp-bench" # Build EVM binary [group('build')] build-evm: @echo "--> Building EVM" - @mkdir -p {{ build_dir }} - @cd apps/evm && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/evm . + @just _build_go "apps/evm" "evm" "." @echo " Check the binary with: {{ build_dir }}/evm" # Build local-da binary [group('build')] build-da: @echo "--> Building local-da" - @mkdir -p {{ build_dir }} - @cd tools/local-da && go build -ldflags "{{ ldflags }}" -o {{ build_dir }}/local-da . + @just _build_go "tools/local-da" "local-da" "." @echo " Check the binary with: {{ build_dir }}/local-da" # Build Docker image for local testing @@ -78,24 +93,21 @@ clean: [group('tools')] build-tool-da-debug: @echo "--> Building da-debug tool" - @mkdir -p {{ build_dir }} - @cd tools/da-debug && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/da-debug . + @just _build_tool "tools/da-debug" "da-debug" @echo "--> da-debug built: {{ build_dir }}/da-debug" # Build blob-decoder tool [group('tools')] build-tool-blob-decoder: @echo "--> Building blob-decoder tool" - @mkdir -p {{ build_dir }} - @cd tools/blob-decoder && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/blob-decoder . + @just _build_tool "tools/blob-decoder" "blob-decoder" @echo "--> blob-decoder built: {{ build_dir }}/blob-decoder" # Build cache-analyzer tool [group('tools')] build-tool-cache-analyzer: @echo "--> Building cache-analyzer tool" - @mkdir -p {{ build_dir }} - @cd tools/cache-analyzer && go build -ldflags "{{ tool_ldflags }}" -o {{ build_dir }}/cache-analyzer . + @just _build_tool "tools/cache-analyzer" "cache-analyzer" @echo "--> cache-analyzer built: {{ build_dir }}/cache-analyzer" # Build all tools @@ -107,21 +119,21 @@ build-tools: build-tool-da-debug build-tool-blob-decoder build-tool-cache-analyz [group('tools')] install-tool-da-debug: @echo "--> Installing da-debug tool" - @cd tools/da-debug && go install -ldflags "{{ tool_ldflags }}" . + @just _install_tool "tools/da-debug" @echo "--> da-debug installed to Go bin" # Install blob-decoder tool to Go bin [group('tools')] install-tool-blob-decoder: @echo "--> Installing blob-decoder tool" - @cd tools/blob-decoder && go install -ldflags "{{ tool_ldflags }}" . + @just _install_tool "tools/blob-decoder" @echo "--> blob-decoder installed to Go bin" # Install cache-analyzer tool to Go bin [group('tools')] install-tool-cache-analyzer: @echo "--> Installing cache-analyzer tool" - @cd tools/cache-analyzer && go install -ldflags "{{ tool_ldflags }}" . + @just _install_tool "tools/cache-analyzer" @echo "--> cache-analyzer installed to Go bin" # Install all tools to Go bin From b3e2e328730292e69ddfa3e828f0879a60cc4271 Mon Sep 17 00:00:00 2001 From: auricom <27022259+auricom@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:02:15 +0100 Subject: [PATCH 3/3] fix: normalize EV_NODE_IMAGE_REPO default --- .just/dev.just | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.just/dev.just b/.just/dev.just index 8eab970c1..31d470d53 100644 --- a/.just/dev.just +++ b/.just/dev.just @@ -58,7 +58,7 @@ test-evm: test-docker-e2e: docker-build-if-local @echo "--> Running Docker E2E tests" @echo "--> Verifying Docker image exists locally..." - @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "ev-node" ]; then \ + @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \ echo "--> Verifying Docker image exists locally..."; \ docker image inspect evstack:local-dev >/dev/null 2>&1 || (echo "ERROR: evstack:local-dev image not found. Run 'just docker-build' first." && exit 1); \ fi