Skip to content

Latest commit

 

History

History
63 lines (54 loc) · 3.48 KB

File metadata and controls

63 lines (54 loc) · 3.48 KB

Tutorial: snapchain

Snapchain is a sharded blockchain project that manages distributed consensus, state storage, and network communication to maintain a decentralized and scalable ledger.
It implements a consensus protocol (Malachite) for agreement on blocks and shards, manages specialized stores that handle various message types with eventual consistency, and includes mempool and rate limiters to handle incoming messages efficiently.
The system exposes network layers for peer-to-peer gossiping and RPC servers for client interactions, along with configuration and startup routines for initializing all subsystems.
The architecture neatly separates concerns with distinct node actors, consensus actors, and storage engines, ensuring robust coordination between validating, syncing, and reading nodes in the network.

Source Repository: None

flowchart TD
    A0["SnapchainNode and SnapchainReadNode"]
    A1["Consensus Actors (MalachiteConsensusActors, Host, ReadHost, Sync Actors)"]
    A2["ShardEngine and BlockEngine (Storage Engines)"]
    A3["Stores and Store Trait (e.g., CastStore, LinkStore, ReactionStore)"]
    A4["Mempool and Rate Limits"]
    A5["Network Layer: Gossip, Server, and RPC"]
    A6["Core Protocol Types and Validation"]
    A7["Storage Trie and RocksDB Abstractions"]
    A8["Configuration and Startup Flow"]
    A0 -- "Manages Consensus Actors" --> A1
    A0 -- "Uses Storage Engines" --> A2
    A0 -- "Contains Specific Message S..." --> A3
    A0 -- "Communicates via Network Layer" --> A5
    A1 -- "Uses Protocol Types and Val..." --> A6
    A1 -- "Relays Network Events" --> A5
    A2 -- "Manages Message Stores" --> A3
    A2 -- "Uses Merkle Trie and RocksD..." --> A7
    A3 -- "Indexes Messages in Storage..." --> A7
    A3 -- "Validates Messages" --> A6
    A4 -- "Validates and Filters Incom..." --> A3
    A4 -- "Gossips Messages via Network" --> A5
    A4 -- "Enforces Validation and Rat..." --> A6
    A5 -- "Forwards Network Events to ..." --> A1
    A5 -- "Delivers Decided Values and..." --> A0
    A5 -- "Configures and Starts Netwo..." --> A8
    A6 -- "Defines Message Types Used ..." --> A3
    A6 -- "Provides Validation for Mem..." --> A4
    A7 -- "Supports Data Indexing for ..." --> A3
    A8 -- "Bootstraps Node Instances" --> A0
    A8 -- "Starts Network Layer" --> A5
    A8 -- "Creates and Runs Mempool" --> A4
    A8 -- "Initializes Storage Engines" --> A2
    A8 -- "Loads Validation Configurat..." --> A6
Loading

Chapters

  1. SnapchainNode and SnapchainReadNode
  2. Configuration and Startup Flow
  3. Network Layer: Gossip, Server, and RPC
  4. Mempool and Rate Limits
  5. Consensus Actors (MalachiteConsensusActors, Host, ReadHost, Sync Actors)
  6. Core Protocol Types and Validation
  7. Stores and Store Trait (e.g., CastStore, LinkStore, ReactionStore)
  8. Storage Trie and RocksDB Abstractions
  9. ShardEngine and BlockEngine (Storage Engines)

Generated by AI Codebase Knowledge Builder