spi, dict, brcode, and core), so its variable set is broad.
The service reads every variable at startup. A value that does not parse for its type, such as yes for a switch, stops startup. When systemplane is on (the default), it can override a subset at runtime without a restart. The rest of the variables need a restart to change. For the knobs that behave the same across every Lerian Go service (deployment posture, datastores, telemetry), see BYOC configuration essentials.
In the tables below, Required marks a variable you must set, always (Yes) or under the condition named. — means no default. The conditions use three terms:
- Live: the BACEN endpoint uses
https. A local environment also accepts anhttpendpoint. - Local environment:
ENV_NAMEisdevelopment,local, ortest. - Protected environment:
ENV_NAMEisproduction,prod,staging,stage,pre-prod,preprod,pre-production, orpreproduction.
Most BACEN-facing variables carry a surface prefix:
BACEN_SPI_* for the SPI settlement transport, BACEN_DICT_* for the DICT client, BACEN_BRCODE_JOSE_* for BR Code JOSE signing, and BACEN_ICOM_* for the inbound long-poll channel.Runtime and server
A protected environment requires the server certificate and key files, or
TLS_TERMINATED_UPSTREAM=true.
Authentication
Lerian SPI authorizes protected routes, including the systemplane admin API, through Access Manager.Permission declaration
Each binary can publish its permission declaration to Access Manager at startup. These variables are separate fromAUTH_ENABLED.
With
IDP_DECLARATION_ENABLED=true, the binary does not start when one of the three required variables is empty, when IDP_HOST is not valid, or when PLUGIN_AUTH_ENABLED is not true. The publication also needs the Access Manager address, set as PLUGIN_AUTH_ADDRESS. When Access Manager refuses the publication or does not answer, the binary still starts.
License
Every binary (spi, dict, brcode, and core) needs a license to start. One license covers all four binaries, and it is global: the rail reads no organization list.
A binary stops at startup when neither variable is set, whatever
ENV_NAME says. The license guard covers every route except /health, /readyz, /version, /metrics, so it also covers the BR Code payload and key-set routes. When the license is refused, at startup or in a later background check, the binary stops. A pod with LICENSE_KEY needs outbound HTTPS to license.lerian.io.
BACEN callback (inbound from SPI)
Outside a local environment, the rail needs exactly one callback mutual-TLS mode. In direct mode, set
SERVER_TLS_CERT_FILE, SERVER_TLS_KEY_FILE, and SERVER_TLS_CLIENT_CA_FILE. In proxy mode, set TLS_TERMINATED_UPSTREAM=true, the trusted CIDRs, and the header secret.
SPI settlement transport (BACEN_SPI_*)
Connection to BACEN’s SPI settlement endpoint over the RSFN, with the secondary messaging channel and the file-transfer (ARQ) endpoint.
mutual TLS to BACEN
TheBACEN_TLS_* files back the mutual-TLS channel to BACEN. The SPI and DICT clients share them.
With
BACEN_TLS_KEY_KIND=kmip, the client private key stays in your HSM. The binary opens it through the KMIP connection of its own signer: set BACEN_SPI_SIGNER_KIND=kmip on spi or BACEN_DICT_SIGNER_KIND=kmip on dict. Startup is refused unless both UIDs are set and the private key UID differs from the UID of the signing private key. If the binary cannot open the key in the HSM, it does not become ready. A renewed BACEN_TLS_CERT_FILE must hold the certificate of the same HSM key: the binary refuses a certificate for another key and keeps the loaded certificate.
Message signing and certificates
Lerian SPI digitally signs its outbound messages. Pick a custody backend withBACEN_SPI_SIGNER_KIND.
With the kmip backend, a wrong signing private key UID or a wrong DigestInfo setting stops startup. The same holds for the KMIP backends of DICT and BR Code JOSE.
Certificate validation (OCSP/CRL)
Payload resolver
These variables control how the service stores and references large SPI payloads.Inbound channel (BACEN_ICOM_*)
Long-poll channel for messages BACEN pushes back to the participant.
Either consumer requires a configured persistence backend,
BACEN_ICOM_ISPB, BACEN_SPI_INTERNAL_CALLBACK_SECRET, and BACEN_CALLBACK_MTLS_HEADER_SECRET. The primary consumer also requires BACEN_ICOM_BASE_URL. The secondary consumer also requires BACEN_SPI_SECONDARY_ENDPOINT.
An enabled consumer requires the proxy callback mode: TLS_TERMINATED_UPSTREAM=true, no SERVER_TLS_CLIENT_CA_FILE, and BACEN_CALLBACK_TRUSTED_PROXY_CIDRS with the address the consumer forwards from. With the default SERVER_ADDRESS, that address is 127.0.0.1.
DICT client (BACEN_DICT_*)
Client for BACEN’s Pix key directory (DICT), including the NP endpoint for batch key-existence checks. The client does not read HTTP_PROXY or HTTPS_PROXY.
BR Code JOSE signing (BACEN_BRCODE_JOSE_*)
Signs dynamic BR Code payloads (JWS). When BACEN_BRCODE_JOSE_SIGNER_KIND is unset, JOSE is disabled and the public payload endpoints refuse to serve. With JOSE enabled, route the payload paths (/api/v1/brcode/payload/*) and the key-set path (/api/v1/brcode/.well-known/jwks.json) under PUBLIC_BASE_URL to the brcode binary, with no authorizer in front of them. The payer’s PSP calls these routes without a credential.
BR Code QR resolve (BACEN_BRCODE_QR_PAYER_*)
Controls the payer-side resolve of a dynamic QR. When the resolve is off, its operation answers 503.
With
BACEN_ARQ_ENDPOINT set and BACEN_ARQ_ENABLED not false, the spi binary checks the certificate list every hour. When the stored list is 24 hours old, it downloads BACEN’s list over the BACEN_TLS_* files, validates it, and stores it in the database. A failed or invalid download keeps the last list. The ENV_NAME of the spi binary selects the list: production downloads the production list, and any other value downloads the homologação list. The brcode binary reads the stored list every minute and needs neither the BACEN_TLS_* files nor BACEN_ARQ_ENDPOINT for it, so brcode and spi must use the same PostgreSQL database. Until the first list is stored, the resolve answers 503. The spi binary stops at startup when BACEN_BRCODE_QR_PAYER_ENABLED is true in its own environment, the test trust is off, BACEN_ARQ_ENDPOINT is blank, and BACEN_ARQ_ENABLED is not false.
PII encryption and hashing
Each key is 32 bytes, raw or base64. Each pepper has at least 32 characters.PostgreSQL
Redis
Regulatory archive (REGULATORY_ARCHIVE_*)
The spi and dict binaries keep the regulatory archive in S3-compatible storage. The brcode and core binaries do not use these variables.
Here, a development environment means that
ENV_NAME is development, develop, dev, local, or test, and DEPLOYMENT_MODE is not saas. These rules read ENV_NAME as set, so an unset ENV_NAME is not a development environment. A missing required variable stops startup. In a development environment without a bucket, the rail archives nothing. With the archive on, /readyz on spi and dict reports the archive check down while the bucket does not answer, and stays ready.
Outbox and streaming
Lerian SPI publishes events through a transactional outbox and a streaming producer, and consumes settlement events for BR Code. The BR Code settlement consumer runs unconditionally. Streaming has no enable switch:STREAMING_BROKERS is required at startup, including when OUTBOX_ENABLED=false. Each binary requires its own fixed STREAMING_CLOUDEVENTS_SOURCE value, and any other value stops startup: br-spi for spi, br-spi-dict for dict, br-spi-brcode for brcode, and br-spi-core for core.
A STREAMING_EVENT_POLICIES entry that switches off a Lerian SPI event stops startup. Only the two spi_tracking events and three dict_med_operations events (inconsistent_projection, feed_blocked, and feed_record_abandoned) can be switched off.
Schedulers
Background jobs, each with its own switch. The two DICT jobs that default totrue carry regulatory duties, so the dict binary starts its scheduler for them unless SCHEDULER_ENABLED=false. The spi binary does the same for the schedule verdict and portability deadline jobs. The jobs that default to false also need SCHEDULER_ENABLED=true. DICT discovery and inventory workers have their own controls in the next section.
DICT discovery and inventory
The workers below run independently ofSCHEDULER_ENABLED, each with its own switch.
Rate limiting, idempotency, and connectivity
Systemplane and runtime configuration
See Systemplane for the API, namespaces, and required permissions.
Observability
Documentation
Health and readiness
Lerian SPI exposesGET /health (liveness), GET /readyz (readiness), and GET /version on the main HTTP port. /metrics runs on its own listener when enabled. See Health and readiness for the probe contract.
The /readyz response includes a license check. With LICENSE_KEY, the check is always up and makes no call to the license service, so an invalid license does not turn /readyz to 503. A license that the rail refuses stops the binary, at startup or in a later background check.
The certificate checks, the signer-custody check, and the regulatory-archive check report their real status in the /readyz body. When one reports down, /readyz stays ready.
