diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..4fbcf2d2 --- /dev/null +++ b/.env.example @@ -0,0 +1,56 @@ +# Starting block height for node synchronization (0 = start from the beginning) +# START_HEIGHT=0 + +# Stop block height for node synchronization (Infinity = keep syncing until stopped) +# STOP_HEIGHT="Infinity" + +# Arweave node to use for fetching data +# TRUSTED_NODE_URL="https://arweave.net" + +# Arweave node to use for proxying requests +# TRUSTED_GATEWAY_URL="https://arweave.net" + +# ArNS gateway +# TRUSTED_ARNS_GATEWAY_URL="https://__NAME__.arweave.dev" + +# If true, use indexed data as a cache and skip fetching data from the node +# SKIP_CACHE=false + +# Adds an "INSTANCE_ID" field to output logs +# INSTANCE_ID="" + +# Sets the format of output logs, accepts "simple" and "json" +# LOG_FORMAT="simple" + +# AR.IO node exposed port number +# PORT=4000 + +# Number from 0 to Infinity, representing the probability of a request failing +# SIMULATED_REQUEST_FAILURE_RATE=0 + +# Arweave wallet address used for staking and rewards +# AR_IO_WALLET="" + +# Admin key used for accessing the admin API +# ADMIN_API_KEY="secret" + +# If true, ar.io node will start indexing missing bundles +# BACKFILL_BUNDLE_RECORDS=false + +# If true, all indexed bundles will be reprocessed with the new filters (you can use this when you change the filters) +# FILTER_CHANGE_REPROCESS=false + +# Only bundles compliant with this filter will be unbundled +# ANS104_UNBUNDLE_FILTER={"never": true} + +# Only bundles compliant with this filter will be indexed +# ANS104_INDEX_FILTER={"never": true} + +# Root host for ArNS +# ARNS_ROOT_HOST="" + +# Protocol setting in process of creating sandbox domain in ArNS (ARNS_ROOT_HOST needs to be set for this env to have any effect) +# SANDBOX_PROTOCOL="" + +# If true, start indexing blocks, tx, ANS104 bundles +# START_WRITERS=true diff --git a/.gitignore b/.gitignore index 6e897ae4..4255f5a2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,8 @@ test-results.json /.vscode .DS_Store +# JetBrains +/.idea + # Exceptions !/data/.gitkeep diff --git a/docs/envs.md b/docs/envs.md new file mode 100644 index 00000000..d1e0d320 --- /dev/null +++ b/docs/envs.md @@ -0,0 +1,24 @@ +# ENVs +This document describes the environment variables that can be used to configure the `ar.io` node. + +| ENV_NAME | TYPE | DEFAULT_VALUE | DESCRIPTION | +|--------------------------------|----------------------|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------| +| START_HEIGHT | Number or "Infinity" | 0 | Starting block height for node synchronization (0 = start from the beginning) | +| 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 requests | +| TRUSTED_ARNS_GATEWAY_URL | String | "https://__NAME__.arweave.dev" | ArNS gateway | +| INSTANCE_ID | String | "" | Adds an "INSTACE_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, use indexed data as a cache and skip fetching data from the node | +| PORT | Number | 4000 | AR.IO node exposed port number | +| SIMULATED_REQUEST_FAILURE_RATE | Number | 0 | Number from 0 to Infinity, 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's 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 domain in ArNS (ARNS_ROOT_HOST needs to be set for this env to have any effect) | +| START_WRITERS | Boolean | true | If true, start indexing blocks, tx, ANS104 bundles | diff --git a/envoy/envoy.template.yaml b/envoy/envoy.template.yaml index 8968d2b6..c95fb9a6 100644 --- a/envoy/envoy.template.yaml +++ b/envoy/envoy.template.yaml @@ -97,6 +97,10 @@ static_resources: retry_on: '5xx,reset' num_retries: 5 - match: { prefix: '/' } + response_headers_to_add: + - header: + key: 'Cache-Control' + value: 'public, max-age=30' route: cluster: legacy_gateways retry_policy: