Updated on April 13, 2020

Teku Command Line

This reference describes the syntax of the Teku Command Line Interface (CLI) options and subcommands.

Important

The command line interface options are currently under development and may change.

Specifying Options

Teku options can be specified:

If an option is specified in multiple places, the order of priority is command line, environment variable, configuration file.

Teku Environment Variables

For each command line option, the equivalent environment variable is:

  • Upper-case
  • - is replaced by _
  • Has a TEKU_ prefix

For example, set --p2p-port using the TEKU_P2P_PORT environment variable.

Options

To start a Teku node run:

Teku [OPTIONS] [COMMAND]

config-file

--config-file=<FILE>
--config-file=/home/me/me_node/config.yaml
TEKU_CONFIG_FILE=/home/me/me_node/config.yaml

The path to the YAML configuration file. The default is none.

data-path

--data-path=<PATH>
--data-path=/home/me/me_node
TEKU_DATA_PATH=/home/me/me_node
data-path="/home/me/me_node"

The path to the Teku data directory. The default is the directory in which Teku is installed or /opt/teku/database if using the Teku Docker image.

data-storage-mode

--data-storage-mode=<STORAGE_MODE>
--data-storage-mode=archive
TEKU_DATA_STORAGE_MODE=archive
data-storage-mode="archive"

Set the strategy for handling historical chain data. Valid options are prune and archive. Defaults to prune.

eth1-deposit-contract-address

--eth1-deposit-contract-address=<ADDRESS>
--eth1-deposit-contract-address=0x77f7bED277449F51505a4C54550B074030d989bC
TEKU_ETH1_DEPOSIT_CONTRACT_ADDRESS=0x77f7bED277449F51505a4C54550B074030d989bC
eth1-deposit-contract-address="0x77f7bED277449F51505a4C54550B074030d989bC"

Eth1 address of deposit contract.

eth1-endpoint

--eth1-endpoint=<URL>
--eth1-endpoint=http://localhost:8545
TEKU_ETH1_ENDPOINT=http://localhost:8545
eth1-endpoint="http://localhost:8545"

JSON-RPC URL of Eth1 node.

help

-h, --help

Show the help message and exit.

logging

-l, --logging=<LEVEL>
--logging=DEBUG

Sets the logging verbosity. Log levels are OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL. Default is INFO.

log-color-enabled

--log-color-enabled=<BOOLEAN>
--log-color-enabled=false
TEKU_LOG_COLOR_ENABLED=false
log-color-enabled=false

Specify whether status and event log messages include a console colour display code. Defaults to true.

log-destination

--log-destination=<LOG_DESTINATION>
--log-destination=console
TEKU_LOG_DESTINATION=console
log-destination="console"

Specify where to output log information. Valid options are:

  • console
  • file
  • both

Defaults to both.

log-file

--log-file=<FILENAME>
--log-file=teku_2020-01-01.log
TEKU_LOG_FILE=teku_2020-01-01.log
log-file="teku_2020-01-01.log"

Relative or absolute location, and filename of the log file.

log-file-name-pattern

--log-file-name-pattern=<REGEX>
--log-file-name-pattern=tekuL_%d{yyyy-MM-dd}.log
TEKU_LOG_FILE_NAME_PATTERN=tekuL_%d{yyyy-MM-dd}.log
log-file-name-pattern="tekuL_%d{yyyy-MM-dd}.log"

Filename pattern to apply when creating log files.

log-include-events-enabled

--log-include-events-enabled=<BOOLEAN>
--log-include-events-enabled=false
TEKU_LOG_INCLUDE_EVENTS_ENABLED=false
log-include-events-enabled=false

Specify whether to log frequent update events. For example every slot event with validators and attestations. Defaults to true.

metrics-enabled

--metrics-enabled=<BOOLEAN>
--metrics-enabled=true
TEKU_METRICS_ENABLED=true
metrics-enabled=true

Set to true to enable the metrics exporter. The default is false.

metrics-categories

--metrics-categories=<CATEGORY>[,<CATEGORY>...]...
--metrics-categories=BEACONCHAIN,JVM,PROCESS
TEKU_METRICS_CATEGORIES=BEACONCHAIN,JVM,PROCESS
metrics-categories=["BEACONCHAIN", "JVM", "PROCESS"]

Categories for which to track metrics. Options are BEACONCHAIN, JVM, PROCESS, NETWORK. All categories are enabled by default.

metrics-interface

--metrics-interface=<HOST>
--metrics-interface=192.168.10.101
TEKU_METRICS_INTERFACE=192.168.10.101
metrics-interface="192.168.10.101"

Host on which Prometheus accesses Teku metrics. The default is 127.0.0.1.

metrics-port

--metrics-port=<PORT>
--metrics-port=6174
TEKU_METRICS_PORT=6174
metrics-port="6174"

Specifies the port (TCP) on which Prometheus accesses Teku metrics. The default is 8008.

network

--network=<NETWORK>
--network=mainnet
BESU_NETWORK=mainnet
network="mainnet"

Predefined network configuration. The default is minimal.

p2p-advertised-ip

--p2p-advertised-ip=<IP_ADDRESS>
--p2p-advertised-ip=192.168.1.132
TEKU_P2P_ADVERTISED_IP=192.168.1.132
p2p-advertised-ip="192.168.1.132"

Advertised peer-to-peer IP address. Default is 127.0.0.1.

p2p-enabled

--p2p-enabled=<BOOLEAN>
--p2p-enabled=false
TEKU_P2P_ENABLED=false
p2p-enabled=false

Enables or disables all p2p communication. The default is true.

p2p-interface

--p2p-interface=<HOST>
--p2p-interface=192.168.1.132
TEKU_P2P_INTERFACE=192.168.1.132
p2p-interface="192.168.1.132"

Specifies the network interface on which the node listens for P2P communication. The default is 0.0.0.0 (all interfaces).

p2p-peer-lower-bound

--p2p-peer-lower-bound=<INTEGER>
--p2p-peer-lower-bound=25
TEKU_P2P_PEER_LOWER_BOUND=25
p2p-peer-lower-bound=25

Lower bound on the target number of peers. Defaults to 20.

p2p-peer-upper-bound

--p2p-peer-upper-bound=<INTEGER>
--p2p-peer-upper-bound=40
TEKU_P2P_PEER_UPPER_BOUND=40
p2p-peer-upper-bound=40

Upper bound on the target number of peers. Defaults to 30.

p2p-port

--p2p-port=<PORT>
# to listen on port 1789
--p2p-port=1789
# to listen on port 1789
TEKU_P2P_PORT=1789
p2p-port="1789"

Specifies the P2P listening ports (UDP and TCP). The default is 30303.

p2p-discovery-enabled

--p2p-discovery-enabled=<true|false>
--p2p-discovery-enabled=false
TEKU_P2P_DISCOVERY_ENABLED=false
p2p-discovery-enabled=false

Enables or disables P2P peer discovery. The default is true.

p2p-discovery-bootnodes

--p2p-discovery-bootnodes=<ENR_ADDRESS>[,<ENR_ADDRESS>...]...
--p2p-discovery-bootnodes=enr:-Iu4QG...wgiMo,enr:-Iu4QL...wgiMo
TEKU_P2P_DISCOVERY_BOOTNODES=enr:-Iu4QG...wgiMo,enr:-Iu4QL...wgiMo
p2p-discovery-bootnodes=["enr:-Iu4QG...wgiMo",
                         "enr:-Iu4QL...wgiMo"]

List of comma-separated Ethereum Node Records (ENRs) for P2P discovery bootstrap.

p2p-advertised-port

--p2p-advertised-port=<PORT>
--p2p-advertised-port=1789
TEKU_P2P_ADVERTISED_PORT=1789
p2p-port="1789"

The advertised P2P port. The default is the port specified in --p2p-port

p2p-private-key-file

--p2p-private-key-file=<PATH_TO_FILE>
--p2p-private-key-file=/home/me/me_node/key
TEKU_P2P_PRIVATE_KEY_FILE=/home/me/me_node/key
p2p-private-key-file="/home/me/me_node/key"

File containing the node’s private key.

p2p-static-peers

--p2p-static-peers=<ADDRESS>[,<ADDRESS>...]...
--p2p-static-peers=/ip4/151.150.191.80/tcp/9000/p2p/16Ui...aXRz,/ip4/151.150.191.80/tcp/9000/p2p/16Ui...q6f1
TEKU_P2P_STATIC-PEERS=/ip4/151.150.191.80/tcp/9000/p2p/16Ui...aXRz,/ip4/151.150.191.80/tcp/9000/p2p/16Ui...q6f1
p2p-static-peers=["/ip4/151.150.191.80/tcp/9000/p2p/16Ui...aXRz",
                  "/ip4/151.150.191.80/tcp/9000/p2p/16Ui...q6f1"]

List of comma-separated multiaddresses of static peers.

rest-api-enabled

--rest-api-enabled=<BOOLEAN>
--rest-api-enabled=true
TEKU_REST_API_ENABLED=true
rest-api-enabled=true

Set to true to enable the REST API service. The default is false.

rest-api-docs-enabled

--rest-api-docs-enabled=<BOOLEAN>
--rest-api-docs-enabled=true
TEKU_REST_API_DOCS_ENABLED=true
rest-api-docs-enabled=true

Set to true to enable the REST API documentation. The default is false.

The documentation can be accessed at http:<interface>:<port>/swagger-ui where:

rest-api-interface

--rest-api-interface=<HOST>
# to listen on all interfaces
--rest-api-interface=0.0.0.0
TEKU_REST_API_INTERFACE=0.0.0.0
rest-api-interface="0.0.0.0"

Specifies the interface on which the REST API listens. The default is 127.0.0.1.

rest-api-port

--rest-api-port=<PORT>
# to listen on port 3435
--rest-api-port=3435
TEKU_REST_API_PORT=3435
rest-api-port="3435"

Specifies REST API listening port (TCP). The default is 5051.

version

  -V, --version

Displays the version and exits.

validators-external-signer-public-keys

--validators-external-signer-public-keys=<KEY>[,<KEY>...]
--validators-external-signer-public-keys=0xa99a...e44c,0xb89b...4a0b
TEKU_VALIDATORS_EXTERNAL_SIGNER_PUBLIC_KEYS=0xa99a...e44c,0xb89b...4a0b
validators-external-signer-public-keys: ["0xa99a...e44c","0xb89b...4a0b"]

List of validator public keys used by an external signer (for example, Eth2Signer).

validators-external-signer-timeout

--validators-external-signer-timeout=<INTEGER>
--validators-external-signer-timeout=2000
TEKU_VALIDATORS_EXTERNAL_SIGNER_TIMEOUT=2000
validators-external-signer-timeout: 2000

Timeout in milliseconds for requests to the external signer. Default is 1000.

validators-external-signer-url

--validators-external-signer-url=<URL>
--validators-external-signer-url=http://localhost:9000
TEKU_VALIDATORS_EXTERNAL_SIGNER_URL=http://localhost:9000
validators-external-signer-url: "http://localhost:9000"

URL on which the external signer (for example, Eth2Signer) is running.

validators-key-file

--validators-key-file=<PATH_TO_FILE>
--validators-key-file=/home/me/me_node/key.yaml
TEKU_VALIDATORS_KEY_FILE=/home/me/me_node/key.yaml
validators-key-file: "/home/me/me_node/key.yaml"

Path to the YAML formatted file to load unencrypted validator keys from.

A YAML-formatted file that stores unencrypted validator keys can be generated using the teku validator generate --keys-output-path option.

validators-key-files

--validators-key-files=<FILENAME>[,<FILENAME>...]...
--validators-key-files=validator_0xa245...58cf.json,validator_0xb880...1f09.json
TEKU_VALIDATORS_KEY_FILES=validator_0xa245...58cf.json,validator_0xb880...1f09.json
validators-key-files: ["validator_0xa245...58cf.json","validator_0xb880...1f09.json"]

List of encrypted BLS12-381 keystore files to load the validator keys from.

The keystore files can be created when generating validators using the teku validator generate --keys-output-path option.

validators-key-password-files

--validators-key-password-files=<PASSWORDFILE>[,<PASSWORDFILE...]...
validators-key-password-files=/home/me/me_node/password1.txt,/home/me/me_node/password2.txt
TEKU_VALIDATORS_KEY_PASSWORD_FILES=/home/me/me_node/password1.txt,/home/me/me_node/password2.txt
validators-key-password-files: ["home/me/me_node/password1.txt","home/me/me_node/password2.txt"]

List of plain text files containing the password to decrypt the BLS12-381 keystore files.

Each keystore file requires its own password file. The password file must match the list position of the keystore file listed using --validators-key-files.