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

← Swipe to see more →
ENV NameTypeDefault ValueDescription
GRAPHQL_HOSTStringarweave.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_PORTNumber443

Port for GraphQL queries. Used in conjunction with GRAPHQL_HOST to set up the proxy for GQL queries.

START_HEIGHTNumber or "Infinity"0

Starting 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_GATEWAYS_URLSStringTRUSTED_GATEWAY_URLA 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

Number0.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_IDString""Adds an "INSTANCE_ID" field to output logs
LOG_FORMATString"simple"

Sets the format of output logs, accepts "simple" and "json"

SKIP_CACHEBooleanfalse

If true, skips the local cache and always fetches headers from the node

PORTNumber4000AR.IO node exposed port number

SIMULATED_REQUEST_FAILURE_RATE

Number0

Number from 0 to 1, representing the probability of a request failing

AR_IO_WALLETString""

Arweave wallet address used for staking and rewards

ADMIN_API_KEYStringGenerated

API key used for admin API requests (if not set, it is generated and logged into the console)

ADMIN_API_KEY_FILEStringGenerated

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_RECORDSBooleanfalse

If true, AR.IO node will start indexing missing bundles

FILTER_CHANGE_REPROCESSBooleanfalse

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

Strings3,trusted-gateways,chunks,tx-data

Data source retrieval order for on-demand data requests

BACKGROUND_RETRIEVAL_ORDER

Stringchunks,s3,trusted-gateways,chunks,tx-data

Data source retrieval order for background data requests (i.e., unbundling)

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

ANS104_DOWNLOAD_WORKERSString5

Sets the number of ANS-104 bundles to attempt to download in parallel

ANS104_UNBUNDLE_WORKERSNumber0, or 1 if filters are set

Sets the number of workers used to handle unbundling

DATA_ITEM_FLUSH_COUNT_THRESHOLD

Number1000

Sets the number of new data items indexed before flushing to stable data items

MAX_FLUSH_INTERVAL_SECONDS

Number600

Sets the maximum time interval in seconds before flushing to stable data items

WRITE_ANS104_DATA_ITEM_DB_SIGNATURES

Booleanfalse

If true, the data item signatures will be written to the database

WRITE_TRANSACTION_DB_SIGNATURES

Booleantrue

If true, the transactions signatures will be written to the database

ENABLE_DATA_DB_WAL_CLEANUP

Booleanfalse

If true, the data database WAL cleanup worker will be enabled

ENABLE_BACKGROUND_DATA_VERIFICATION

Booleanfalse

If true, unverified data will be verified in background

MAX_DATA_ITEM_QUEUE_SIZE

Number100000

Sets the maximum number of data items to queue for indexing before skipping indexing new data items

ARNS_ROOT_HOSTStringundefinedDomain name for ArNS host
SANDBOX_PROTOCOLStringundefined

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_WRITERSBooleantrue

If true, start indexing blocks, tx, ANS104 bundles

RUN_OBSERVERBooleantrue

If true, run observer (ARIO processes), requires WALLET env var to be set

WALLETStringN/AWallet 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

Number1000

Sets the number of contiguous data items to cache before cleaning up

ENABLE_FS_HEADER_CACHE_CLEANUP

Booleantrue

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

Number2000

Sets the height threshold for which to clean up headers

CHUNK_DATA_CACHE_CLEANUP_THRESHOLD

Number250000

Sets the number of chunks to cache before cleaning up

MANIFEST_CACHE_CLEANUP_THRESHOLD

Number250000

Sets the number of data items to cache before cleaning up manifest cache

ANS104_DATA_INDEX_CACHE_CLEANUP_THRESHOLD

Number50000

Sets the number of data items to cache before cleaning up ANS-104 data index cache

REDIS_CACHE_URLStringundefined

Redis cache URL for external caching of data items, chunks, and tx headers

REDIS_CACHE_TTL_SECONDSNumber3600TTL in seconds for Redis cache entries
AWS_S3_BUCKETStringundefinedAWS S3 bucket to save/retrieve block files
AWS_REGIONStringus-east-1AWS S3 bucket region
AWS_ENDPOINTString"https://s3.amazonaws.com"AWS S3 bucket endpoint
AWS_ACCESS_KEY_IDStringundefinedAWS S3 bucket access key
AWS_SECRET_ACCESS_KEYStringundefinedAWS S3 secret key
MIN_CONFIRMATIONSNumber10

Minimum number of confirmations needed for a transaction to be returned by the /tx endpoint

INDEX_BLOCKSBooleantrue

If true, the gateway will index blocks as they're synced

INDEX_TXBooleantrue

If true, the gateway will index transactions as they're synced

INDEX_DATA_ITEMSBooleantrue

If true, the gateway will index data items as they're synced

INDEX_TX_OFFSET_LISTSBooleantrue

If true, the gateway will index the chunks of block data and transaction data offsets

ENABLE_MEMPOOL_WATCHERBooleanfalse

If true, the gateway will watch the mempool for new transactions and save the txs headers

ENABLE_WEBHOOKSBooleanfalse

If true, allows the gateway to act as a client and execute webhooks when local state changes

WEBHOOK_TARGET_SERVERSString""

Comma separated list of target webhook servers (URLs)

WEBHOOK_INDEX_FILTERString{"never": true}

Webhook events are emitted only if incoming transactions satisfy the specified filter

WEBHOOK_BLOCK_FILTERString{"never": true}

Block webhook events are emitted only if incoming block satisfies the specified filter

PROMETHEUS_METRICS_ENABLED

Booleanfalse

If true, the gateway will expose Prometheus compatible metrics via the /metrics endpoint

NODE_ENVStringdevelopmentNode.js environment setting
LOG_LEVELStringinfoLog verbosity level
← Swipe to see more →