Skip to main content
Every platform command loads its configuration the same way: read a YAML file, overlay environment variables, then validate the result against the settings model and production policy (base/src/platform_network/config/loader.py:37-47).

Load order and precedence

load_settings(path) builds the configuration in three steps (base/src/platform_network/config/loader.py:37-47):
1

Read the YAML file

The file at --config is parsed as YAML and must contain a mapping; a missing file raises FileNotFoundError and a non-mapping raises ValueError (base/src/platform_network/config/loader.py:39-46).
2

Overlay environment variables

Any PLATFORM_-prefixed environment variable is applied on top of the file values (base/src/platform_network/config/loader.py:28-34).
3

Validate

The merged data is validated into the Settings model, which also runs the production policy (base/src/platform_network/config/loader.py:47, base/src/platform_network/config/settings.py:128-131).
Because environment variables are applied after the file is read, environment variables override file values (base/src/platform_network/config/loader.py:46-47).

Environment variable overrides

Environment overrides use the PLATFORM_ prefix and map nested settings with a double underscore (__) separator. The remainder of the key is lowercased and split into a nested path (base/src/platform_network/config/loader.py:28-33).
SettingEnvironment variable
master.proxy_portPLATFORM_MASTER__PROXY_PORT
database.urlPLATFORM_DATABASE__URL
validator.registry_urlPLATFORM_VALIDATOR__REGISTRY_URL
Values that begin with [ or { are parsed as YAML, so lists and mappings can be supplied inline (base/src/platform_network/config/loader.py:12-18):
export PLATFORM_MASTER__PROXY_PORT=9000
export PLATFORM_MASTER__UPLOAD_EXTRA_REGISTERED_HOTKEYS='["5Fh...","5Gd..."]'

Settings sections

The top-level Settings model groups configuration into sections (base/src/platform_network/config/settings.py:118-126):
SectionPurposeSource
environmentDeployment environment; drives production policy. Defaults to development.base/src/platform_network/config/settings.py:119
networkChain, wallet, and subnet identity.base/src/platform_network/config/settings.py:120
masterMaster proxy, epoch, registry, and upload settings.base/src/platform_network/config/settings.py:121
validatorValidator registry and weights settings.base/src/platform_network/config/settings.py:122
databaseDatabase connection URL.base/src/platform_network/config/settings.py:123
dockerSwarm broker, networking, and job placement.base/src/platform_network/config/settings.py:124
securityAdmin token source.base/src/platform_network/config/settings.py:125
observabilityLogging, Sentry, and OpenTelemetry.base/src/platform_network/config/settings.py:126
See the Settings reference for every key, type, and default.

Production policy

When environment is prod, production, or staging, a stricter policy is enforced at load time (base/src/platform_network/config/policy.py:6, :30-35). The policy runs automatically through the settings validator on every load (base/src/platform_network/config/settings.py:128-131), raising ProductionPolicyError on any violation (base/src/platform_network/config/policy.py:26-27).
RuleRequirementSource
DatabaseMust be an external PostgreSQL URL; sqlite is rejected.base/src/platform_network/config/policy.py:42-50
Image allowlistPrefixes must include a registry with a dot and a namespace; broad roots and wildcards are rejected.base/src/platform_network/config/policy.py:53-67
Image referencesMust include a tag (semver or latest) and a sha256: digest.base/src/platform_network/config/policy.py:70-85
TLSverify_tls may not be set to false.base/src/platform_network/config/policy.py:88-94
In non-production environments these checks are skipped — each validator returns early when production is false (base/src/platform_network/config/policy.py:43-44, :54-55, :71-72).
Set environment: production only once your database is PostgreSQL and your image allowlist uses fully-qualified registry prefixes (for example ghcr.io/<org>/). Otherwise the command fails fast at startup (base/src/platform_network/config/policy.py:97-102).

Security model

How the admin token and production policy protect the master.

Settings reference

Every key, type, and default these files accept.

Configuration examples

Copy-ready master and validator configuration files.