Chainlink Node Setup

  1. Home
  2. Docs
  3. Chainlink Node Setup
  4. Configuration Variables

Configuration Variables

Official Listed Configuration Variables

ALLOW_ORIGINS

Specifies the addresses/URLs of allowed connections to the API on CLIENT_NODE_URL. Input may be a comma-separated (no spaces) list.

BRIDGE_RESPONSE_URL

  • Default: none

Represents the URL for bridges to send a response to.

CHAINLINK_DEV

  • Default: “false”

Configures “development” mode. Allows for use of the /service_agreements endpoint. Development purposes only. New features will occasionally be placed behind the “dev” flag, which refers to this configuration variable.

CHAINLINK_PORT

  • Default: “6688”

Port used for the API Reference and GUI.

CHAINLINK_TLS_HOST

  • Default: none

The hostname configured for TLS to be used by the Chainlink node. This is useful if you’ve configured a domain name specific for your Chainlink node.

CHAINLINK_TLS_PORT

  • Default: “6689”

The port used for HTTPS connections.

CHAINLINK_TLS_REDIRECT

  • Default: “false”

Forces TLS redirect for unencrypted connections.

CHAINLINK_TX_ATTEMPT_LIMIT

  • Default: “10”

Represents the maximum number of transaction attempts that the Chainlink node should allow to for a transaction.

CLIENT_NODE_URL

This is the URL that you will use to interact with the node, including the GUI.

DATABASE_TIMEOUT

  • Default: “500ms”

If the database file is already in use, the Chainlink node will wait the specified value (with a given time unit) for the database to become available.

DATABASE_URL

  • Default: none

As an alternative to using a local Sqlite database, you can provide a remote PostgreSQL URI.

DEFAULT_HTTP_LIMIT

  • Default: “32768”

Prevents an endpoint from returning a payload larger than 32kb (the default) via the HttpGet and HttpPost core adapters.

ETH_CHAIN_ID

  • Default: “0”

Represents the chain ID to use for transactions. The Ethereum client must support the eth_chainId RPC method. Use the following command (with RPC calls enabled) to call your Ethereum client to ensure that it’s supported. Geth and Parity’s latest versions should support this call.

curl -k -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"eth_chainId","id":1}' http://localhost:8545

ETH_GAS_BUMP_THRESHOLD

  • Default: “12”

The number of blocks to wait if the transaction has still not been confirmed before resubmitting the transaction.

ETH_GAS_BUMP_WEI

  • Default: “5000000000”

The amount of wei to increase for the resubmitted transaction.

ETH_GAS_PRICE_DEFAULT

  • Default: “20000000000”

The default gas price to use when submitting transactions to the blockchain. Can be used with the chainlink setgasprice to be updated while the node is still running.

ETH_URL

  • Default: “ws://localhost:8546”

This is the websocket address of the Ethereum client that the Chainlink node will connect to. All interaction with the Ethereum blockchain will occur through this connection.

EXPLORER_URL

  • Default: none

The Explorer websocket URL for the node to push stats to.

EXPLORER_ACCESS_KEY

  • Default: none

The access key for authenticating with the Explorer.

EXPLORER_SECRET

  • Default: none

The secret for authenticating with the Explorer.

JSON_CONSOLE

  • Default: “false”

Flag to print the console output in JSON or in human-friendly output.

LINK_CONTRACT_ADDRESS

  • Default: “0x514910771AF9Ca656af840dff83E8264EcF986CA”

The address of the LINK token contract. Used for displaying the node account’s LINK balance.

LOG_LEVEL

  • Default: “info”

The LOG_LEVEL environment variable determines both what is printed on the screen and what is written to the logfile, located at $ROOT/log.jsonl.

The available options are:

  • “debug”
  • “info”
  • “warn”
  • “error”
  • “panic”

LOG_SQL

  • Default: “false”

Tells Chainlink to log all SQL statements made using the default logger.

LOG_TO_DISK

  • Default: “true”

Enables or disables the node writing to the $ROOT/log.jsonl file.

MAXIMUM_SERVICE_DURATION

  • Default: “8760h”

The maximum duration that a service agreement can be valid for. Default is one year.

MIN_INCOMING_CONFIRMATIONS

  • Default: “3”

The number of block confirmations to wait before beginning a task run.

MIN_OUTGOING_CONFIRMATIONS

  • Default: “12”

The number of block confirmations to wait after a task run has been ran to regard it as “completed” in the node.

MINIMUM_CONTRACT_PAYMENT

  • Default: “1000000000000000000”

For jobs that use the EthTx adapter, this is the minimum payment amount in order for the node to accept and process the job. Since there are no decimals on the EVM, the value is represented like wei. This makes the default value 1 LINK.

MINIMUM_REQUEST_EXPIRATION

  • Default: “300”

Service agreement encumbrance parameter for the request expiration time.

MINIMUM_SERVICE_DURATION

  • Default: “0s”

The minimum duration that a service agreement can be valid for.

ORACLE_CONTRACT_ADDRESS

  • Default: none

The address of the oracle contract. This is used for the withdraw function from the node.

REAPER_EXPIRATION

  • Default: “240h”

Cleans up stale sessions in the node.

ROOT

  • Default: “~/.chainlink”

This is the directory where the db.sqlite3 and log.jsonl files reside. The db.sqlite3 file is the local database that the Chainlink node uses to keep track of JobSpecs, JobRuns, their status according to each interaction, and BridgeTypes (for external adapters). log.jsonl is the log as written by the Chainlink node, depending on the LOG_LEVEL specified by the environment variable’s value.

SECURE_COOKIES

  • Default: “true”

Requires the use of secure cookies for authentication. Set to false to enable standard http requests along with CHAINLINK_TLS_PORT=0.

SESSION_TIMEOUT

  • Default: “15m”

This value determines the amount of idle time to elapse before the GUI signs out users from their sessions.

TLS_CERT_PATH

  • Default: none

Location of the TLS certificate file. Example: /home/$USER/.chainlink/tls/server.crt

TLS_KEY_PATH

  • Default: none

Location of the TLS private key file. Example: /home/$USER/.chainlink/tls/server.key

Gas controls

Use this section to tune your node’s gas limits and pricing. In most cases, leaving these values at their defaults should give good results.

ETH_GAS_LIMIT_DEFAULT

  • Default: 500000

The default gas limit. This should not need to be changed in most cases. Certain applications (e.g. keeper) might override this with application-specific gas limits.

ETH_GAS_LIMIT_TRANSFER

  • Default: 21000

The gas limit to be used for eth->eth transfers.

ETH_GAS_BUMP_PERCENT

  • Default: automatic based on chain ID

The percentage by which to bump gas on a transaction that has exceeded ETH_GAS_BUMP_THRESHOLD. The larger of ETH_GAS_BUMP_PERCENT and ETH_GAS_BUMP_WEI is taken for gas bumps.

ETH_GAS_BUMP_THRESHOLD

  • Default: automatic based on chain ID

Chainlink can configured to automatically bump gas on transactions that have been stuck waiting in the mempool for at least this many blocks. Set to 0 to disable gas bumping completely.

ETH_GAS_BUMP_WEI

  • Default: automatic based on chain ID

The minimum fixed amount of wei by which gas is bumped on each transaction attempt.

ETH_GAS_PRICE_DEFAULT

  • Default: automatic based on chain ID

The default gas price to use when submitting transactions to the blockchain. Will be overridden by the in-built GasUpdater, and may be increased if gas bumping is enabled.

Can be used with the chainlink setgasprice to be updated while the node is still running.

ETH_MAX_GAS_PRICE_WEI

  • Default: automatic based on chain ID

Chainlink will never pay more than this for a transaction.

ETH_MIN_GAS_PRICE_WEI

  • Default: automatic based on chain ID

Chainlink will never pay less than this for a transaction.

It is possible to force chainlink to use a fixed gas price by setting a combination of these, e.g.

ETH_MAX_GAS_PRICE_WEI=100
ETH_MIN_GAS_PRICE_WEI=100
ETH_GAS_PRICE_DEFAULT=100
ETH_GAS_BUMP_THRESHOLD=0
GAS_UPDATER_ENABLED=false

GAS_UPDATER_ENABLED

  • Default: automatic based chain ID

On by default for most chains. When enabled, dynamically adjusts default gas price based on heuristics from mined blocks.

GAS_UPDATER_TRANSACTION_PERCENTILE

  • Default: "60"

Must be in range 0-100.

Only has an effect if gas updater is enabled. Specifies percentile gas price to choose. E.g. if the block history contains four transactions with gas prices [100, 200, 300, 400] then picking 25 for this number will give a value of 200. If the calculated gas price is higher than ETH_GAS_PRICE_DEFAULT then the higher price will be used as the base price for new transactions.

Think of this number as an indicator of how aggressive you want your node to price its transactions.

Setting this number higher will cause Chainlink to select higher gas prices.

Setting it lower will tend to set lower gas prices.

ETH_GAS_LIMIT_DEFAULT

  • Default: automatically set based on Chain ID, typically 500000

The default gas limit for outgoing transactions. Some job types (e.g. keeper) may set their own gas limit unrelated to this value.

ETH_GAS_LIMIT_TRANSFER

  • Default: automatically set based on Chain ID, typically 21000

The gas limit used for an ordinary eth->eth transfer.

Other env vars

ADMIN_CREDENTIALS_FILE

  • Default: $CHAINLINK_ROOT/apicredentials

ADMIN_CREDENTIALS_FILE optionally points to a text file containing admin credentials for logging in. It is useful for running client CLI commands and has no effect when passed to a running node.

The file should contain two lines, the first line is the username and second line is the password.
e.g.

myusername@example.com
mysecurepassw0rd

ALLOW_ORIGINS

  • Default: "http://localhost:3000,http://localhost:6688"

Specifies the addresses/URLs of allowed connections to the API on CLIENT_NODE_URL. Input may be a comma-separated (no spaces) list. You may experience CORS issues if this is not set correctly.

  • Default: "6688"

Port used for the Chainlink Node API Reference and GUI.

CLIENT_NODE_URL

  • Default: "http://localhost:6688"

This is the URL that you will use to interact with the node, including the GUI. It only has effect when using the chainlink client to run CLI commands.

DATABASE_BACKUP_FREQUENCY

  • Default: "0"

If set to a positive duration and DATABASE_BACKUP_MODE is not none, will dump the database at this regular interval.

Example:

DATABASE_BACKUP_FREQUENCY=1h

DATABASE_BACKUP_MODE

  • Default: "none"

Set the mode for automatic database backups. Can be one of nonelitefull. If enabled, Chainlink will automatically dump database backups at regular intervals.

none disables.
lite dumps small, essential tables.
full dumps the entire database.

DATABASE_BACKUP_URL

If specified, the automatic database backup will pull from this URL rather than the main DATABASE_URL. It is recommended to set this value to a read replica if you have one to avoid excessive load on the main database.

ETH_DISABLED

  • Default: "false"

Disable connection to eth node entirely. This can be useful in certain cases, e.g. to spin up a chainlink node and add jobs without having it execute anything.

EXPLORER_URL

  • Default: none

The Explorer websocket URL for the node to push stats to.

EXPLORER_ACCESS_KEY

  • Default: none

The access key for authenticating with the Explorer.

EXPLORER_SECRET

  • Default: none

The secret for authenticating with the Explorer.

JSON_CONSOLE

  • Default: "false"

Set to true to enable JSON logging. Otherwise will log in a human-friendly console format.

LOG_LEVEL

  • Default: "info"

The LOG_LEVEL environment variable determines both what is printed on the screen and what is written to the logfile, located at $ROOT/log.jsonl.

The available options are:

  • “debug”
  • “info”
  • “warn”
  • “error”
  • “panic”

LOG_SQL

  • Default: "false"

Tells Chainlink to log all SQL statements made using the default logger.

LOG_SQL_MIGRATIONS

  • Default: "true"

Tells Chainlink to log all SQL migrations made using the default logger.

LOG_TO_DISK

  • Default: "true"

Enables or disables the node writing to the $ROOT/log.jsonl file.

MIN_INCOMING_CONFIRMATIONS

  • Default: "3"

The number of block confirmations to wait before kicking off a job run. Setting this to a lower value improves node response time at the expense of occasionally submitting duplicate transactions in the event of chain re-orgs (duplicate transactions are harmless but cost some eth).

NOTE: The lowest value allowed here is 1, since setting to 0 would imply that logs are processed from the mempool before they are even mined into a block, which isn’t possible with Chainlink’s current architecture.

NOTE: This was formerly called MINIMUM_CONTRACT_PAYMENT, it will be removed in a future release.

  • Default: automatically set based on Chain ID, typically 100000000000000 (0.0001 LINK) on all chains except mainnet, where it is 1 LINK

For jobs that use the EthTx adapter, this is the minimum payment amount in order for the node to accept and process the job. Since there are no decimals on the EVM, the value is represented like wei.

Note

Keep in mind, the Chainlink node currently responds with a 500,000 gas limit. Under pricing your node could mean it spends more in ETH (on gas) than it earns in LINK.

OPERATOR_CONTRACT_ADDRESS

  • Default: none

The address of the Operator contract. Used to filter the contract addresses the node should listen to for Run Logs.

ORM_MAX_IDLE_CONNS

  • Default: "10"

Maximum number of idle database connections to keep open by the ORM. Reducing this can help if you are hitting postgres connection limits, at the expense of poorer chainlink node performance.

ORM_MAX_OPEN_CONNS

  • Default: "20"

Maximum number of open database connections from the ORM. Reducing this can help if you are hitting postgres connection limits, at the expense of poorer chainlink node performance.

ROOT

  • Default: "~/.chainlink"

This is the directory where the log.jsonl file resides. log.jsonl is the log as written by the Chainlink node, depending on the LOG_LEVEL specified by the environment variable’s value.

SECURE_COOKIES

  • Default: "true"

Requires the use of secure cookies for authentication. Set to false to enable standard http requests along with CHAINLINK_TLS_PORT=0.

SESSION_TIMEOUT

  • Default: "15m"

This value determines the amount of idle time to elapse before the GUI signs out users from their sessions.

Advanced

Caution: only change these if you really know what you are doing. Setting these wrongly can cause your node to get permanently stuck, requiring manual intervention to fix.

ETH_MAX_IN_FLIGHT_TRANSACTIONS

  • Default: 16

Controls how many transactions are allowed to be “in-flight” i.e. broadcast but unconfirmed at any one time. You can consider this a form of transaction throttling.

The default is set conservatively at 16 because this is a pessimistic minimum that both geth and parity will hold without evicting local transactions. If your node is falling behind and you need higher throughput, you can increase this setting, but you must make sure that your eth node is configured properly otherwise you can get nonce gapped.

0 value disables the limit. Use with caution.

ETH_MAX_QUEUED_TRANSACTIONS

  • Default: automatically set based on Chain ID, typically 250

The maximum number of unbroadcast transactions per key that are allowed to be enqueued before jobs will start failing and rejecting send of any further transactions. This represents a sanity limit and generally indicates a problem with your eth node (transactions are not getting mined).

Do NOT blindly increase this value thinking it will fix things if you start hitting this limit because transactions are not getting mined, you will instead only make things worse.

In deployments with very high burst rates, or on chains with large re-orgs, you may consider increasing this.

0 value disables any limit on queue size. Use with caution.

Misc notes

NOTE: Some env vars require a duration. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as “300ms”, “-1.5h” or “2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. Some examples:

10ms
1h15m
42m30s

Was this article helpful to you? Yes No

How can we help?