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

LOG_ROTATE_AMOUNT

Specifies the number of rotated log files to keep before deletion.

50

LOG_ROTATE_SIZE

Defines the maximum size of a log file before rotation occurs. Size units supported (e.g., G for gigabytes).

1G

BM_BINARY

The executable name or path for the block manager binary.

block-manager

BM_OWNER_WALLET_PUBKEY

Public key identifier for the block manager’s owner wallet.

default-public-key

BM_TOKEN_TTL

Time-to-live (TTL) for tokens issued by the block manager, in seconds.

300 seconds

BK_API_TOKEN

Secret token used for authenticating API requests to the block manager.

my-secret-token

BM_WALLET_KEYS

Filename template for the block manager’s wallet keys JSON file. Supports BM_ID templating.

block_manager{{ BM_ID }}.keys.json

BM_SIGNER_KEYS

Filename template for the block manager’s signing keys JSON file. Supports BM_ID templating.

block_manager{{ BM_ID }}_signing.keys.json

NGINX_IP

IP address or network identifier for NGINX binding. Can be "private" or a specific IP string.

"private"

NGINX_PORT

Port number on which NGINX listens for incoming HTTP requests.

8080

LOGROTATE_IMAGE

Docker image identifier for log rotation utility, used in containerized environments.

stakater/logrotate:3.13.0

BM_API_BIND

IP address where the block manager API binds for listening to incoming connections.

0.0.0.0 (all interfaces)

BM_REST_API_BIND

IP address where the block manager REST API binds for listening to incoming connections.

0.0.0.0 (all interfaces)

BM_ID

Numeric identifier for the block manager instance, used in templating key filenames.

1

Implementation Details

Interaction with Other System Components

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.