How stabilityprotocol/stability works
Main Components
• Node & Runtime Core:
• The "node" directory contains the main node application with chain specifications, RPC implementations, and client services.
• The "runtime" folder holds the blockchain runtime code and configuration, including pallets integration.
• Pallets and Precompiles:
• The "pallets" directory comprises many custom pallets (e.g., custom-balances, fee management, sponsored transactions, validator-set) that are the functional building blocks of the blockchain.
• The "precompiles" directory hosts modules for precompiled contracts, which are used to enhance or accelerate certain functionalities.
• Client and Metrics:
• The "client" folder (with submodules like authorship and proposer-metrics) handles node-specific tasks such as block authorship and performance metrics.
• Supporting Tools and Utilities:
• The "stability-cli" and "stability-rpc" directories provide command-line tools and RPC interfaces for managing the blockchain.
• The "utils" folder and "primitives" directories offer shared logic, APIs, and helper libraries for account representation, transaction validation, and Ethereum-specific operations.
• Docker and Deployment:
• The "docker" directory, along with accompanying CI/CD configurations (under .github/workflows), provides deployment and testing scripts, supporting containerized environments.
Relationships and Interactions
• How the Node (client + core node components) interacts with the Runtime:
• The Node communicates with the runtime through RPC interfaces (found in node/src/rpc) and initiates protocols like consensus.
• Runtime-Pallet Integration:
• The runtime is composed of various pallets (custom balances, fee selectors, validator management, etc.), each responsible for a blockchain module. Indicate how these pallets interact internally and expose APIs to the runtime.
• External and Third-Party Services:
• Ethereum compatibility layer provided by Frontier—a bridge that handles Ethereum-like API requests.
• Also, show integration with monitoring tools (from the “docker/monitoring” folder, which includes Prometheus and Grafana configurations) for system observability.
• Client and CLI Components:
• How the stability-cli and RPC components interact with the node, enabling administrative controls, manual block sealing, and overall chain management.
Architectural Patterns & Technologies
• Modular Architecture:
• Modular design of the blockchain, where each pallet is a distinct component that plugs into the runtime.
• Consensus & Governance:
• Dockerized Deployment:
• That Docker and container orchestration (via docker-compose) are used for deployment, testing, and monitoring.
• CI/CD Integration:
• How workflows are defined in GitHub Actions for building, testing, and deploying the blockchain code.