SAGE Configuration

SAGE reads one YAML file, in the same format as PATH. This page covers what a config needs and the blocks most operators set.

Info

The complete reference — every key, its type and what it does — is generated from SAGE’s source on each release: docs/configuration.md. It also lists the PATH keys SAGE parses but does not act on.

Two Rules

Unknown keys are reported, not rejected. SAGE must load a PATH config unmodified, so a key it does not recognise is collected and warned about at startup rather than failing the load. If you set a key and nothing changes, read the startup log first.

Zero is the safe default. There are no optional fields: an unset value and a zero value are the same, and each zero is chosen so the unconfigured state is the safe one. metrics_config.pprof_addr: "" means pprof is off, not listening everywhere.

Minimal Config

yaml
full_node_config:
  rpc_url: https://sauron-rpc.infra.pocket.network
  grpc_config:
    host_port: sauron-grpc.infra.pocket.network:443

gateway_config:
  gateway_mode: centralized
  gateway_address: "pokt1your_gateway_address"
  gateway_private_key_hex: "${SAGE_GATEWAY_KEY}"
  owned_apps_addresses:
    - "pokt1your_application_address"
  services:
    - id: eth
      type: evm
      rpc_types: [json_rpc, websocket]
KeyRequiredNotes
full_node_config.rpc_urlYesCometBFT RPC of a Shannon full node
full_node_config.grpc_config.host_portYesgRPC of the same node, used for sessions, apps and suppliers
gateway_config.gateway_modeYesMust be present; SAGE relays for its own applications whatever the value
gateway_config.gateway_addressYesThe staked gateway’s pokt1… address
gateway_config.gateway_private_key_hexYesThe key every relay is signed with
gateway_config.owned_apps_addressesOne of the twoApplications delegated to the gateway
gateway_config.owned_apps_private_keys_hexOne of the twoPATH’s spelling; SAGE derives the addresses and warns
gateway_config.services[]YesOne entry per service the gateway serves

Secrets from the Environment

Any value may be ${VAR}, expanded from the environment before the YAML is parsed. A variable that is unset or empty fails startup and names the variable, so a gateway never starts with an empty signing key. Use it to keep the file in version control and the keys out of it:

yaml
gateway_private_key_hex: "${SAGE_GATEWAY_KEY}"

Services

Each entry under gateway_config.services describes one service ID:

yaml
services:
  - id: eth
    type: evm               # evm | cosmos | solana | tron; anything else is passthrough
    rpc_types: [json_rpc, websocket]
    sync_allowance: 5       # blocks behind the head an endpoint may be and still be picked
    chain_id: "0x1"         # optional: health checks assert the endpoint serves this chain
  - id: osmosis
    type: cosmos
    rpc_types: [rest, comet_bft, json_rpc]
    rpc_type_fallbacks:
      comet_bft: json_rpc   # relay through json_rpc when no supplier staked comet_bft
  • rpc_types is the list of protocols the service accepts. A request of another type is refused with a 400 before any relay is sent.
  • sync_allowance: 0 means the plugin’s own default, which differs by chain.
  • blocked_suppliers lists supplier addresses never to route to for that service.
  • Per-service retry_config and timeout_config override the gateway-wide ones field by field.

Blocks Most Operators Set

BlockWhat it controls
gateway_config.retry_configmax_retries (rotates to another endpoint each time), hedge_delay (race a second endpoint after this long; 0 turns hedging off), max_latency (total budget across attempts)
gateway_config.active_health_checksProbe cadence and the checks themselves. With several replicas, only the elected leader sends probes
redis_configOptional. Shares flags, drains and circuit breakers across replicas, and gives a starting replica the leader’s reputation; see Operating
router_configRelay port (default 3069), body size limits, server timeouts, and trusted_proxies: the proxy ranges whose X-Forwarded-For SAGE believes
admin_configAdmin API address (default localhost:9091) and auth_token
metrics_configPrometheus address (default :9090); pprof_addr (off unless set)
logger_configLog level (default info)
feature_flagsOverrides for feature flags; anything unset keeps its default

Feature Flags

Much of SAGE’s behaviour sits behind feature flags, global and per service. Config carries only the overrides you set:

yaml
feature_flags:
  hedge: false   # no hedging on any service unless a per-service override says otherwise

Flags can also be toggled at runtime through the admin API, globally or for one service, without a restart:

bash
curl -X PUT localhost:9091/admin/flags/<flag>/<serviceID> -d '{"enabled":false}'

GET /admin/flags shows every flag and its state in force. The defaults are in featureflag/defaults.go.

Reloading

A changed config file applies without a restart through SIGHUP or POST /admin/reload. The response names what took effect and what needs a restart.

Reading the Startup Report

SAGE prints what it did with your config at startup, at a level the configured log level cannot hide:

LineMeaning
config key ignoredNo such setting in SAGE. It parsed and does nothing
config key is not implemented, and here is what decides this insteadA PATH key SAGE handles differently; the line says how
config key has no effectThe key parses into a field nothing reads
config setting is probably not what was meantThe value is read, and the line says what the gateway will actually do with it

None of these stop the process. Each means the gateway you are running differs from the one the file describes.