main.yaml
Overview
The main.yaml file serves as a configuration manifest for the block manager component within the system. It defines essential environment variables and constants that control runtime behavior, logging, networking, and security token management. The file is structured in key-value pairs using YAML syntax, facilitating straightforward parsing and integration into deployment or orchestration tools.
This configuration file plays a critical role in setting parameters such as log rotation policies, API binding addresses, wallet and signer key file templates, and network interface bindings. It interacts primarily with the block manager binary and associated services such as the REST API and NGINX or Caddy for HTTP serving.
Configuration Parameters
Parameter Name | Description | Default Value / Notes |
|---|---|---|
| Specifies the number of rotated log files to keep before deletion. | 50 |
| Defines the maximum size of a log file before rotation occurs. Size units supported (e.g., G for gigabytes). | 1G |
| The executable name or path for the block manager binary. | |
| Public key identifier for the block manager’s owner wallet. |
|
| Time-to-live (TTL) for tokens issued by the block manager, in seconds. | 300 seconds |
| Secret token used for authenticating API requests to the block manager. | |
| Filename template for the block manager’s wallet keys JSON file. Supports |
|
| Filename template for the block manager’s signing keys JSON file. Supports |
|
| IP address or network identifier for NGINX binding. Can be |
|
| Port number on which NGINX listens for incoming HTTP requests. | 8080 |
| Docker image identifier for log rotation utility, used in containerized environments. | |
| IP address where the block manager API binds for listening to incoming connections. |
|
| IP address where the block manager REST API binds for listening to incoming connections. |
|
| Numeric identifier for the block manager instance, used in templating key filenames. | 1 |
Implementation Details
Template Variables:
The keysBM_WALLET_KEYSandBM_SIGNER_KEYSuse the{{ BM_ID }}placeholder for dynamic filename generation based on the block manager instance ID. This allows multiple instances to maintain separate key files without conflicts.Logging Rotation:
LOG_ROTATE_AMOUNTandLOG_ROTATE_SIZEcontrol the retention and size limits for log files, enabling automated log file rotation to manage disk space. These settings are aligned with a containerized logrotate image (LOGROTATE_IMAGE) for consistent log maintenance.Network Bindings:
The use of0.0.0.0inBM_API_BINDandBM_REST_API_BINDenables the services to listen on all available interfaces, which is common for server applications requiring external accessibility.NGINX IP Configuration:
TheNGINX_IPvalue"private"suggests a placeholder for a private/internal network IP, which must be kept in sync with related configuration files (caddy/defaults/main.yaml). This ensures consistent routing and access control.Security Tokens:
BK_API_TOKENis a secret token for authenticating API calls, which implies that the block manager exposes an authenticated API endpoint. The TTL (BM_TOKEN_TTL) governs token validity duration.
Interaction with Other System Components
Block Manager Binary (
BM_BINARY):
This file configures the environment for the block-manager executable, which likely consumes these variables at startup to configure its runtime behavior.Wallet and Signer Key Files:
The wallet and signing keys filenames configured here are used by the block manager to access cryptographic keys necessary for signing blocks or transactions, linking this configuration with wallet management subsystems.API and REST API Services:
The IP bindings (BM_API_BINDandBM_REST_API_BIND) indicate the endpoints where the block manager accepts connections, impacting network security and routing configurations.NGINX (or Caddy) Reverse Proxy:
The NGINX IP and port settings coordinate with web server configurations to proxy or serve block manager APIs or UI endpoints, which requires synchronization with relevant proxy server configuration files.Log Rotation Container:
TheLOGROTATE_IMAGEreferences a containerized log rotation tool, suggesting integration with container orchestration or deployment platforms that automate log file maintenance.
Visual Diagram: Structure of main.yaml
classDiagram
class MainYAML {
<<Configuration File>>
+LOG_ROTATE_AMOUNT
+LOG_ROTATE_SIZE
+BM_BINARY
+BM_OWNER_WALLET_PUBKEY
+BM_TOKEN_TTL
+BK_API_TOKEN
+BM_WALLET_KEYS
+BM_SIGNER_KEYS
+NGINX_IP
+NGINX_PORT
+LOGROTATE_IMAGE
+BM_API_BIND
+BM_REST_API_BIND
+BM_ID
}
This diagram illustrates the main.yaml as a configuration entity encapsulating key parameters that drive other components, including binaries, APIs, logging, and networking.