consensys.teku

Ansible Role: Teku

Description

This Ansible role installs, configures, and runs Teku, which is a Java client for Ethereum 2 designed for enterprises.

Table of Contents

Supported Platforms

* MacOS
* Debian
* Ubuntu
* Redhat (CentOS/Fedora)
* Amazon

Dependencies

You need JDK version 11 or higher.

Role Variables:

All customizable variables are found in the defaults/main.yml file. These variables typically represent different configuration options. For more details, please refer to the Teku documentation.

Name Default Value Description
teku_version unset REQUIRED Version of Teku to install. Available versions can be found on our Teku releases page
teku_user teku The user for Teku
teku_group teku The group for Teku
teku_download_url https://artifacts.consensys.net/public/teku/raw/names/teku.tar.gz/versions/{{ teku_version }}/teku-{{ teku_version }}.tar.gz The URL for downloading Teku. You can change this if using a custom location like an internal repository.
teku_install_dir /opt/teku The directory where Teku will be installed
teku_config_dir /etc/teku The directory for the default configuration
teku_data_dir /opt/teku/data The data directory for Teku
teku_log_dir /var/log/teku The directory for log files
teku_log_filename {{ teku_log_dir }}/teku.log The location and filename for the log file
teku_profile_file /etc/profile.d/teku-path.sh The file that allows Teku to be added to the system PATH
teku_managed_service true Enables a systemd or launchd service
teku_launchd_dir /Library/LaunchAgents The default directory for launchd
teku_systemd_dir /etc/systemd/system/ The default directory for systemd
teku_systemd_state restarted Default state of the systemd service
teku_output_transition_dir /tmp/teku
teku_node_private_key_file ""
teku_network minimal Predefined network settings
teku_host_ip ""
teku_p2p_enabled True Enables or disables P2P communication
teku_p2p_interface 0.0.0.0 The network interface for P2P communication
teku_p2p_port 9000 Port for P2P communication (UDP and TCP)
teku_p2p_advertised_port 9000 The advertised port for P2P
teku_p2p_discovery_enabled True Enables or disables peer discovery
teku_interop_genesis_time 0
teku_interop_start_state ""
teku_interop_owned_validator_start_index 0
teku_interop_owned_validator_count 64
teku_interop_number_of_validators 64
teku_interop_enabled False
teku_validators_key_file "" Path to load unencrypted validator keys from a YAML file
teku_deposit_mode normal
teku_deposit_input_file ""
teku_deposit_number_validators 64
teku_deposit_contract_address 0x Contract address for deposits on Ethereum 1
teku_deposit_eth1_endpoint "" JSON-RPC URL for the Ethereum 1 node
teku_metrics_enabled True Set to true to enable metric exporting
teku_metrics_interface 0.0.0.0
teku_metrics_port 8008 Port for metrics when deployed as a single unit
teku_beacon_metrics_port 8008 Port for beacon service metrics when deployed separately
teku_validator_metrics_port 8009 Port for validator service metrics when deployed separately
teku_metrics_categories [] (All categories enabled) Categories for tracking metrics
teku_data_path /data Use the same directory for both validator and beacon service in standalone mode
teku_data_storage_mode prune Strategy for handling historical chain data
teku_beacon_rest_api_port 5051
teku_beacon_rest_api_docs_enabled False
teku_beacon_rest_api_enabled True Enable the REST API service
teku_beacon_rest_api_interface 127.0.0.1 Interface for the REST API service
teku_beacon_rest_api_host_allowlist ["*"] Allowed hosts for the REST API service
teku_cmdline_args []
teku_cmdline_args_beacon teku_cmdline_args For standalone mode. Set beacon-specific values
teku_cmdline_args_validator teku_cmdline_args For standalone mode. Set validator-specific values
teku_env_opts []
teku_env_opts_beacon teku_env_opts For standalone mode. Set beacon-specific environment options
teku_env_opts_validator teku_env_opts For standalone mode. Set validator-specific environment options
teku_standalone_validator False Run validator in standalone mode
teku_beacon_enabled True Whether to deploy the beacon node

Configuration Without Defaults

Here are some variables that don't have default values but can be configured when running Teku:

Name Configuration File Parameter Description
teku_data_beacon_path data-beacon-path Path to beacon data
teku_data_storage_archive_frequency data-storage-archive-frequency Frequency (in slots) to save finalized states on disk
teku_data_validator_path data-validator-path Path for validator client data
teku_ee_endpoint ee-endpoint URL for the execution engine endpoint
teku_ee_jwt_secret_file ee-jwt-secret-file File for reading execution engine JWT secret
teku_log_level logging Log levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL
teku_log_validator_duties log-include-validator-duties-enabled Log events related to validator duties
teku_p2p_discovery_bootnodes p2p-discovery-bootnodes List of bootnodes
teku_p2p_peer_lower_bound p2p-peer-lower-bound Minimum number of target peers
teku_p2p_peer_upper_bound p2p-peer-upper-bound Maximum number of target peers
teku_p2p_static_peers p2p-static-peers Static peers (e.g., ['peer1-address', 'peer2-address'])
teku_p2p_subscribe_all_subnets_enabled p2p-subscribe-all-subnets-enabled True/False
teku_validators_external_signer_public_keys validators-external-signer-public-keys List of external signer public keys (e.g., ['key1', 'key2'])
teku_validators_external_signer_timeout validators-external-signer-timeout Timeout (in milliseconds) for the external signing service
teku_validators_external_signer_url validators-external-signer-url URL for the external signing service
teku_validators_proposer_default_fee_recipient validators-proposer-default-fee-recipient Default fee recipient for proposing post-merge blocks
teku_validators_proposer_config validators-proposer-config URL or file path to load proposer configuration
teku_validators_proposer_config_refresh_enabled validators-proposer-config-refresh-enabled Whether to periodically refresh the proposer config
teku_validators_graffiti validators-graffiti Text to include during block creation
teku_validators_keystore_locking_enabled validators-keystore-locking-enabled Lock validator keystore files (Valid values: True, False)
teku_validators_performance_tracking_enabled validators-performance-tracking-enabled Enable performance tracking and logging (Valid values: True, False)
teku_validators_early_attestations_enabled validators-early-attestations-enabled Enable early attestation production (Valid values: True, False)
teku_ws_checkpoint ws-checkpoint Recent checkpoint within the weak subjectivity period (format: :)
teku_beacon_node_api_endpoints beacon-node-api-endpoints The beacon node API endpoints the validator client should connect to.

Standalone Mode

Teku can be set to run in two modes:

  1. Monolith Mode (both beacon and validator run in the same process)
  2. Standalone Mode (beacon and validator run in separate processes)

In Standalone Mode, the beacon service runs in its own process, and the validator service runs separately. The systemd service name for the beacon service is teku, and teku-validator is used for the validator service. The default setting in this Ansible role is Monolith Mode, but you can switch it to Standalone Mode using the variable teku_standalone_validator.

Example Playbook

  1. Default Setup:

    • Install the role from Galaxy:

      ansible-galaxy install pegasyseng.teku
      
    • Create a requirements.yml file and replace x.y.z with your desired Teku version from the Teku releases page:

      ---
      - hosts: localhost
        connection: local
        force_handlers: True
      
        roles:
        - role: pegasyseng.teku
          vars:
            teku_version: x.y.z
      
    • Run the playbook:

      ansible-playbook -v /path/to/requirements.yml
      
  2. Install via GitHub:

    ansible-galaxy install git+https://github.com/pegasyseng/ansible-role-teku.git
    
    • Create a requirements.yml file as above and replace x.y.z with your desired Teku version.
    • Run the playbook:
      ansible-playbook -v /path/to/requirements.yml
      

License

Apache

Author Information

PegaSysEng, 2020

Informazioni sul progetto

Teku is an open-source java enterprise ethereum 2 client

Installa
ansible-galaxy install consensys.teku
Licenza
Unknown
Download
6.2k
Proprietario
Consensys is the software engineering leader of the blockchain space. Our full-stack Ethereum products help developers build next-generation networks.