Configuration

Configuration schema, environment variable overrides, and example configurations.

Configuration Schema

The Sankofa Engine is configured via a YAML file (default path: config.yaml). Below is the complete schema with all supported fields.

Default Configuration

shard_count: 4

nats:
  cluster_urls:
    - "nats://localhost:4222"
  jetstream:
    max_message_age_seconds: 220898160  # 7 years

scylladb:
  endpoints:
    - "localhost:9042"
  keyspace: "sankofa_engine"
  read_consistency: "ONE"
  request_timeout: "30s"

kms:
  provider: "local"
  region: "us-east-1"

openbao:
  address: "http://localhost:8200"
  token: "dev-root-token"
  transit_mount: "transit"

service:
  name: "monolith"
  id: ""

Field Reference

Field PathTypeDefaultDescription
shard_countinteger4Number of shards for partitioning transactions across workers. Determines the modulus for FNV-1a shard routing.
nats.cluster_urls[]string["nats://localhost:4222"]List of NATS server URLs for the client to connect to. Supports multiple URLs for cluster failover.
nats.jetstream.max_message_age_secondsinteger220898160 (7 years)Maximum age in seconds before JetStream messages are expired. Set to 7 years for long-term audit retention.
scylladb.endpoints[]string["localhost:9042"]ScyllaDB/Cassandra contact points. The driver discovers additional nodes from these seeds.
scylladb.keyspacestring"sankofa_engine"ScyllaDB keyspace name where all tables reside.
scylladb.read_consistencystring"ONE"Read consistency level. Common values: ONE, QUORUM, LOCAL_QUORUM.
scylladb.request_timeoutstring"30s"Timeout for individual ScyllaDB requests. Go duration format (e.g., 30s, 1m).
kms.providerstring"local"Key management provider. "local" for development, "aws" for AWS KMS in production.
kms.regionstring"us-east-1"Cloud provider region for the KMS service.
openbao.addressstring"http://localhost:8200"OpenBao (Vault-compatible) server address for transit encryption.
openbao.tokenstring"dev-root-token"Authentication token for OpenBao. Use a provisioned secret in production.
openbao.transit_mountstring"transit"Mount path for the OpenBao transit secrets engine.
service.namestring"monolith"Service identity. Used for logging, metrics, and NATS subject routing. Values: monolith, api, shard-worker.
service.idstring""Unique instance identifier. Used to distinguish multiple instances of the same service.

Environment Variable Overrides

Environment variables take precedence over values in the config file. Use these to configure the engine in containerized or orchestrated environments.

Environment VariableConfig Field OverrideExample
CONFIG_PATHConfig file path/etc/sankofa/config.yaml
HTTP_PORTAPI listen port8080
NATS_CLUSTER_URLSnats.cluster_urlsnats://nats-1:4222,nats://nats-2:4222
SCYLLADB_ENDPOINTSscylladb.endpointsscylla-1:9042,scylla-2:9042
POSTGRESQL_CONN_STRINGPostgreSQL connectionpostgres://user:pass@host:5432/sankofa?sslmode=require
OPENBAO_ADDRESSopenbao.addresshttps://vault.internal:8200
OPENBAO_TOKENopenbao.token(provisioned secret)
SERVICE_NAMEservice.nameapi, shard-worker, etc.
WORKER_IDShard worker instance IDworker-0
SHARD_MAP_BUCKETNATS KV bucket nameshard-map

Service Configuration Matrix

Different services use different subsets of the configuration. The table below shows which config sections each service requires.

Config Sectionmonolithapishard-worker
shard_countYesYesYes
natsYesYesYes
scylladbYesNoYes
kmsYesNoYes
openbaoYesNoYes
serviceYesYesYes
  • monolith – Runs all components in a single process. Requires the full configuration.
  • api – Stateless HTTP gateway. Needs NATS to forward requests to shard workers but does not access ScyllaDB or KMS directly.
  • shard-worker – Processes transactions for assigned shards. Requires database, encryption, and messaging configuration.

Example: Production Configuration

shard_count: 16

nats:
  cluster_urls:
    - "nats://nats-1.internal:4222"
    - "nats://nats-2.internal:4222"
    - "nats://nats-3.internal:4222"
  jetstream:
    max_message_age_seconds: 220898160

scylladb:
  endpoints:
    - "scylla-1.internal:9042"
    - "scylla-2.internal:9042"
    - "scylla-3.internal:9042"
  keyspace: "sankofa_engine"
  read_consistency: "LOCAL_QUORUM"
  request_timeout: "10s"

kms:
  provider: "aws"
  region: "us-east-1"

openbao:
  address: "https://vault.internal:8200"
  token: ""  # Set via OPENBAO_TOKEN env var
  transit_mount: "transit"

service:
  name: "shard-worker"
  id: ""  # Set via WORKER_ID env var