How casper-network/casper-node works
Casper Node is the reference implementation of the Casper blockchain protocol. The principal workflow is a validator joining a peer network, participating in consensus, synchronizing and validating blocks, executing transactions, and persisting chain data. The tree also shows contract tooling and APIs, while the README documents validator launch and smart-contract development. The excerpts establish some engine and storage responsibilities, but do not show the node’s reactor wiring; those subsystem relationships are therefore dashed and unverified.
Main entry points: main_reactor.rs Event reactor · mod.rs Execution engine · main.rs Validator node · storage.rs Contract API
Components 20
Node Operations
- Validator node
node/src/app/main.rs - Event reactor
node/src/reactor/main_reactor.rs - Peer networking
node/src/components/network/tasks.rs - Highway consensus
node/src/components/consensus/highway_core/highway.rs - Block synchronization
node/src/components/block_synchronizer.rs - Block validation
node/src/components/block_validator.rs - Transaction intake
node/src/components/transaction_acceptor.rs - Contract runtime
node/src/components/contract_runtime.rs - Node storage
node/src/components/storage.rs - REST service
node/src/components/rest_server.rs - Event stream
node/src/components/event_stream_server.rs - Diagnostics port
node/src/components/diagnostics_port/tasks.rs
Execution Platform
- Execution engine
execution_engine/src/engine_state/mod.rs - Wasm runtime
execution_engine/src/runtime/mod.rs - Wasm executor
execution_engine/src/engine_state/wasm_v1.rs - Wasm preparation
execution_engine/src/runtime/wasm_prep.rs
Contract Development
- Contract API
smart_contracts/contract/src/contract_api/storage.rs - Example contracts
smart_contracts/contracts/client/add-bid/src/main.rs
Operator Tools
- Contract CLI
cargo_casper/src/cli.rs
Other components
- Node operator
Connections 18
- Node operator → Validator node: launches validator
- Validator node → Event reactor: dispatches events
- Event reactor → Peer networking: coordinates
- Event reactor → Highway consensus: coordinates
- Event reactor → Block synchronization: coordinates
- Event reactor → Block validation: coordinates
- Event reactor → Transaction intake: coordinates
- Event reactor → Contract runtime: coordinates
- Event reactor → Node storage: coordinates
- Event reactor → REST service: serves
- Event reactor → Event stream: serves
- Event reactor → Diagnostics port: serves
- Execution engine → Wasm executor: executes Wasm
execution_engine/src/engine_state/mod.rs - Execution engine → Wasm runtime: uses runtime
execution_engine/src/engine_state/mod.rs - Execution engine → Wasm preparation: prepares Wasm
- Contract API → Execution engine: invokes host
- Example contracts → Contract API: uses API
- Node operator → Contract CLI: creates contracts