Skip to content

Latest commit

 

History

History
167 lines (110 loc) · 5.19 KB

environment-variables.md

File metadata and controls

167 lines (110 loc) · 5.19 KB

Bifrost Gateway Environment Variables

bifrost-gateway ships with some implicit defaults that can be adjusted via env variables below.

Configuration

KUBO_RPC_URL

Single URL or a comma separated list of RPC endpoints that provide /api/v0 RPC from Kubo.

The URL will be used for handling a subset of legacy /api/v0 commands, and also for IPNS Record resolution (via /api/v0/dht/query RPC).

If this is not set, the /api/v0 is not exposed, and IPNS_RECORD_GATEWAY_URL has to be set for IPNS resolution to work.

BLOCK_CACHE_SIZE

Default: see DefaultCacheBlockStoreSize

The size of in-memory 2Q cache with recently used and most requently used blocks.

GRAPH_BACKEND

Default: false

When set to true, requests to backend will use ?format=car in addition to ?format=raw to reduce the number of round trips.

This is an experimental feature that depends on pathing, dag-scope and entity-bytes parameters from IPIP-402.

Currently only https://l1s.strn.pl supports it, but our intention is to standardize it (IPIP-402) and add it to the trustless gateway spec and boxo/gateway reference library in the near feature.

Proxy Backend

PROXY_GATEWAY_URL

Single URL or a comma separated list of Gateway endpoints that support ?format=block|car|ipns-record responses. Either this variable or STRN_ORCHESTRATOR_URL must be set.

If this gateway does not support application/vnd.ipfs.ipns-record, you can use IPNS_RECORD_GATEWAY_URL to override the gateway address from which to retrieve IPNS Records from.

IPNS_RECORD_GATEWAY_URL

Single URL or a comma separated list of Gateway endpoints that support requests for application/vnd.ipfs.ipns-record. This is used for IPNS Record routing.

IPNS_RECORD_GATEWAY_URL also supports Routing V1 HTTP API for IPNS Record routing (IPIP-379). To use it, the provided URL must end with /routing/v1.

If not set, the IPNS records will be fetched from KUBO_RPC_URL.

Saturn Backend

STRN_ORCHESTRATOR_URL

Saturn Orchestrator that will provide a list of useful Saturn L1s (CDN points of presence).

STRN_LOGGER_URL

Saturn Logger used for fraud detection.

STRN_LOGGER_SECRET

JWT token provided by Saturn CDN. Staging (testnet) and production (mainnet) should use different tokens.

Logging

GOLOG_LOG_LEVEL

Specifies the log-level, both globally and on a per-subsystem basis. Level can be one of:

  • debug
  • info
  • warn
  • error
  • dpanic
  • panic
  • fatal

Per-subsystem levels can be specified with subsystem=level. One global level and one or more per-subsystem levels can be specified by separating them with commas.

Default: error

Example:

GOLOG_LOG_LEVEL="error,bifrost-gateway=debug,caboose=debug" bifrost-gateway

GOLOG_LOG_FMT

Specifies the log message format. It supports the following values:

  • color -- human readable, colorized (ANSI) output
  • nocolor -- human readable, plain-text output.
  • json -- structured JSON.

For example, to log structured JSON (for easier parsing):

export GOLOG_LOG_FMT="json"

The logging format defaults to color when the output is a terminal, and nocolor otherwise.

GOLOG_FILE

Sets the file to which the Bifrost Gateway logs. By default, the Bifrost Gateway logs to the standard error output.

GOLOG_TRACING_FILE

Sets the file to which the Bifrost Gateway sends tracing events. By default, tracing is disabled.

Warning: Enabling tracing will likely affect performance.

Testing

GATEWAY_CONFORMANCE_TEST

Setting to true enables support for test fixtures required by ipfs/gateway-conformance test suite.

IPFS_NS_MAP

Adds static namesys records for deterministic tests and debugging. Useful for testing /ipns/ support without having to do real IPNS/DNS lookup.

Example:

$ IPFS_NS_MAP="dnslink-test1.example.com:/ipfs/bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am,dnslink-test2.example.com:/ipns/dnslink-test1.example.com" ./gateway-binary
...
$ curl -is http://127.0.0.1:8081/dnslink-test2.example.com/ | grep Etag
Etag: "bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am"