Upgrading from a previous version

How to upgrade Erigon to the latest release

Note: Always make sure to check the Release Page for specific upgrade notes or potential migration steps between versions, as certain updates might require additional steps or caution.

MacOS and Linux

To upgrade Erigon to a newer version when you've originally installed it via Git and manual compilation, you should follow these steps without needing to delete the entire folder:

  1. Terminate your Erigon session by pressing CTRL+C

  2. Navigate to your Erigon directory: Open your terminal and change to the directory containing your Erigon installation. If you followed the original instructions, this should simply be:

    cd erigon
  3. Fetch the latest changes from the repository: You need to make sure your local repository is up-to-date with the main GitHub repository. Run:

    git fetch --tags
  4. Check out the latest version and switch to it using:

    git checkout <new_version_tag>

    Replace <new_version_tag> with the version tag of the new release, for example:

    git checkout v2.60.5
  5. Rebuild Erigon: Since the codebase has changed, you need to compile the new version. Run:

    make erigon

This process updates your installation to the latest version you specify, while maintaining your existing data and configuration settings in the Erigon folder. You're essentially just replacing the executable with a newer version.

Homebrew

If you used Homebrew for installation simply run the following command to update to the latest release:

brew upgrade erigon

This command will handle all the necessary updates automatically.

Docker

If you're using Docker to run Erigon, the process to upgrade to a newer version of the software is straightforward and revolves around pulling the latest Docker image and then running it. Here's how you can upgrade Erigon using Docker:

  1. Pull the Latest Docker Image: First, find out the tag of the new release from the Erigon Docker Hub page. Avoid using the latest and stable tags since they may not always point to the most reliable versions. Once you know the tag, pull the new image:

    docker pull thorax/erigon:<new_version_tag>

    Replace <new_version_tag> with the actual version tag you wish to use. For example:

    docker pull thorax/erigon:v2.70.0
  2. List Your Docker Images: Check your downloaded images to confirm the new image is there and get the new image ID:

    docker images
  3. Stop the Running Erigon Container: If you have a currently running Erigon container, you'll need to stop it before you can start the new version. First, find the container ID by listing the running containers:

    docker ps

    Then stop the container using:

    docker stop <container_id>

    Replace <container_id> with the actual ID of the container running Erigon.

  4. Remove the Old Container: (Optional) If you want to clean up, you can remove the old container after stopping it:

    docker rm <container_id>
  5. Run the New Image: Now you can start a new container with the new Erigon version using the new image ID:

    docker run -it <new_image_id>

    You can append additional options to the command as required, for example:

    docker run -it <new_image_id> --internalcl --chain=goerli --prune=hrtc
  6. Verify Operation: Ensure that Erigon starts correctly and connects to the desired network, verifying the logs for any initial errors.

By following these steps, you'll keep your Docker setup clean and up-to-date with the latest Erigon version without needing to manually clean up or reconfigure your environment. Docker's ability to encapsulate software in containers simplifies upgrades and reduces conflicts with existing software on your machine.

Last updated