# Environmental Variables

# Overview

The AR.IO Gateway allows configuration customization through environmental variables. These variables dictate the gateway's behavior, from block synchronization settings to log formatting. Detailed below is a table enumerating all available environmental variables, their respective types, default values, and a brief description. Note that certain variables, such as SANDBOX_PROTOCOL, rely on others (e.g., ARNS_ROOT_HOST) to function effectively. Ensure proper understanding of these dependencies when configuring.

# Variables

Sets the location for chunked data to be saved. If omitted, chunked data will be stored in the `data` directory Sets the location for contiguous data to be saved. If omitted, contiguous data will be stored in the `data` directory Sets the location for header data to be saved. If omitted, header data will be stored in the `data` directory Sets the location for sqlite indexed data to be saved. If omitted, sqlite data will be stored in the `data` directory Sets the location for temporary data to be saved. If omitted, temporary data will be stored in the `data` directory Sets the location for LMDB data to be saved. If omitted, LMDB data will be stored in the `data` directory
ENV Name Type Default Value Description
START_HEIGHT Number or "Infinity" 0 Starting block height for node synchronization (0 = start from genesis block)
STOP_HEIGHT Number or "Infinity" "Infinity" Stop block height for node synchronization (Infinity = keep syncing until stopped)
TRUSTED_NODE_URL String "https://arweave.net" Arweave node to use for fetching data
TRUSTED_GATEWAY_URL String "https://arweave.net" Arweave node to use for proxying reqeusts
TRUSTED_ARNS_GATEWAY_URL String https://NAME.arweave.dev ArNS gateway
INSTANCE_ID String "" Adds an "INSTANCE_ID" field to output logs
LOG_FORMAT String "simple" Sets the format of output logs, accepts "simple" and "json"
SKIP_CACHE Boolean false If true, skips the local cache and always fetches headers from the node
PORT Number 4000 AR.IO node exposed port number
SIMULATED_REQUEST_FAILURE_RATE Number 0 Number from 0 to 1, representing the probability of a request failing
AR_IO_WALLET String "" Arweave wallet address used for staking and rewards
ADMIN_API_KEY String Generated API key used for admin API requests (if not set, it is generated and logged into the console)
BACKFILL_BUNDLE_RECORDS Boolean false If true, AR.IO node will start indexing missing bundles
FILTER_CHANGE_REPROCESS Boolean false If true, all indexed bundles will be reprocessed with the new filters (you can use this when you change the filters)
ANS104_UNBUNDLE_FILTER String {"never": true} Only bundles compliant with this filter will be unbundled
ANS104_INDEX_FILTER String {"never": true} Only bundles compliant with this filter will be indexed
ARNS_ROOT_HOST String undefined Domain name for ArNS host
SANDBOX_PROTOCOL String undefined Protocol setting in process of creating sandbox domains in ArNS (ARNS_ROOT_HOST needs to be set for this env to have any effect) accepts "http" or "https"
START_WRITERS Boolean true If true, start indexing blocks, tx, ANS104 bundles
RUN_OBSERVER Boolean true If true, runs the Observer alongside the gateway to generate Network compliance reports
OBSERVER_WALLET String undefined The public wallet address of the wallet being used to sign report upload transactions for Observer
CHUNKS_DATA_PATH string "data/chunks"
CONTIGUOUS_DATA_PATH string "data/contiguous"
HEADERS_DATA_PATH string "data/headers"
SQLITE_DATA_PATH string "data/sqlite"
TEMP_DATA_PATH string "data/tmp"
LMDB_DATA_PATH string "data/LMDB"
CHAIN_CACHE_TYPE String "redis" Sets the method for caching chain data, defaults to redis if gateway is started with docker-compose, otherwise defaults to LMDB
REDIS_CACHE_URL String (URL) "redis://localhost:6379" URL of Redis database to be used for caching
REDIS_CACHE_TTL_SECONDS Number 28800 TTL value for Redis cache, defaults to 8 hours (28800 seconds)
ENABLE_FS_HEADER_CACHE_CLEANUP Boolean false If true, periodically deletes cached header data
NODE_JS_MAX_OLD_SPACE_SIZE Number system default Sets the memory limit, in Megabytes, for NodeJs. Default value depends on hardware
SUBMIT_CONTRACT_INTERACTIONS Boolean true If true, Observer will submit its generated reports to the ar.io Network. If false, reports will be generated but not submitted