How mjohnson518/supernova works
Project type and purpose
• Supernova is a full-stack, production-grade proof-of-work blockchain platform implemented in Rust.
• It comprises a core library (btclib), a node daemon, a mining service, a CLI wallet, and auxiliary tools (e.g., ASCII art banner, test harnesses).
• It exposes REST-RPC interfaces, P2P networking, environmental tracking, security mitigation, monitoring, and Lightning Network support.
File structure
• Top-level components:
• btclib/ – Core blockchain library (consensus, crypto, UTXO, storage, mempool, environmental, security, lightning, testnet harness)
• node/ – Node binary (network stack, P2P, RPC server, API routes, storage persistence, metrics, middleware)
• miner/ – Mining binary (template generation, work coordination, reward distribution, green mining registration)
• wallet/ – Wallet CLI (HD-wallet, key management, transaction creation, Lightning commands, TUI)
• supernova/ – ASCII art banner utilities
• tests/, scripts/, docker/, kubernetes/, helm/, deployments/ – CI/CD, containerization, orchestration, testnet setup
• Look for build files (Cargo.toml), configuration (config/node.toml), Dockerfiles, Helm charts.
• Notice modular namespaces under btclib (crypto/, consensus/, storage/, environmental/, lightning/) and under node (network/, api/, storage/, metrics/).
README for additional insights
• Architecture summary lists Core Library, Node, Miner, Wallet, Environmental System, Security System, Monitoring, Lightning.
• Key technologies: Rust, libp2p, JSON-RPC, REST, Prometheus, Grafana, Docker, Kubernetes, Helm.
• Deployment patterns: Docker Compose for testnet, Helm charts for production, scripts for backups and disaster recovery.
a. Main components:
• Clients: Wallet CLI, Admin CLI, ASCII Banner Tool
• Node Service: API Server (REST & JSON-RPC), P2P Network, Mempool Manager, Block Processor, Storage
• Core Library (btclib): Consensus Engine, Crypto Primitives, UTXO Model, Validation, Environmental Tracker, Security Modules, Lightning Core
• Miner Service: Mining Coordinator, Worker Pools, Difficulty Adjuster, Green Mining Interface
• Lightning Service: Off-chain channel manager (node + wallet integration)
• Databases & Persistence: Block store, UTXO database, Checkpoints, Backups
• Monitoring Stack: Prometheus, Grafana Dashboard
• External Services: Peers over P2P Overlay, OpenSSL, Kubernetes Cluster, Docker Registry
b. Relationships and interactions:
• Wallet → Node: sends signed transactions via REST/JSON-RPC → Node’s Mempool
• Node ↔ P2P Network: gossip transactions & blocks, peer management
• Node → btclib: invoke consensus validation, state updates, storage writes
• Miner ← Node API: fetch block template → Miner performs PoW → Miner submits new block via Node API
• Node → Storage: append blocks to block store, update UTXO set; perform backups
• Node → Monitoring: push metrics to Prometheus endpoint → Grafana fetches dashboards
• Lightning: Wallet and Node coordinate to open/close channels, watchtower integration, fees track through environmental module
• Kubernetes/Helm: orchestrate Node, Miner, Grafana, Prometheus, Backup CronJobs
c. Architectural patterns & design principles:
• Modular Library-Driven Design: btclib reused by node, miner, wallet
• Hexagonal Architecture: adapters for storage, network, API, CLI
• Layered Security: separate modules for Sybil, Eclipse, rate limiting
• Observer Pattern: metrics collectors feeding Prometheus
• Event-Driven / Asynchronous P2P and Mining tasks
• Configuration-Driven Deployment (TOML, Helm values)
d. Technologies & frameworks:
• Rust/Cargo
• libp2p (P2P transport)
• JSON-RPC / REST via Actix-Web or Warp
• Prometheus Client, Grafana
• Docker, Docker-Compose
• Kubernetes & Helm
• OpenSSL for crypto
• Post-quantum libs (Falcon, lattice-based primitives)
Detail & separation
• Break out sub-components only as deep as needed for clarity (e.g., show Node subdivided into API, P2P, Storage, Metrics).