1.6 KiB
1.6 KiB
SQ-009: Server Skeleton
Status: [ ] TODO
Blocked by: SQ-008
Priority: High
Description
Running sq-server binary with CLI, notmad lifecycle management, health gRPC endpoint, and Axum HTTP health endpoint. Follows the fungus-server pattern exactly.
Files to Create/Modify
crates/sq-server/src/main.rs- entry point with logging setupcrates/sq-server/src/cli.rs- clap Command enum with Serve subcommandcrates/sq-server/src/cli/serve.rs- ServeCommand with notmad buildercrates/sq-server/src/state.rs- State struct with Configcrates/sq-server/src/grpc/mod.rs- GrpcServer as notmad::Componentcrates/sq-server/src/grpc/health.rs- StatusService implcrates/sq-server/src/grpc/error.rs- gRPC error mappingcrates/sq-server/src/servehttp.rs- Axum health routes
Configuration
SQ_HOST=127.0.0.1:6060 # gRPC listen address
SQ_HTTP_HOST=127.0.0.1:6062 # HTTP listen address
SQ_DATA_DIR=./data # WAL storage directory
SQ_NODE_ID=node-1 # Unique node identifier
LOG_LEVEL=pretty # pretty|json|short
Acceptance Criteria
cargo run -p sq-server -- servestarts and listens on configured ports- gRPC Status RPC returns node_id
- HTTP GET / returns 200 with health message
- Graceful shutdown on SIGINT via notmad cancellation token
- Logging setup matches forest/fungus pattern (pretty/json/short)
Reference Files
/home/kjuulh/git/src.rawpotion.io/rawpotion/fungus/crates/fungus-server/src/cli/serve.rs/home/kjuulh/git/src.rawpotion.io/rawpotion/fungus/crates/fungus-server/src/state.rs