LogoLogo
WebsiteLinksMedia KitGitHub
  • Introduction
  • Sonic
    • Overview
    • S Token
    • Wallets
    • Sonic Gateway
    • Build on Sonic
      • Getting Started
      • Deploy Contracts
      • Verify Contracts
      • Tooling and Infra
      • Native USDC
      • Contract Addresses
      • Network Parameters
      • Integrating Staking
      • Programmatic Gateway
      • Gas Pricing
      • Learn Solidity
    • Node Deployment
      • Archive Node
      • Validator Node
      • Node Recovery
      • Upgrade Instructions (2.1)
    • FAQ
  • Funding
    • Sonic Airdrop
      • Claim (Season 1)
      • Sonic Points
      • Sonic Gems
      • Game Gems
    • Fee Monetization
      • Apply
      • Dispute
      • FeeM Vault
    • Innovator Fund
    • Sonic & Sodas
  • Technology
    • Overview
    • EVM Compatibility
    • Pectra Compatibility
      • Account Abstraction
      • Fee Subsidies
      • Dynamic Fees
      • Alternative Fee Payments
      • Tic-Tac-Toe Demo
    • Consensus
    • Database Storage
    • Proof of Stake
    • Version History
    • Audits
Powered by GitBook
On this page
Export as PDF
  1. Sonic
  2. Node Deployment

Upgrade Instructions (2.1)

PreviousNode RecoveryNextFAQ

Last updated 3 minutes ago

© 2025 Sonic Labs

CtrlK
  • Upgrade Steps Overview
  • 1. Build Sonic Client and Tooling
  • 2. Prime Sonic State DB From Genesis File (Optional)
  • 3. Restart Sonic Node With New Version and Synchronize
  • Runtime Settings

This guide describes the steps for upgrading a Sonic mainnet node to the latest 2.1 version.

Once upgraded, your nodes will continue to operate on the current mainnet until the full transition. The upgrade is backward compatible, meaning you can upgrade now without any interruption.

The guide covers the following steps:

  1. Build Sonic Client and Tooling

  2. Prime Sonic State DB From Genesis File (Optional)

  3. Restart Sonic Node With New Version and Synchronize

Reach out to Seg on Telegram for support.

Upgrade Steps Overview

  1. Update your operating system.

  2. Verify the version and upgrade the Golang version to v1.24 or newer as needed.

  3. Obtain the new Sonic release v2.1 source code from GitHub.

  4. Build the source code into a binary client.

  5. Update the active Sonic binary to the new one, and verify the proper version is used.

  6. Stop the currently running client gracefully.

  7. Verify the client is not running.

  8. Validators, pay attention to your node being recognized as in maintenance by the network before you proceed.

  9. Start the node with the new Sonic client version.

  10. Verify the new version is up and running.

1. Build Sonic Client and Tooling

Building the Sonic client binary requires the essential software compilation tools and the Go language version 1.24 or newer to be available. Please refer to your Linux distribution manuals to obtain the development tools on your system.

Build the Sonic client:

  1. Download the Sonic source code from the official GitHub repository. https://github.com/0xsoniclabs/sonic.git

  2. Switch to the most recent Sonic release. git fetch --tags && git checkout -b v2.1.0 tags/v2.1.0

  3. Build the Sonic binary using the provided configuration. make all

  4. Check the Sonic binary version (the most recent version is v2.1.0). build/sonicd version

  5. (Optional, root) Transfer the new binaries to the bin folder for system-wide access. sudo mv build/sonic* /usr/local/bin/

If you are reusing your existing Sonic client source code clone with a patch applied, this patch may prevent you from properly switching to the latest release.

We recommend either deleting the old source code repository and downloading the latest one or cleaning up your local copy using: git checkout -- .

2. Prime Sonic State DB From Genesis File (Optional)

This step applies only if you did not run the client before or you want to launch with a new, clean copy of the Sonic database.

Note that the database of the Sonic client versions 2.0.1 to 2.0.7 is fully compatible with the new Sonic client version v2.1.0. If your node has been running one of the versions v2.0.1 to v2.0.7, and the node has been shut down gracefully, your database can be reused, and you can skip this step.

Download the most recent Sonic network genesis file. Based on your node designated feature set, you need to choose between “pruned” and “full” versions of the genesis file. The pruned one is used by validators so that the database footprint is minimal. The full version contains all the network history and is used for the archive node.

The genesis file will be used to prime your database and will allow you to join the network and synchronize with it after priming. Please double-check the downloaded genesis file using the provided checksum.

You can obtain the selected genesis file here:

  • https://genesis.soniclabs.com/latest-sonic-full.g

  • https://genesis.soniclabs.com/latest-sonic-pruned.g

  1. Download the genesis file. wget https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic-38000-full.g

  2. (Optional) Download the genesis checksum file. wget https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic-38000-full.g.md5

  3. (Optional) Validate the genesis file consistency. md5sum --check sonic-38000-full.g.md Expected output is: sonic-38000-full.g: OK

Prime Sonic Database From Downloaded Genesis

Use the sonictool app (created during the building process as build/sonictool) to prime a validated archive state database for the Sonic client.

  • Start the genesis expansion for archive mode. GOMEMLIMIT=50GiB sonictool --datadir --cache 12000 genesis --mode rpc

  • Start the genesis expansion for validator mode. GOMEMLIMIT=50GiB sonictool --datadir --cache 12000 genesis --mode validator

The last step of the genesis processing is the state validation. Please check that the output log contains a message with the correct root hash:

StateDB imported successfully, stateRoot matches module=gossip-store index=42999003 root="6ee505...b8e7c0"

3. Restart Sonic Node With New Version and Synchronize

With the Sonic node binary created and the state database available, you are ready to start the node on the new version and synchronize its state with the network.

1. Stop Current Node

Stop the running instance gracefully. If you use Systemd manager to handle the Sonic node control, execute the stop procedure: systemctl stop sonicd

Other management systems may require different shutdown procedures. You may also use the general OS termination signal via pkill sonicd. But in this case, you need to make sure the client was terminated, and the control system did not attempt to restart it automatically.

Your Sonic node may need up to several minutes to close gracefully based on your system, configuration, and load. Please make sure your node is not closed forcefully. Your database would become corrupted otherwise.

Wait until the node terminates gracefully. Make sure the node is not running: ps aux|grep sonicd.

This step is extremely important for validators. If you run more than one client instance with the same validator key unlocked, your nodes may unintentionally violate the network rules, and your stake may be lost.

2. Start New Node

Use the node database path (<datadir>) from the previous installation or the new expansion created in the previous step.

Start the node using the new client version. systemctl start sonicd

Runtime Settings

Use ≈90% of the RAM as the GOMEMLIMIT value. The limit should always be set. If not done correctly, your node may experience random crashes and subsequent state database corruption. Use ≈12 GiB of the RAM as the --cache value.

Replace the <datadir> with the correct path to the database. We recommend that validators use the --mode validator flag to obtain a smaller database footprint. Different starting flags may need to be added to start an archive node with Web3 RPC and WebSocket interfaces on the node.

Please obtain and explicitly specify the external IP address of your node as a starting flag to help with the inter-node peer-to-peer connectivity.

GOMEMLIMIT=50GiB sonicd --datadir <datadir> --cache 12000 --nat extip:<public external IP address>