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

ENV NameTypeDefault ValueDescription
START_HEIGHTNumber or "Infinity"0Starting block height for node synchronization (0 = start from genesis block)
STOP_HEIGHTNumber or "Infinity""Infinity"Stop block height for node synchronization (Infinity = keep syncing until stopped)
TRUSTED_NODE_URLString"https://arweave.net"Arweave node to use for fetching data
TRUSTED_GATEWAY_URLString"https://arweave.net"Arweave node to use for proxying reqeusts
TRUSTED_ARNS_GATEWAY_URLStringhttps://NAME.arweave.devArNS gateway
INSTANCE_IDString""Adds an "INSTANCE_ID" field to output logs
LOG_FORMATString"simple"Sets the format of output logs, accepts "simple" and "json"
SKIP_CACHEBooleanfalseIf true, skips the local cache and always fetches headers from the node
PORTNumber4000AR.IO node exposed port number
SIMULATED_REQUEST_FAILURE_RATENumber0Number from 0 to 1, representing the probability of a request failing
AR_IO_WALLETString""Arweave wallet address used for staking and rewards
ADMIN_API_KEYStringGeneratedAPI key used for admin API requests (if not set, it is generated and logged into the console)
BACKFILL_BUNDLE_RECORDSBooleanfalseIf true, AR.IO node will start indexing missing bundles
FILTER_CHANGE_REPROCESSBooleanfalseIf true, all indexed bundles will be reprocessed with the new filters (you can use this when you change the filters)
ANS104_UNBUNDLE_FILTERString{"never": true}Only bundles compliant with this filter will be unbundled
ANS104_INDEX_FILTERString{"never": true}Only bundles compliant with this filter will be indexed
ARNS_ROOT_HOSTStringundefinedDomain name for ArNS host
SANDBOX_PROTOCOLStringundefinedProtocol 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_WRITERSBooleantrueIf true, start indexing blocks, tx, ANS104 bundles
RUN_OBSERVERBooleantrueIf true, runs the Observer alongside the gateway to generate Network compliance reports
MIN_RELEASE_NUMBERstring"0"Sets the minimum Gateway release version to check while doing a gateway version assessment
AR_IO_NODE_RELEASEstring"0"Sets the current AR.IO node version to be set on X-AR-IO-Node-Release header on requests to the reference gateway
OBSERVER_WALLETStringundefinedThe public wallet address of the wallet being used to sign report upload transactions for Observer
CHUNKS_DATA_PATHstring"data/chunks"Sets the location for chunked data to be saved. If omitted, chunked data will be stored in the `data` directory
CONTIGUOUS_DATA_PATHstring"data/contiguous"Sets the location for contiguous data to be saved. If omitted, contiguous data will be stored in the `data` directory
HEADERS_DATA_PATHstring"data/headers"Sets the location for header data to be saved. If omitted, header data will be stored in the `data` directory
SQLITE_DATA_PATHstring"data/sqlite"Sets the location for sqlite indexed data to be saved. If omitted, sqlite data will be stored in the `data` directory
TEMP_DATA_PATHstring"data/tmp"Sets the location for temporary data to be saved. If omitted, temporary data will be stored in the `data` directory
LMDB_DATA_PATHstring"data/LMDB"Sets the location for LMDB data to be saved. If omitted, LMDB data will be stored in the `data` directory
CHAIN_CACHE_TYPEString"redis"Sets the method for caching chain data, defaults to redis if gateway is started with docker-compose, otherwise defaults to LMDB
REDIS_CACHE_URLString (URL)"redis://localhost:6379"URL of Redis database to be used for caching
REDIS_CACHE_TTL_SECONDSNumber28800TTL value for Redis cache, defaults to 8 hours (28800 seconds)
ENABLE_FS_HEADER_CACHE_CLEANUPBooleanfalseIf true, periodically deletes cached header data
NODE_JS_MAX_OLD_SPACE_SIZENumbersystem defaultSets the memory limit, in Megabytes, for NodeJs. Default value depends on hardware
SUBMIT_CONTRACT_INTERACTIONSBooleantrueIf true, Observer will submit its generated reports to the AR.IO Network. If false, reports will be generated but not submitted
REDIS_MAX_MEMORYString256mbSets the max memory allocated to Redis
REDIS_EXTRA_FLAGSString--save "" --appendonly noAdditional CLI flags passed to Redis
WEBHOOK_TARGET_SERVERSStringundefinedTarget servers for webhooks
WEBHOOK_INDEX_FILTERString{"never": true}Only emit webhooks for transactions and data items compliant with this filter
WEBHOOK_BLOCK_FILTERString{"never": true}Only emit webhooks for blocks compliant with this filter
CONTIGUOUS_DATA_CACHE_CLEANUP_THRESHOLDNumberundefinedSets the age threshold in seconds; files older than this are candidates for contiguous data cache cleanup
RUN_RESOLVERBooleanfalseIf true, enables the experimental local ArNS resolver service
TRUSTED_ARNS_RESOLVER_TYPEStringgatewaySets the type of ArNS resolver the gateway will use, either `gateway` or `resolver`. Set `resolver` to use experimental local ArNS resolver.
TRUSTED_ARNS_RESOLVER_URLStringhttps:__NAME__.arweave.devSets the url a gateway will use to request ArNS name resolution when type is set to `resolver`
ENABLE_MEMPOOL_WATCHERBooleanfalseIf true, the gateway will start indexing pending tx from the mempool
MEMPOOL_POLLING_INTERVAL_MSNumber30000Sets the mempool Polling interval, in milliseconds