How concordium/concordium-node works
Project type and purpose
• This is a distributed blockchain node implementation (“concordium-node”) plus auxiliary services for data collection and presentation.
• It comprises:
• A Rust-based p2p node (network layer, RPC/CLI, plugin integration).
• A Haskell consensus library (“concordium-consensus”) providing block production, finalization, scheduling, and storage backends.
• A collector (Rust) querying the node and forwarding metrics.
• A collector-backend (Rust) aggregating metrics and exposing an HTTP interface for dashboards.
• A macOS logging wrapper for system logging on macOS.
File structure
• Top level:
• collector-backend/
• collector/
• concordium-consensus/ (Haskell package, deep src-lib, src, tests, benchmarks)
• concordium-node/ (Rust crate with bins, network, p2p, grpc2, consensus_ffi)
• macos_logger_wrapper/ (Rust + C wrapper)
• scripts/ (build & deployment scripts, Dockerfiles, packaging)
• service/windows/ (Windows service installer code)
• Patterns:
• Layering: network → consensus FFI → core logic → storage (LMDB)
• Micro-services: node, collector, collector-backend
• FFI integration: Rust node ↔ Haskell consensus
• Multiple packaging targets: Docker, macOS, Windows, Ubuntu
README for additional insights
• The Rust node uses the Haskell consensus library either statically or dynamically.
• The collector queries the node’s GRPC or JSON-RPC endpoints.
• The collector-backend listens for collector messages (likely via HTTP or GRPC) and serves a summary for the network dashboard.