How rubixchain/rubixgoplatform works
Main Components and How They Interact
• Command/CLI Layer:
– Represents the entry point for all commands (e.g., run, ping, addbootstrap, createdid, transferrbt, etc.).
– This component interprets the command line parameters and routes them to the underlying modules.
• Core Business Logic:
– Found primarily under the “core” directory, which includes configuration handling, token operations, block and transaction validation, DID management, wallet functions, and storage interfaces.
– This is the heart of the Rubix node that processes transactions, performs cryptographic validations (with “crypto”), executes DID operations (“did”), and manages blockchain data.
– There are also specialized sub-modules, such as “pubsub” for handling publish/subscribe mechanisms and “service” that might be used for the explorer service or other network services.
• Blockchain/Transaction/Smart Contract Layer:
– Represented by directories like “block”, “contract”, “token”, and parts of “core” that concentrate on token chain validation, block creation, and smart contracts.
– The design must indicate how blocks and transactions are generated, verified, and stored.
• Networking and External Communication:
– Components such as “grpcserver”, “grpcclient”, “wrapper/ensweb”, and “protos” indicate that gRPC-based communication is supported.
– This layer will show interactions where the CLI and core business logic interact with external peers (adding bootstrap peers, pinging, etc.) and external services like explorer nodes.
• Auxiliary/Utility Modules:
– Packages including “crypto”, “nlss”, “util”, and “wrapper” provide supporting functionalities like cryptography routines, password handling, JSON utilities, logging, and error wrapping.
– These support many higher-level actions and are essential for operations like DID creation and token transfers.
• Testing and DevOps:
– The project also has a “tests” directory with unit and integration tests (including Docker-related testing), and a set of deployment workflows in “.github/workflows” for CI/CD.
– While not part of the runtime architecture, their existence emphasizes robust testing and deployment practices.
Relationships and Architectural Patterns
• The CLI interface (commands such as “run”, “ping”, etc.) are the user’s entry points. They trigger various actions in the core logic.
• The core logic acts as a central hub that coordinates with other modules (blockchain processing, DID operations, token transfers).
• Many modules use shared models and configuration from the “core/config” and “core/model” directories, indicating a design that centralizes business rules.
• The networking components (gRPC server/client, channels for peer-to-peer communication) interact with external systems and are decoupled via protocol buffers defined in “protos”.
• Patterns like separation of concerns and modularization are evident; each directory encapsulates a set of responsibilities (for instance, “client” vs “server” functionality).