Skip to content

feat(beacon-relay): Rust v2 gateway skeleton — iteration 1 (health check)#103

Draft
aliXsed wants to merge 4 commits intomainfrom
aliX/rust-api-server
Draft

feat(beacon-relay): Rust v2 gateway skeleton — iteration 1 (health check)#103
aliXsed wants to merge 4 commits intomainfrom
aliX/rust-api-server

Conversation

@aliXsed
Copy link
Copy Markdown
Collaborator

@aliXsed aliXsed commented Mar 27, 2026

Summary

Introduces beacon-relay, the Rust-based v2 gateway for the Nodle DePIN network described in auth-design.md.

This is iteration 1: a minimal, production-grade scaffold serving a single health check endpoint. The structure is intentionally forward-compatible so future iterations can add BLE scan ingestion, device heartbeats, and authentication without restructuring.

What's in this PR

beacon-relay/ — Rust crate

Component Details
HTTP server axum 0.8 + tokio, GET /healthz{"status": "ok"}
Config Figment: config/default.toml + APP_ env vars (__ separator for nesting)
Tracing tracing + tracing-subscriber; pretty (dev) or json (prod) format
Shutdown Graceful on SIGTERM / SIGINT
Tests Integration tests: healthz 200 + unknown route 404

beacon-relay/AGENTS.md

Comprehensive AI agent standards for this crate: build commands, project structure, approved dependency table, coding standards.

.github/instructions/rust.instructions.md

Copilot path-scoped instructions applying to beacon-relay/**/*.rs and beacon-relay/Cargo.toml.

.github/workflows/beacon-relay-ci.yml

CI pipeline on every push touching beacon-relay/ and on PRs to main:

  • cargo build --locked
  • cargo test --locked
  • cargo clippy --locked -- -D warnings
  • cargo fmt --check
  • Swatinem/rust-cache@v2 for fast subsequent builds

Next iterations (not in this PR)

  • Device authentication middleware (JWT / on-chain lookup)
  • BLE scan data ingestion endpoint
  • Device heartbeat endpoint
  • Prometheus metrics (/metrics)

…dpoint

- axum 0.8 + tokio HTTP server serving GET /healthz -> {"status": "ok"}
- Figment-based config (TOML + APP_ env vars with __ separator for nesting)
- Structured tracing with pretty/JSON output modes
- Graceful shutdown on SIGTERM/SIGINT
- Integration tests: healthz 200 + unknown route 404
- AGENTS.md with Rust dev standards for AI agents
- .github/instructions/rust.instructions.md Copilot path instructions
- GitHub Actions CI: build, test, clippy, fmt check with Swatinem rust-cache
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

LCOV of commit d918397 during checks #633

Summary coverage rate:
  lines......: 32.4% (769 of 2372 lines)
  functions..: 28.7% (108 of 376 functions)
  branches...: 37.4% (139 of 372 branches)

Files changed coverage rate: n/a

aliXsed added 3 commits March 27, 2026 16:39
…n.md

- Add Rust/beacon-relay terms (clippy, serde, thiserror, healthz, etc.)
- Add crypto/protocol terms (CBOR, HMAC, SETNX, keypair, etc.)
- Add infra terms (Memorystore, Keymaster, Magisk, Frida, etc.)
- Add auth-design.md to repository
…c specification

- Delete root auth-design.md (moved to beacon-relay)
- Update AGENTS.md to reference new GATEWAY-SPEC.md in beacon-relay directory
- Specification is now focused on gateway implementation without legacy system comparisons
- Add GATEWAY-SPEC.md to .gitignore in beacon-relay (keep local only for now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant