Expand description
§Guts Node
Decentralized code collaboration node library.
This crate provides the core functionality for running a Guts node, including HTTP API endpoints, P2P networking, and integration with storage, collaboration, and authentication subsystems.
§Architecture
A Guts node consists of several integrated components:
┌─────────────────────────────────────────────────────────────┐
│ Guts Node │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ HTTP API Layer │ │
│ │ • Git Smart HTTP (clone, push, pull) │ │
│ │ • Repository Management (CRUD) │ │
│ │ • Collaboration API (PRs, Issues, Reviews) │ │
│ │ • Auth API (Orgs, Teams, Permissions, Webhooks) │ │
│ │ • Web Gateway (HTML views) │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ P2P Network Layer │ │
│ │ • Node Discovery and Connection │ │
│ │ • Repository Replication │ │
│ │ • Collaboration Data Sync │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Storage Layer │ │
│ │ • Git Object Store (blobs, trees, commits) │ │
│ │ • Reference Store (branches, tags) │ │
│ │ • Collaboration Store (PRs, Issues) │ │
│ │ • Auth Store (Orgs, Teams, Permissions) │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘§Quick Start
To run a node:
cargo run --bin guts-node -- --api-addr 127.0.0.1:8080§Modules
api- Core HTTP API and Git Smart HTTP protocolauth_api- Authorization endpoints (Organizations, Teams, Permissions)collaboration_api- Collaboration endpoints (PRs, Issues, Comments)realtime_api- Real-time WebSocket API for live updatesconfig- Node configuration managementp2p- Peer-to-peer networking and replicationobservability- Structured logging, metrics, and request tracingvalidation- Input validation middlewarehealth- Health check endpoints (liveness, readiness, startup)resilience- Retry policies, circuit breakers, and timeoutsperformance- Connection pooling, request coalescing, CDN cache headers
§Example: Creating an AppState
use std::sync::Arc;
use guts_storage::RepoStore;
use guts_collaboration::CollaborationStore;
use guts_auth::AuthStore;
use guts_realtime::EventHub;
use guts_ci::CiStore;
use guts_compat::CompatStore;
use guts_node::api::AppState;
// Create stores
let repos = Arc::new(RepoStore::new());
let collaboration = Arc::new(CollaborationStore::new());
let auth = Arc::new(AuthStore::new());
let realtime = Arc::new(EventHub::new());
let ci = Arc::new(CiStore::new());
let compat = Arc::new(CompatStore::new());
// Create application state
let state = AppState {
repos,
p2p: None, // Optional P2P manager
consensus: None, // Optional consensus engine
mempool: None, // Optional transaction mempool
collaboration,
auth,
realtime,
ci,
compat,
};Modules§
- api
- Core HTTP API
- auth_
api - Authorization API
- ci_api
- CI/CD API
- collaboration_
api - Collaboration API
- compat_
api - Compatibility API
- config
- Node Configuration
- consensus_
api - Consensus API endpoints.
- consensus_
app - Consensus application implementation.
- consensus_
simplex - Simplex BFT consensus integration for guts-node.
- health
- Health Check Module
- observability
- Observability Module
- operator
- Operator commands for Guts node administration.
- p2p
- P2P networking integration for guts-node.
- performance
- Performance optimizations for Guts node.
- realtime_
api - Real-time WebSocket API for live updates.
- resilience
- Resilience Module
- validation
- Input Validation Module