Guide | Operation Client Diversity: Migrate Prysm to Teku

Step by step guide on how to switch for the solo home or cloud staker.

🎊 Support us on Gitcoin Grants: We improve this guide with your support!πŸ™

⏩ Complete step by step guide

The following steps align with our mainnet guide. You may need to adjust file names and directory locations where appropriate. The core concepts remain the same.

πŸ”₯ Problem: Why the commotion?

If improving the stability of the beacon chain is not a good enough reason for you to switch from Prysm to either Teku or Nimbus, you also need to consider that due to the design of the beacon chain you will be subject to severe financial penalties if Prysm ever has an issue. ~Lamboshi on Twitter

πŸš€ Solution: Increase client diversity by migrating to Teku

🚧 How to Migrate from Prysm to Teku

PegaSys Teku (formerly known as Artemis) is a Java-based Ethereum 2.0 client designed & built to meet institutional needs and security requirements. PegaSys is an arm of ConsenSys dedicated to building enterprise-ready clients and tools for interacting with the core Ethereum platform. Teku is Apache 2 licensed and written in Java, a language notable for its materity & ubiquity.

⛓️ 1. Setup Teku CL

Install git.

Install Java 17 LTS

Verify Java 17+ is installed.

Install and build Teku.

This build process may take a few minutes.

Verify Teku was installed properly by displaying the version.

Copy the Teku binary file to /usr/bin/teku

Teku combines both the beacon chain and validator into one process.

Setup a directory structure for Teku.

Create your teku.yaml configuration file.

Paste the following configuration into the file.

  • Replace**<0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS>** with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

  • Replace <MY_GRAFFITI> with your own graffiti message. However for privacy and opsec reasons, avoid personal information. Optionally, leave it blank by deleting the flag option.

πŸ›‘ 2. Stop and disable Prysm

Stop and disable the Prysm services. Choose your guide.

Confirm the Prysm validator is stopped by checking the service status.

Delete existing Prysm validators keys so that there's no accidental starting of Prysm's validator.

As a double check, verify that Prysm validator can't find it's keys by starting the validator again.

Observe the logs and check for errors about missing validator keys.

Finally, stop Prysm validator.

🧱 3. Update firewall / port forwarding.

Allow Teku ports:

Delete Prysm firewall rules:

Verify that your firewall configuration is correct.

Example output of firewall configuration:

Your router's port forwarding setup or cloud provider settings will need to be updated to ensure your validator's firewall ports are open and reachable.

You'll need to add new port forwarding rules for Teku and remove the existing Prysm port forwarding rules.

Optional - Update your server and reboot for best practice.

πŸ—οΈ 4. Import Validator Keys

Copy your validator_keys directory to the data directory we created above and remove the extra deposit_data file. If you no longer have the validator keys on your node, you will need to restore from file backup or restore from secret recovery phrase.

Storing your keystore password in a text file is required so that Teku can decrypt and load your validators automatically.

Replace <my_keystore_password_goes_here> with your keystore password between the single quotation marks and then run the command to save it to validators-password.txt

Confirm that your keystore password is correct.

Move the password file and make it read-only.

Clear the bash history in order to remove traces of keystore password.

When specifying directories for your validator-keys, Teku expects to find identically named keystore and password files. For example keystore-m_12221_3600_1_0_0-11222333.json and keystore-m_12221_3600_1_0_0-11222333.txt

Create a corresponding password file for every one of your validators.

Verify that your validator's keystore and validator's passwords are present by checking the following directory.

Add validator-keys configuration to teku.yaml

πŸš€ 5. Setup and start the Teku service

Run the following to create a unit file to define yourbeacon-chain.service configuration.

Move the unit file to /etc/systemd/system

Update file permissions.

Run the following to enable auto-start at boot time and then start your beacon node service.

Syncing the beacon node might take up to 36 hours depending on your hardware. Keep validating using your current Prysm setup until it completes. However, thanks to Teku's Checkpoint sync, you'll complete this step in a few minutes.

Syncing is complete when your beacon node's slot matches that of a block explorer's slot number (i.e. https://beaconcha.in/)

Check the beacon node syncing progress with the following:

Check the logs to verify the services are working properly and ensure there are no errors.

πŸ›  Some helpful systemd commands

πŸ—„ Viewing and filtering logs

πŸ”Ž View the status of the beacon chain

πŸ” Restart the beacon chain

πŸ›‘ Stop the beacon chain

πŸ“‘ 6. Update Prometheus and Grafana monitoring

Select your Ethereum execution engine and then re-create your prometheus.yml configuration file to match Teku's metric's settings.

Move it to /etc/prometheus/prometheus.yml

Update file permissions.

Finally, restart the services.

Import your new Teku dashboard into Grafana.

  1. Open http://localhost:3000 or http://<your validator's ip address>:3000 in your local browser.

  2. Login with your credentials

  3. Download and save Teku's Dashboard json file.

  4. Click Create + icon > Import

  5. Add the ETH2 client dashboard via Upload JSON file

Teku by PegaSys Engineering

Credits: https://grafana.com/grafana/dashboards/13457

🌊 7. Clean up Prysm Storage

After a period of stable attestations on Teku, you can safely dispose of the former Prysm files and reclaim disk space.

πŸ™ Alternative Community Migration Guides

https://www.reddit.com/r/ethstaker/comments/pu30fa/short_guide_to_migrate_from_prysm_to_teku_or/

Last updated