How elys-network/elys works
Based on our analysis of both the enormous file tree and the README, the Elys project is a full-fledged blockchain built using the Cosmos SDK and CometBFT (the underlying consensus engine formerly known as Tendermint). It is designed to be fast, scalable, and secure for decentralized applications. The system is highly modular, with each module (located primarily in the “api”, “app”, “x”, and “cmd” directories) responsible for discrete functions such as automated market making (amm), asset profiling, staking variations (estaking, stablestake), leveraged positions (leveragelp), governance (masterchef, commitment, parameter), oracle functionality, as well as other domain-specific modules (tokenomics, perpetual, tradeshield, transferhook, tier, etc.).
• Daemon/Node (elysd): Located in “cmd/elysd”, this is the main executable that runs the blockchain node.
• Core Application & Blockchain Logic: The “app” folder houses the entry point (app.go, genesis.go, etc.) and overall encoding, simulation, and export mechanisms which bootstrap the blockchain.
• Modules: Many functional modules exist under “api/elys” and “x”. Each module implements aspects like AMM, asset profiles, burner, commitment, epochs, estaking, oracle, parameter, perpetual, stablestake, tier, tokenomics, tradeshield, and others. Each module generally follows the Cosmos SDK module pattern with its own keeper, message server, query methods, and state management.
• Protobuf and API Definitions: The “proto” directory contains all the protocol buffer definitions (for gRPC and REST endpoints) that standardize external communication.
• Client/CLI & WASM Bindings: In the “wasmbindings” and some “client/cli” directories (within “x” folders and also “price_feeder”), there are modules, clients, and bindings for managing both CLI interactions and wasm-based calls.
• Deployment and DevOps: Directories like “.github”, “dockernet”, “Dockerfile”, and various “scripts” (for testing, migration, orchestration, and releasing) indicate CI/CD pipelines, testing frameworks, and deployment orchestration.
• How transactions from the CLI or REST/gRPC API endpoints reach the daemon “elysd”.
• Within elysd, illustrate how the core application forwards transactions (and governance “proposal” messages, etc.) to the appropriate module’s message server.
• How the consensus engine (CometBFT) interacts with elysd for achieving consensus, block production, and state commitment.
• Involvement of external services (for example, the oracle modules that connect to external price feeds as indicated in “oracle”, “price_feeder”, and related script examples).
• Incorporate the development and deployment tools (GitHub Actions workflows, Docker/Compose setups, and price feeder configurations) as supporting infrastructure that interacts with various layers.
Architectural Patterns and Design Principles
• Modularity: Emphasize that each functional area is implemented as a separate module following the Cosmos SDK “module” pattern—each with its own state, message handlers, queries, and simulation tests.
• API-first design: The use of gRPC (with generated pb.go files in both “api/elys” and “proto”) and REST endpoints points to a design that exposes services for both querying and transaction processing.
• Separation of Concerns: Distinguish between core blockchain logic (in “app” and “cmd”), modular functionality (in “x” and “api/elys”), and external/deployment concerns (in “dockernet”, “scripts”, “.github”).
• Extensibility: Many modules have comprehensive testing and migration directories, suggesting that the system is built to evolve and upgrade seamlessly.
Relevant Technologies and Frameworks
• Cosmos SDK for blockchain framework.
• CometBFT (Tendermint) for consensus.
• Go as the primary programming language (with extensive Go module and build tool usage shown by go.mod, Makefile, and various build scripts).
• Protobuf for defining APIs and message schemas.
• Tools like buf, protoc-gen-go-cosmos-orm, and others for code generation.
• Docker and docker-compose for containerization of node deployments and testing networks.
Specific Elements
• Clear labels: Name each component (e.g., “elysd Daemon”, “AMM Module”, “Oracle Module”, “gRPC/REST API”, “Consensus Engine”).
• Interactions between modules (e.g., how the Commitment module might interact with the Tokenomics module or how hooks between Accounted Pool and AMM or Leveragelp are set up).
• The “elysd” node running on top of Cosmos SDK with underlying CometBFT consensus.
• One layer for service/API access showing exposed gRPC, REST, and CLI endpoints.
• A detailed depiction of functional modules (AMM, AssetProfile, Burner, Commitment, Epochs, Clock, Estaking, Leveragelp, Masterchef, Oracle, Parameter, Perpetual, Stablestake, Tier, Tokenomics, Tradeshield, Transferhook, etc.) with their internal keepers, message interfaces, and query capabilities.
• Supporting infrastructure for deployments and testing (Docker, GitHub workflows, and scripts) as additional context.