Crate node

Crate node 

Source
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

ComponentLocationPurpose
ActionsActionEvents that trigger state changes
Effectseffects()Side-effects and service calls
Reducersreducer()Functions that mutate state
ServicesserviceI/O and heavy computation (separate threads)
StateStateCentralized, immutable data structure

§Execution Flow

Event arrives
-> Dispatch Action
-> Check Enabling Condition
-> Reducer (mutate state)
-> Effects (side-effects)
-> Service callbacks
-> Loop

§Key Components

ComponentModulePurpose
Block Producerblock_producerBlock creation on won slots
Event Sourceevent_sourceExternal event ingestion
External SNARK Workerexternal_snark_workerExternal SNARK worker management
LedgerledgerAccount state and transactions
LoggerloggerLogging utilities
P2Pp2pNetworking layer
RecorderrecorderAction recording for replay
RPCrpcJSON-RPC API
SNARK Poolsnark_poolProof work management
StatsstatsStatistics tracking
Transaction Pooltransaction_poolMempool for pending transactions
Transition Frontiertransition_frontierBlockchain consensus and best chain
Watched Accountswatched_accountsAccount 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§

p2p_ready

Structs§

CheckTimeoutsAction
Checks for timeouts and dispatches other time dependant actions.
State

Enums§

Action
ActionKind
Unified kind enum for all action types
P2p
P2pAction
SnarkAction

Traits§

ActionKindGet

Functions§

effects
reducer

Type Aliases§

ActionWithMeta
ActionWithMetaRef
Effects
Store
Substate