Configuration

Command line options

Please note, there are numerous options available that can be deployed to override the configuration on the runtime whilst starting the Lisk Core.

To overwrite config options from the command line, execute the following commands below:

  • Pass options as ENV variables

  • Pass options as flags

LISK_NETWORK=[network] LISK_CONFIG_FILE=[config-path] LISK_ADDRESS=[address] LISK_WS_PORT=[port] pm2 start lisk
The flag options are deprecated. Therefore it is recommend to pass the options as ENV variables.
node dist/index.js -p [port] -a [address] -c [config-path] -n [network]

You can pass devnet (default), alphanet, betanet, testnet, or mainnet for the [network] option.

All ENV variables are restricted with a operating system constraint of ENV variable maximum length.

Comma-separated lists will replace the original config values. For example, If LISK_PEERS is specified, the original peers.list specific to the network will be replaced completely.

Each of these options listed below can be appended in the command line:

Command line Option ENV Variable Description

--network
-n

LISK_NETWORK

Any of these options can be used devnet, alphanet, betanet, testnet, and mainnet. The default value is devnet.

--config
-c

LISK_CONFIG_FILE

Pass the custom configuration file, which will override values of the following: config/default/config.json.

--port
-p

LISK_WS_PORT

TCP port for P2P layer.

--http-port
-h

LISK_HTTP_PORT

TCP port for HTTP API.

--address
-a

LISK_ADDRESS

Listening host name or IP.

--log
-l

LISK_FILE_LOG_LEVEL

Log level for file output.

LISK_CONSOLE_LOG_LEVEL

Log level for console output.

LISK_CACHE_ENABLED

Enable or disable cache. Must be set to true/false.

--database
-d

LISK_DB_NAME

PostgreSQL database name to connect to.

LISK_DB_HOST

PostgreSQL database host name.

LISK_DB_PORT

PostgreSQL database port.

LISK_DB_USER

PostgreSQL database username to connect to.

LISK_DB_PASSWORD

PostgreSQL database password to connect to.

--redis
-r

LISK_REDIS_HOST

Redis host name.

LISK_REDIS_PORT

Redis port.

LISK_REDIS_DB_NAME

Redis database name to connect to.

LISK_REDIS_DB_PASSWORD

Redis database password to connect to.

--peers
-p

LISK_PEERS

Comma separated list of peers to connect to in the following format: 192.168.99.100:5000,172.169.99.77:5000

LISK_API_PUBLIC

Enable or disable public access of http API. Must be set to true/false.

LISK_API_WHITELIST

Comma separated list of IPs to enable API access. Format: 192.168.99.100,172.169.99.77

LISK_FORGING_DELEGATES

Comma separated list of delegates to load in the following format: publicKey|encryptedPassphrase,publicKey2|encryptedPassphrase2

LISK_FORGING_WHITELIST

Comma separated list of IPs to enable access to forging endpoints. Format: 192.168.99.100,172.169.99.77

--rebuild
-b

Rebuilds certain database tables on the basis of the local blockchain data. Must be followed by an integer, that specifies the last delegate round that should be part of the rebuild. If 0 is specified, all rounds are rebuilt.

LISK_CHILD_PROCESS_MODULES

Comma separated list of modules, that shall be loaded in a separate process. To enable inter process communication, set ipc.enabled to true inside the config.json file.

Config file structure

A breakdown of all available options for the configuration file can be found in the Lisk SDK docs.