Skip to content

Configuration reference

The Federation Core reads all runtime configuration from environment variables. The reference below is the source-of-truth set from core/config/config.go and the shipping .env.example.

VariableDefaultNotes
SERVER_PORT8080HTTP listen port.
LOG_LEVELinfodebug / info / warn / error.
VariableDefaultNotes
DB_HOSTlocalhost
DB_PORT5432Note: docker-compose maps Postgres to host port 5433. When running the Federation Core on the host (not in Docker), set DB_PORT=5433.
DB_USERfedshield
DB_PASSWORDfedshield_devChange before production.
DB_NAMEfedshield
VariableDefaultNotes
REDIS_HOSTlocalhost
REDIS_PORT6379
VariableDefaultNotes
PEER_AUTH_ENABLEDfalseSet to true before production. Default is for local development convenience; with auth disabled, any caller can impersonate any peer.
VariableDefaultNotes
SCHEMA_VALIDATION_STRICTtrueReject events that fail JSON Schema validation. Keep true in production.
TIME_DECAY_HALF_LIFE_DAYS30Event weight is halved every N days.

Scoring engine — peer-weighting (EigenTrust)

Section titled “Scoring engine — peer-weighting (EigenTrust)”
VariableDefaultNotes
ENGINE_EIGENTRUST_ALPHA0.15Teleport probability. 0.15 matches the EigenTrust paper and PageRank’s damping factor.
ENGINE_EIGENTRUST_MAX_ITER50Iteration cap (protects the score-query latency budget).
ENGINE_EIGENTRUST_EPSILON1e-6Convergence threshold on max element delta between iterations.
ENGINE_LOW_TRUST_CUTOFF0.2Peers below this P_t are excluded from the aggregate. Calibration note: a three-peer collusion scenario (one honest, two adversaries) needs this lowered to 0.05 so the honest peer’s voice isn’t zeroed; see RESULTS.md.

Scoring engine — pre-trust seeds (gate G5)

Section titled “Scoring engine — pre-trust seeds (gate G5)”

Opt-in. With ENGINE_PRE_TRUST_ENABLED=false (default) the engine behaviour is bit-identical to the pre-G5 implementation. Pre-trusted peers have their P_t floored at ENGINE_PRE_TRUST_FLOOR and are exempt from the low-trust cutoff.

VariableDefaultNotes
ENGINE_PRE_TRUST_ENABLEDfalse
ENGINE_PRE_TRUST_PEERSemptyComma-separated peer IDs, e.g. peer-a-uuid,peer-d-uuid.
ENGINE_PRE_TRUST_FLOOR0.05Minimum P_t for pre-trusted peers.

Scoring engine — coordination detector (gate G5)

Section titled “Scoring engine — coordination detector (gate G5)”

Opt-in. With ENGINE_COORDINATION_ENABLED=false (default) the cluster detector returns nil and ApplyClusterCap is a no-op.

VariableDefaultNotes
ENGINE_COORDINATION_ENABLEDfalse
ENGINE_COORDINATION_MIN_EVENTS10Per-peer minimum event count before the detector evaluates them. Below this, sampling variance dominates JSD.
ENGINE_COORDINATION_SEVERITY_JSD0.15Max JSD on severity distributions to cluster.
ENGINE_COORDINATION_INTER_ARRIVAL_JSD0.20Max JSD on inter-arrival distributions to cluster.
ENGINE_COORDINATION_INFLUENCE_CAP0.5Multiplier on clustered peers’ P_t. Calibration note: the three-peer minimum-honest-majority case needs this tightened to 0.1 so the honest peer can dominate the aggregate.

For a federation with two bootstrap peers and active gate-G5 defence:

Terminal window
PEER_AUTH_ENABLED=true
SCHEMA_VALIDATION_STRICT=true
ENGINE_LOW_TRUST_CUTOFF=0.05
ENGINE_PRE_TRUST_ENABLED=true
ENGINE_PRE_TRUST_PEERS=peer-a-uuid,peer-d-uuid
ENGINE_PRE_TRUST_FLOOR=0.05
ENGINE_COORDINATION_ENABLED=true
ENGINE_COORDINATION_INFLUENCE_CAP=0.1

The other defaults are sensible. Tune the EigenTrust parameters only if you have a specific reason; they are well-calibrated for the prototype’s scale (a few to a few dozen peers).