|
| 1 | +//! # Node Crate |
| 2 | +//! |
| 3 | +//! The node crate combines all state machines of the Mina blockchain node into |
| 4 | +//! one unified state machine using a Redux-style architecture. |
| 5 | +//! |
| 6 | +//! ## Core Architecture |
| 7 | +//! |
| 8 | +//! | Component | Location | Purpose | |
| 9 | +//! |-------------|--------------------|----------------------------------------------| |
| 10 | +//! | Actions | [`Action`] | Events that trigger state changes | |
| 11 | +//! | Effects | [`effects()`] | Side-effects and service calls | |
| 12 | +//! | Reducers | [`reducer()`] | Functions that mutate state | |
| 13 | +//! | Services | [`service`] | I/O and heavy computation (separate threads) | |
| 14 | +//! | State | [`State`] | Centralized, immutable data structure | |
| 15 | +//! |
| 16 | +//! ## Execution Flow |
| 17 | +//! |
| 18 | +//! ```text |
| 19 | +//! Event arrives |
| 20 | +//! -> Dispatch Action |
| 21 | +//! -> Check Enabling Condition |
| 22 | +//! -> Reducer (mutate state) |
| 23 | +//! -> Effects (side-effects) |
| 24 | +//! -> Service callbacks |
| 25 | +//! -> Loop |
| 26 | +//! ``` |
| 27 | +//! |
| 28 | +//! ## Key Components |
| 29 | +//! |
| 30 | +//! | Component | Module | Purpose | |
| 31 | +//! |---------------------|-------------------------|-------------------------------------| |
| 32 | +//! | Block Producer | [`block_producer`] | Block creation on won slots | |
| 33 | +//! | Ledger | [`ledger`] | Account state and transactions | |
| 34 | +//! | P2P | [`p2p`] | Networking layer | |
| 35 | +//! | RPC | [`rpc`] | JSON-RPC API | |
| 36 | +//! | SNARK Pool | [`snark_pool`] | Proof work management | |
| 37 | +//! | Transaction Pool | [`transaction_pool`] | Mempool for pending transactions | |
| 38 | +//! | Transition Frontier | [`transition_frontier`] | Blockchain consensus and best chain | |
| 39 | +
|
1 | 40 | #![allow(clippy::if_same_then_else)] |
2 | 41 |
|
3 | 42 | extern crate graphannis_malloc_size_of as malloc_size_of; |
|
0 commit comments