How dfinity-education/blockchain-and-cryptocurrency works
Project type and purpose
– This is an educational/training repository for a blockchain course built on the DFINITY Internet Computer. It combines Markdown-based course modules (Module 1–4), Motoko smart‐contract code under src/, and deployment configuration (dfx.json). Students learn blockchain fundamentals, ERC-20-style tokens, and payment channels by iterating through these modules.
File structure
Top-level files & dirs:
• module-*.md + README.md – course content
• images/ – illustrations used in modules
• src/ – Motoko code:
– Main.mo (entry point / canister logic)
– Types.mo (type definitions)
– User.mo (user/account logic)
• dfx.json – Internet Computer canister configuration
• vendor/ – third-party Motoko libraries
• package-lock.json – Node/dfx CLI dependencies
Patterns & indicators:
– src/ organizes core smart‐contract code
– module-*.md and images/ hold pedagogical content
– dfx.json drives canister build & deployment
README insights
– High-level flow: Module 1 introduces blockchain theory; Module 2 builds an ERC-20 token in Motoko; Module 3–4 implement and complete a payment channel.
a. Main components
• Course Content Layer
– Markdown modules (Module 1–4)
– images/ assets
• Code Layer (Motoko Canister Code)
– src/Main.mo
– src/Types.mo
– src/User.mo
– vendor/ (external libs)
• Deployment & Runtime
– dfx CLI & dfx.json (local emulator / build pipelines)
– Internet Computer network (IC canister host)
• Developer Environment
– Node.js/npm (package-lock.json)
– Git repo (version control)
b. Relationships & interactions
– Developer invokes dfx CLI → reads dfx.json → compiles src/**/*.mo + vendor libs → produces canister WASM blobs
→ deploys to local sandbox or IC network
– At runtime, users interact with deployed canister APIs (entrypoints defined in Main.mo) via web UI or canister calls (not explicitly in this repo but implied)
– Course modules reference source code snippets/images and guide students through editing src/ files and re-deploying.
c. Architectural patterns & principles
– Modular code separation: Types.mo for data models, User.mo for account logic, Main.mo for orchestrating token/payment-channel flows
– Configuration as code: dfx.json defines multiple canisters (token, payment channel) if extended
– Content‐code separation: pedagogical MD files are distinct from runtime codebase
d. Key technologies/frameworks
– Motoko (smart contract language)
– DFINITY Internet Computer (canister platform)
– dfx CLI (build & deploy tool)
– Node.js/npm (dependency management)