Files
stacks-blockchain-api/.env
Matthew Little 3dec5d1b62 Merge branch 'master' into develop
# Conflicts:
#	.env
#	.github/workflows/ci.yml
#	.vscode/launch.json
#	package.json
#	src/api/init.ts
#	src/datastore/common.ts
#	src/datastore/pg-store.ts
#	src/event-stream/event-server.ts
#	src/event-stream/reader.ts
#	src/index.ts
#	src/test-utils/test-helpers.ts
#	src/tests-2.4/pox-3-delegate-aggregation.ts
#	src/tests-bns-e2e/bns-integration-tests.ts
#	src/tests-bns/v1-import-tests.ts
#	src/tests-tokens-metadata/tokens-metadata-tests.ts
2023-07-06 13:51:39 +02:00

184 lines
8.4 KiB
Bash

PG_HOST=127.0.0.1
PG_PORT=5490
PG_USER=postgres
PG_PASSWORD=postgres
PG_DATABASE=stacks_blockchain_api
PG_SCHEMA=public
PG_SSL=false
# Idle connection timeout in seconds, defaults to 30
# PG_IDLE_TIMEOUT=30
# Max connection lifetime in seconds, defaults to 60
# PG_MAX_LIFETIME=60
# Seconds before force-ending running queries on connection close, defaults to 5
# PG_CLOSE_TIMEOUT=5
# Can be any string, use to specify a use case specific to a deployment
PG_APPLICATION_NAME=stacks-blockchain-api
# The connection URI below can be used in place of the PG variables above,
# but if enabled it must be defined without others or omitted.
# PG_CONNECTION_URI=
# If your PG deployment implements a combination of primary server and read replicas, you should
# specify the values below to point to the primary server. The API will use primary when
# implementing LISTEN/NOTIFY postgres messages for websocket/socket.io support.
# To avoid any data inconsistencies across replicas, make sure to set `synchronous_commit` to
# `on` or `remote_apply` on the primary database's configuration.
# See https://www.postgresql.org/docs/12/runtime-config-wal.html
# Any value not provided here will fall back to the default equivalent above.
# PG_PRIMARY_HOST=
# PG_PRIMARY_PORT=
# PG_PRIMARY_USER=
# PG_PRIMARY_PASSWORD=
# PG_PRIMARY_DATABASE=
# PG_PRIMARY_SCHEMA=
# PG_PRIMARY_SSL=
# PG_PRIMARY_IDLE_TIMEOUT=
# PG_PRIMARY_MAX_LIFETIME=
# PG_PRIMARY_CLOSE_TIMEOUT=
# The connection URI below can be used in place of the PG variables above,
# but if enabled it must be defined without others or omitted.
# PG_PRIMARY_CONNECTION_URI=
# Limit to how many concurrent connections can be created, defaults to 10
# PG_CONNECTION_POOL_MAX=10
# If specified, controls the Stacks Blockchain API mode. The possible values are:
# * `readonly`: Runs the API endpoints without an Event Server that listens to events from a node and
# writes them to the local database. The API will only read data from the PG database
# specified above to respond to requests.
# * `writeonly`: Runs the Event Server without API endpoints. Useful when looking to query the postgres
# database containing blockchain data exclusively without the overhead of a web server.
# * `offline`: Run the API endpoints without a stacks-node or postgres connection. In this mode,
# only the given Rosetta endpoints are supported:
# https://www.rosetta-api.org/docs/node_deployment.html#offline-mode-endpoints
# If not specified or any other value is provided, the API will run in the default `read-write` mode
# (with both Event Server and API endpoints).
# STACKS_API_MODE=
# Stacks nodes automatically perform garbage-collection by dropping transactions from the mempool if they
# are pending for more than 256 blocks. This variable controls the block age threshold at which the API will do
# the same.
# STACKS_MEMPOOL_TX_GARBAGE_COLLECTION_THRESHOLD=256
# If specified, an http server providing profiling capability endpoints will be opened on the given port.
# This port should not be publicly exposed.
# STACKS_PROFILER_PORT=9119
STACKS_CORE_EVENT_PORT=3700
STACKS_CORE_EVENT_HOST=127.0.0.1
STACKS_BLOCKCHAIN_API_PORT=3999
STACKS_BLOCKCHAIN_API_HOST=127.0.0.1
STACKS_CORE_RPC_HOST=127.0.0.1
STACKS_CORE_RPC_PORT=20443
# STACKS_CORE_PROXY_HOST=127.0.0.1
# STACKS_CORE_PROXY_PORT=20443
# Configure a path to a file containing additional stacks-node `POST /v2/tranascation` URLs for the /v2 proxy to mutlicast.
# The file should be a newline-delimited list of URLs.
# STACKS_API_EXTRA_TX_ENDPOINTS_FILE=./config/extra-tx-post-endpoints.txt
# STACKS_FAUCET_NODE_HOST=<IP or hostname>
# STACKS_FAUCET_NODE_PORT=<port number>
## configure the chainID/networkID; testnet: 0x80000000, mainnet: 0x00000001
STACKS_CHAIN_ID=0x00000001
# configure custom testnet and mainnet chainIDs for other networks such as subnets,
# multiple values can be set using comma-separated key-value pairs.
# TODO: currently configured with the default subnet testnet ID, the mainnet values
# are placeholders that should be replaced with the actual subnet mainnet chainID
CUSTOM_CHAIN_IDS=testnet=0x55005500,mainnet=12345678,mainnet=0xdeadbeaf
# If enabled, the API will skip the startup validation request to the stacks-node /v2/info RPC endpoint
# SKIP_STACKS_CHAIN_ID_CHECK=1
# Seconds to allow API components to shut down gracefully before force-killing them, defaults to 60
# STACKS_SHUTDOWN_FORCE_KILL_TIMEOUT=60
BTC_RPC_HOST=http://127.0.0.1
BTC_RPC_PORT=18443
BTC_RPC_USER=btc
BTC_RPC_PW=btc
BTC_FAUCET_PK=29c028009a8331358adcc61bb6397377c995d327ac0343ed8e8f1d4d3ef85c27
# The contracts used to query for inbound transactions
TESTNET_SEND_MANY_CONTRACT_ID=ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo
MAINNET_SEND_MANY_CONTRACT_ID=SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo
# Enable debug logging
# STACKS_API_LOG_LEVEL=debug
# Directory containing Stacks 1.0 BNS data extracted from https://storage.googleapis.com/blockstack-v1-migration-data/export-data.tar.gz
# BNS_IMPORT_DIR=/extracted/export-data-dir/
# Stacks blockchain node type (L1 or subnet). L1 by default.
# If STACKS_NODE_TYPE is set to subnet, BNS importer is skipped.
STACKS_NODE_TYPE=L1
# Override the default file path for the proxy cache control file
# STACKS_API_PROXY_CACHE_CONTROL_FILE=/path/to/.proxy-cache-control.json
# Enable token metadata processing. Disabled by default.
# STACKS_API_ENABLE_FT_METADATA=1
# STACKS_API_ENABLE_NFT_METADATA=1
# If token metadata processing is enabled, this variable determines how the API reacts to metadata processing failures.
# When strict mode is enabled, any failures caused by recoverable errors will be retried indefinitely. Otherwise,
# the API will give up after `STACKS_API_TOKEN_METADATA_MAX_RETRIES` is reached for that smart contract.
# STACKS_API_TOKEN_METADATA_STRICT_MODE=1
# Maximum number of times we'll try processing FT/NFT metadata for a specific smart contract if we've failed
# because of a recoverable error.
# Only used if `STACKS_API_TOKEN_METADATA_STRICT_MODE` is disabled.
# STACKS_API_TOKEN_METADATA_MAX_RETRIES=5
# Controls the token metadata error handling mode. The possible values are:
# * `warning`: If required metadata is not found, the API will issue a warning and not display data for that token.
# * `error`: If required metadata is not found, the API will throw an error.
# If not specified or any other value is provided, the mode will be set to `warning`.
# STACKS_API_TOKEN_METADATA_ERROR_MODE=warning
# Configure a script to handle image URLs during token metadata processing.
# This example script uses the `imgix.net` service to create CDN URLs.
# Must be an executable script that accepts the URL as the first program argument
# and outputs a result URL to stdout.
# STACKS_API_IMAGE_CACHE_PROCESSOR=./config/token-metadata-image-cache-imgix.js
# Env vars needed for the above sample `imgix` script:
# IMGIX_DOMAIN=https://<your domain>.imgix.net
# IMGIX_TOKEN=<your token>
# Web Socket ping interval to determine client availability, in seconds.
# STACKS_API_WS_PING_INTERVAL=5
# Web Socket ping timeout, in seconds. Clients will be dropped if they do not respond with a pong
# after this time has elapsed.
# STACKS_API_WS_PING_TIMEOUT=5
# Web Socket message timeout, in seconds. Clients will be dropped if they do not acknowledge a
# message after this time has elapsed.
# STACKS_API_WS_MESSAGE_TIMEOUT=5
# Web Socket update queue timeout, in seconds. When an update is scheduled (new block, tx update,
# etc.), we will allow this number of seconds to elapse to allow all subscribed clients to receive
# new data.
# STACKS_API_WS_UPDATE_QUEUE_TIMEOUT=5
# Specify max number of STX address to store in an in-memory LRU cache (CPU optimization).
# Defaults to 50,000, which should result in around 25 megabytes of additional memory usage.
# STACKS_ADDRESS_CACHE_SIZE=10000
# Specify a URL to redirect from /doc. If this URL is not provided, server renders local documentation
# of openapi.yaml for test / development NODE_ENV.
# For production, /doc is not served if this env var is not provided.
# API_DOCS_URL="https://docs.hiro.so/api"
# For use while syncing. Places the API into an "Initial Block Download(IBD)" mode,
# forcing it to stop any redundant processing until the node is fully synced up to its peers.
# Some examples of processing that are avoided are:
# REFRESH MATERIALIZED VIEW SQLs that are extremely CPU intensive on the PG instance, Mempool messages, etc.,
# IBD_MODE_UNTIL_BLOCK=