How dfinity/ic works
This is the Internet Computer Protocol repository; its central product is the Rust replica run by machines in the network. The principal workflow is user requests entering the replica, being handled as queries or state-changing execution, and interacting with replicated state. The tree and README establish the product scope, while sampled source and the SOURCE INDEX support only selected internal links. Consequently, several protocol-stage connections are shown as unverified rather than asserted as observed calls.
Main entry points: main.rs Replica process · execution_environment.rs Execution environment · consensus Consensus · sandboxed_execution_controller.rs Sandbox controller
Components 24
Replica runtime
- Replica process
rs/replica/bin/replica/main.rs - Execution environment
rs/execution_environment/src/execution_environment.rs - Query handler
rs/execution_environment/src/query_handler.rs - Query context
rs/execution_environment/src/query_handler/query_context.rs - Sandbox controller
rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs - Sandbox RPC
rs/canister_sandbox/src/rpc.rs - Sandbox identifiers
rs/canister_sandbox/src/protocol/id.rs
Consensus and networking
- Consensus
rs/consensus - Peer networking
rs/p2p - Bitcoin consensus
rs/bitcoin/consensus/src/lib.rs
Replicated state
- Replicated state
rs/replicated_state - Page storage
rs/replicated_state/src/page_map/storage.rs
Canister services
- Registry canister
rs/registry/canister/src/registry.rs - Registry storage
rs/registry/canister/src/storage.rs - NNS governance
rs/nns/governance/src/storage.rs - SNS extensions
rs/sns/governance/src/extensions.rs - Boundary node
rs/boundary_node/ic_boundary/src/main.rs - Pocket IC
rs/pocket_ic_server/src/pocket_ic.rs
Bitcoin integration
- ckBTC minter state
rs/bitcoin/ckbtc/minter/src/state.rs - Minter event log
rs/bitcoin/ckbtc/minter/src/state/eventlog.rs - Minter stable storage
rs/bitcoin/ckbtc/minter/src/storage.rs - Bitcoin transactions
rs/bitcoin/ckbtc/minter/src/tx.rs
Other components
- Users
- Bitcoin network
Connections 19
- Users → Replica process: submit requests
- Replica process → Execution environment: dispatches execution
- Execution environment → Query handler: handles queries
rs/execution_environment/src/query_handler.rs - Query handler → Query context: uses context
rs/execution_environment/src/query_handler.rs - Replica process → Consensus: runs protocol
- Consensus → Peer networking: communicates over
- Execution environment → Replicated state: uses state
- Page storage → Replicated state: persists pages
rs/replicated_state/src/page_map/storage.rs - Registry canister → Registry storage: uses storage
rs/registry/canister/src/storage.rs - Replica process → Boundary node: serves through
- Sandbox controller → Sandbox RPC: uses RPC
rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs - Sandbox controller → Sandbox identifiers: uses identifiers
rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs - Replica process → Sandbox controller: delegates execution
- Consensus → Bitcoin consensus: integrates Bitcoin
- ckBTC minter state → Minter event log: replays events
rs/bitcoin/ckbtc/minter/src/state/eventlog.rs - Minter stable storage → Minter event log: stores events
rs/bitcoin/ckbtc/minter/src/storage.rs - Bitcoin transactions → Bitcoin network: creates transactions
- ckBTC minter state → Bitcoin transactions: tracks transactions
rs/bitcoin/ckbtc/minter/src/state.rs - Pocket IC → Replica process: runs replica-like tests