How nguyenphuminh/blockchain-tutorial works
Main Components
• P2P Network Module: Represent the layer that handles node discovery, networking, and message propagation. This is core to “Build a p2p network and release your cryptocurrency.”
• Blockchain Ledger: Include the data structure (likely implemented in files like jechain.js) that maintains the chain of blocks.
• Transaction Module: Indicate components that build, verify, and propagate transactions. Note the emphasis on transactions, minting, gas fees, and mining rewards in “Creating transactions, mining rewards, mint and gas fee in Javascrtipt.”
• Mining/Consensus Mechanism: Show the logic that handles the creation of new blocks (mining rewards) and ensures consensus.
• (Optional) Smart Contracts & Extensibility: Although not core to these examples, the README’s reference to the JeChain project suggests future extensibility for features like smart contracts.
Architectural Patterns and Design Principles
• Decentralized nature of the application (all nodes communicate via the p2p network).
• Modular design: each “tutorial” demonstrates a variation in implementation (the different directories represent different approaches or steps in the learning process).
• Patterns like “chain of responsibility” in message propagation and “observer” for state updates across network nodes.
Relevant Technologies and Constructs
• JavaScript as the primary programming language.
• Use of simple file-based implementations of blockchain logic (as evidenced by files such as jechain.js, jecoin.js, etc.).