Expand description
§Node Crate
The node crate combines all state machines of the Mina blockchain node into one unified state machine using a Redux-style architecture.
§Core Architecture
| Component | Location | Purpose |
|---|---|---|
| Actions | Action | Events that trigger state changes |
| Effects | effects() | Side-effects and service calls |
| Reducers | reducer() | Functions that mutate state |
| Services | service | I/O and heavy computation (separate threads) |
| State | State | Centralized, immutable data structure |
§Execution Flow
Event arrives
-> Dispatch Action
-> Check Enabling Condition
-> Reducer (mutate state)
-> Effects (side-effects)
-> Service callbacks
-> Loop§Key Components
| Component | Module | Purpose |
|---|---|---|
| Block Producer | block_producer | Block creation on won slots |
| Event Source | event_source | External event ingestion |
| External SNARK Worker | external_snark_worker | External SNARK worker management |
| Ledger | ledger | Account state and transactions |
| Logger | logger | Logging utilities |
| P2P | p2p | Networking layer |
| Recorder | recorder | Action recording for replay |
| RPC | rpc | JSON-RPC API |
| SNARK Pool | snark_pool | Proof work management |
| Stats | stats | Statistics tracking |
| Transaction Pool | transaction_pool | Mempool for pending transactions |
| Transition Frontier | transition_frontier | Blockchain consensus and best chain |
| Watched Accounts | watched_accounts | Account monitoring |
Re-exports§
pub use service::Service;pub use crate::block_producer::BlockProducerAction;pub use crate::block_producer_effectful::BlockProducerEffectfulAction;pub use crate::event_source::EventSourceAction;pub use crate::external_snark_worker::ExternalSnarkWorkerAction;pub use crate::ledger::LedgerAction;pub use crate::rpc::RpcAction;pub use crate::snark_pool::SnarkPoolAction;pub use crate::snark_pool::SnarkPoolEffectfulAction;pub use crate::transaction_pool::TransactionPoolAction;pub use crate::transition_frontier::TransitionFrontierAction;pub use crate::watched_accounts::WatchedAccountsAction;pub use mina_core as core;pub use config::*;
Modules§
- account
- action 🔒
- action_
kind 🔒 - block_
producer - block_
producer_ effectful - config
- daemon_
json - effects 🔒
- event_
source - Event source state machine.
- external_
snark_ worker - external_
snark_ worker_ effectful - ledger
- ledger_
effectful - logger
- p2p
- recorder
- reducer 🔒
- rpc
- rpc_
effectful - service
- snark
- snark_
pool - state 🔒
- stats
- Statistics Module
- transaction_
pool - transition_
frontier - watched_
accounts
Macros§
Structs§
- Check
Timeouts Action - Checks for timeouts and dispatches other time dependant actions.
- State
Enums§
- Action
- Action
Kind - Unified kind enum for all action types
- P2p
- P2pAction
- Snark
Action