How ethernal-tech/cardano-infrastructure works
Main Components
• Main Application: Represented by main.go which ties together all the modules.
• Indexer Module: Found in the “indexer” directory; it handles block indexing, syncing, parsing raw transactions, and interacts with database storage using different backends (bbolt and leveldb, as seen in “indexer/db”).
• Wallet Module: Located in the “wallet” directory; it covers wallet operations (address management, transaction creation/signing) and has several txprovider subcomponents (supporting services such as Blockfrost, Cats, CLI, Demeter, Gourboros, Ogmios), indicating pluggable external connections.
• Secrets Management: Under “secrets”, which abstracts different secrets handling strategies (AWS, GCP, Hashicorp Vault, and local), ensuring secure handling of credentials and configuration details.
• Common Utilities: Provided by the “common” directory (circular queues, retry logic, etc.) that support shared functionality across modules.
• Rules Engine (gorules): Likely a rule-checking or validation component to enforce business or protocol-specific rules.
• Logging: The “logger” directory provides a centralized logging mechanism used across the system.
Relationships and Interactions
• The Main Application (main.go) serves as the entry point, initializing the various modules.
• The Wallet module interacts with external transaction providers (each represented as a separate service) to send transactions and communicate with the Cardano blockchain.
• The Secrets Management system provides secure configuration and credentials to both the Indexer and Wallet (and possibly other components) for external integrations.
• The Gorules module can be shown intersecting with both the Indexer (for validating block data) and the Wallet (for ensuring transaction policies/rules are met).
Architectural Patterns and Technologies
• Modularity: Each major feature area (indexer, wallet, secrets, etc.) is separated into its own package.
• Pluggable Providers: Especially within the wallet module, a provider pattern allows different backends (Blockfrost, etc.) to be integrated seamlessly.
• Multiple Database Backends: The indexer supports different storage solutions via different packages.
• Secrets Abstraction: An abstraction layer supports multiple secrets storage mechanisms for flexibility.
• Test Coverage: The presence of a comprehensive set of test files indicates an emphasis on reliability and modular testing.