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 Name | Type | Default Value | Description |
---|---|---|---|
GRAPHQL_HOST | String | arweave.net | Host for GraphQL queries. You may use any available gateway that supports GQL queries. If omitted, your node can support GQL queries on locally indexed transactions, but only L1 transactions are indexed by default. |
GRAPHQL_PORT | Number | 443 | Port for GraphQL queries. Used in conjunction with GRAPHQL_HOST to set up the proxy for GQL queries. |
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_GATEWAYS_URLS | String | TRUSTED_GATEWAY_URL | A JSON map of gateways and priority |
TRUSTED_GATEWAYS_REQUEST_TIMEOUT_MS | String | "10000" | Request timeout in milliseconds for trusted gateways |
TRUSTED_ARNS_GATEWAY_URL | String | "https://NAME.arweave.dev" | ArNS gateway |
WEIGHTED_PEERS_TEMPERATURE_DELTA | Number | 0.1 | Any positive number above 0, best to keep 1 or less. Used to determine the sensitivity of which the probability of failing or succeeding peers decreases or increases. |
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) |
ADMIN_API_KEY_FILE | String | Generated | Alternative way to set the API key used for admin API requests via filepath, it takes precedence over ADMIN_API_KEY if defined |
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) |
ON_DEMAND_RETRIEVAL_ORDER | String | s3,trusted-gateways,chunks,tx-data | Data source retrieval order for on-demand data requests |
BACKGROUND_RETRIEVAL_ORDER | String | chunks,s3,trusted-gateways,chunks,tx-data | Data source retrieval order for background data requests (i.e., unbundling) |
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 |
ANS104_DOWNLOAD_WORKERS | String | 5 | Sets the number of ANS-104 bundles to attempt to download in parallel |
ANS104_UNBUNDLE_WORKERS | Number | 0, or 1 if filters are set | Sets the number of workers used to handle unbundling |
DATA_ITEM_FLUSH_COUNT_THRESHOLD | Number | 1000 | Sets the number of new data items indexed before flushing to stable data items |
MAX_FLUSH_INTERVAL_SECONDS | Number | 600 | Sets the maximum time interval in seconds before flushing to stable data items |
WRITE_ANS104_DATA_ITEM_DB_SIGNATURES | Boolean | false | If true, the data item signatures will be written to the database |
WRITE_TRANSACTION_DB_SIGNATURES | Boolean | true | If true, the transactions signatures will be written to the database |
ENABLE_DATA_DB_WAL_CLEANUP | Boolean | false | If true, the data database WAL cleanup worker will be enabled |
ENABLE_BACKGROUND_DATA_VERIFICATION | Boolean | false | If true, unverified data will be verified in background |
MAX_DATA_ITEM_QUEUE_SIZE | Number | 100000 | Sets the maximum number of data items to queue for indexing before skipping indexing new data items |
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, run observer (ARIO processes), requires WALLET env var to be set |
WALLET | String | N/A | Wallet jwk file path for observer ario process |
LMDB_BLOCK_STORE_COMPRESSION | String | "gzip" | Accepts 'gzip', 'brotli', or 'none'. Compresses new blocks with specified algorithm before storing them in the local header store. Note: Changing this after blocks have been stored locally will require re-sync or remove local data to apply new compression setting to previously stored blocks. |
LMDB_BUNDLE_STORE_COMPRESSION | String | "gzip" | Accepts 'gzip', 'brotli', or 'none'. Compresses new bundles with specified algorithm before storing them in the local bundle store. Note: Changing this after bundles have been stored locally will require re-indexing to apply new compression setting to previously stored bundles. |
LMDB_DATA_ITEM_STORE_COMPRESSION | String | "gzip" | Accepts 'gzip', 'brotli', or 'none'. Compresses new data items with specified algorithm before storing them in the local data item store. Note: Changing this after data items have been stored locally will require re-indexing to apply new compression setting to previously stored data items. |
LMDB_TX_STORE_COMPRESSION | String | "gzip" | Accepts 'gzip', 'brotli', or 'none'. Compresses new transactions with specified algorithm before storing them in the local transaction store. Note: Changing this after transactions have been stored locally will require re-sync or remove local data to apply new compression setting to previously stored transactions. |
LMDB_DATA_STORE_COMPRESSION | String | "gzip" | Accepts 'gzip', 'brotli', or 'none'. Compresses new data with specified algorithm before storing them in the local data store. Note: Changing this after data has been stored locally will require re-sync or remove local data to apply new compression setting to previously stored data. |
CONTIGUOUS_DATA_CACHE_CLEANUP_THRESHOLD | Number | 1000 | Sets the number of contiguous data items to cache before cleaning up |
ENABLE_FS_HEADER_CACHE_CLEANUP | Boolean | true | If true, enable header cache cleanup for the fs cache (this will prune headers that are older than HEADER_CACHE_CLEANUP_THRESHOLD) |
HEADER_CACHE_CLEANUP_THRESHOLD | Number | 2000 | Sets the height threshold for which to clean up headers |
CHUNK_DATA_CACHE_CLEANUP_THRESHOLD | Number | 250000 | Sets the number of chunks to cache before cleaning up |
MANIFEST_CACHE_CLEANUP_THRESHOLD | Number | 250000 | Sets the number of data items to cache before cleaning up manifest cache |
ANS104_DATA_INDEX_CACHE_CLEANUP_THRESHOLD | Number | 50000 | Sets the number of data items to cache before cleaning up ANS-104 data index cache |
REDIS_CACHE_URL | String | undefined | Redis cache URL for external caching of data items, chunks, and tx headers |
REDIS_CACHE_TTL_SECONDS | Number | 3600 | TTL in seconds for Redis cache entries |
AWS_S3_BUCKET | String | undefined | AWS S3 bucket to save/retrieve block files |
AWS_REGION | String | us-east-1 | AWS S3 bucket region |
AWS_ENDPOINT | String | "https://s3.amazonaws.com" | AWS S3 bucket endpoint |
AWS_ACCESS_KEY_ID | String | undefined | AWS S3 bucket access key |
AWS_SECRET_ACCESS_KEY | String | undefined | AWS S3 secret key |
MIN_CONFIRMATIONS | Number | 10 | Minimum number of confirmations needed for a transaction to be returned by the /tx endpoint |
INDEX_BLOCKS | Boolean | true | If true, the gateway will index blocks as they're synced |
INDEX_TX | Boolean | true | If true, the gateway will index transactions as they're synced |
INDEX_DATA_ITEMS | Boolean | true | If true, the gateway will index data items as they're synced |
INDEX_TX_OFFSET_LISTS | Boolean | true | If true, the gateway will index the chunks of block data and transaction data offsets |
ENABLE_MEMPOOL_WATCHER | Boolean | false | If true, the gateway will watch the mempool for new transactions and save the txs headers |
ENABLE_WEBHOOKS | Boolean | false | If true, allows the gateway to act as a client and execute webhooks when local state changes |
WEBHOOK_TARGET_SERVERS | String | "" | Comma separated list of target webhook servers (URLs) |
WEBHOOK_INDEX_FILTER | String | {"never": true} | Webhook events are emitted only if incoming transactions satisfy the specified filter |
WEBHOOK_BLOCK_FILTER | String | {"never": true} | Block webhook events are emitted only if incoming block satisfies the specified filter |
PROMETHEUS_METRICS_ENABLED | Boolean | false | If true, the gateway will expose Prometheus compatible metrics via the /metrics endpoint |
NODE_ENV | String | development | Node.js environment setting |
LOG_LEVEL | String | info | Log verbosity level |