# Validator Node

Validator nodes are critical to the Sonic chain, responsible for validating transactions and creating new blocks in accordance with the [consensus protocol](https://docs.soniclabs.com/technology/consensus). These nodes ensure the integrity and security of the network by verifying data, participating in block creation, and maintaining the chain’s state.

Unlike [archive nodes](https://docs.soniclabs.com/sonic/node-deployment/archive-node), validator nodes focus on real-time operations rather than storing extensive historical data or responding to general API requests.

To run a validator node on the Sonic mainnet or testnet, follow the steps below.

## Steps to Run a Validator

1. [Launch a Server Instance](#id-1.-launch-a-server-instance)
2. [Install Required Development Tools](#id-2.-install-required-development-tools)
3. [Build the Sonic Node Software](#id-3.-build-the-sonic-node-software)
4. [Prime the Sonic Database](#id-4.-prime-the-sonic-database)
5. [Synchronize With the Network](#id-5.-synchronize-with-the-network)
6. [Create a Validator Wallet](#id-6.-create-a-validator-wallet)
7. [Create a Validator Signing Key](#id-7.-create-a-validator-signing-key)
8. [Register Your Validator](#id-8.-register-your-validator)
9. [Run Your Validator Node](#id-9.-run-your-validator-node)
10. [Validator Name and Logo](#id-10.-validator-name-and-logo)
11. [Next Steps](#id-10.-next-steps)

{% tabs %}
{% tab title="Validator Parameters" %}

* Minimum self-stake amount: 500,000 S
* Maximum validator size: 15x self-stake
* Rewards: \~6% APR initially, plus 15% of delegators' rewards and network fees

{% hint style="info" %}
The minimum self-stake on Sonic is set at 500,000 S to ensure security during the network's early months, with plans to gradually reduce it.
{% endhint %}
{% endtab %}

{% tab title="Network Resources" %}

* Mainnet RPC: [https://rpc.soniclabs.com](https://rpc.soniclabs.com/)
* Testnet RPC: [https://rpc.testnet.soniclabs.com](https://rpc.testnet.soniclabs.com/)
* WebSocket Endpoint: wss\://rpc.soniclabs.com
* Mainnet Explorer: [https://sonicscan.org](https://sonicscan.org/)
* Testnet Explorer: [https://testnet.sonicscan.org](https://sonicscan.org/)
* SFC Contract Address: [0xFC00FACE00000000000000000000000000000000](https://sonicscan.org/address/0xFC00FACE00000000000000000000000000000000)
* STI Contract (Validators' Information): [0xFf4cD89f549432c312c497628748d4d76AC180f6](https://sonicscan.org/address/0xFf4cD89f549432c312c497628748d4d76AC180f6)
* Genesis Files: [https://genesis.soniclabs.com](https://genesis.soniclabs.com/)
  {% endtab %}
  {% endtabs %}

## 1. Launch a Server Instance

You can run your validator node on dedicated hardware (bare metal) or use a cloud provider. We recommend choosing one of the established providers, such as Google GCP or Amazon AWS.

### Node Hardware Specifications

* At least 4 vCPUs and 32 GB of RAM
* At least 1 Gbps redundant backbone connectivity for stable and uninterrupted network traffic
* At least 1 TB of local SSD/NVMe storage. Remote block devices (e.g., AWS EBS) typically do not provide the required latency and random access performance. Google GCP N2D instances with local SSD or AWS i3en.xlarge with instance storage are good options.
* Ubuntu LTS Server (64-bit) or a similar Linux distribution is recommended.

### Required Storage Capacity

* 1 TB of local SSD/NVMe is sufficient for a validator database.

### Network Settings

A Sonic node requires both **TCP** and **UDP** network traffic allowed on port 5050 by default. You can use `--port <port>` to customize this if needed.

## 2. Install Required Development Tools

You need the essential build tools and the latest Go compiler, version 1.24 or newer, to build the Sonic client and its bundled tools. Example (Ubuntu/Debian):

```bash
sudo apt-get update
sudo apt-get install -y build-essential git
```

Install Go language compiler (Ubuntu/Debian):

```bash
sudo rm -rf /usr/local/go
wget https://go.dev/dl/go1.25.2.linux-amd64.tar.gz
sudo tar -xzf go1.25.2.linux-amd64.tar.gz -C /usr/local/
rm -f go1.25.2.linux-amd64.tar.gz

sudo tee /etc/profile.d/golang.sh > /dev/null <<EOT
export GOROOT=/usr/local/go
export GOPATH=\$HOME/go
export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin
EOT

source /etc/profile.d/golang.sh
```

## 3. Build the Sonic Node Software

Check the [latest Sonic release](https://github.com/0xsoniclabs/sonic/releases) and adjust commands if necessary:

```bash
git clone https://github.com/0xsoniclabs/Sonic.git
cd Sonic
git fetch --tags && git checkout -b v2.1.2 tags/v2.1.2
make all
```

You can confirm the Sonic release by running:

```bash
build/sonicd version
```

Optionally, copy the binaries to a system-wide location:

```bash
sudo mv build/sonic* /usr/local/bin/
```

## 4. Prime the Sonic Database

To participate in the Sonic network, you need a valid state database. The fastest way is to use a genesis file from the official repository. Download the [appropriate genesis file](https://genesis.soniclabs.com). For the mainnet, for example:

```bash
wget https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic.g
```

Use `sonictool` to prime the state database. Adjust `GOMEMLIMIT` and `--cache` according to your available RAM size. For the most common cases, use 12GiB as `--cache` and \~90% of RAM as `GOMEMLIMIT`.

```bash
GOMEMLIMIT=54GiB sonictool --datadir ~/.sonic \
    --cache 12000 genesis \
    --mode validator sonic.g
```

After processing, you should see a confirmation of a successfully imported state.

## 5. Synchronize With the Network

Now that your database is primed, start the node to synchronize it with the network. Ensure your firewall is configured correctly.

```bash
GOMEMLIMIT=54GiB sonicd --datadir ~/.sonic --cache 12000 --mode validator
```

The Sonic node will connect to the network and advance its state by processing new blocks. Once fully synchronized, the "age" of new blocks should be only a few seconds.

## 6. Create a Validator Wallet

Your Sonic node is now synchronizing. Next, create a wallet to identify and control your validator account. This wallet must hold the minimum amount you are going to use as the self-stake (500,000 S).&#x20;

We recommend creating the wallet securely (e.g. a hardware wallet). If you choose to create it locally using sonictool:

```bash
sonictool --datadir ~/.sonic account new
```

Important: Keep your wallet and keys secure. Never share them.&#x20;

## 7. Create a Validator Signing Key

A Sonic validator node signs consensus messages. Your node needs a validator signing key to participate. Create it on the server:

```bash
sonictool --datadir ~/.sonic validator new
```

Follow the prompts and set a secure password. Note the public key (starts with 0xc00). This key will be used during registration.

<figure><img src="https://1451584663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFigzFE2ScpiZHSkLRCev%2Fuploads%2FTgczsxM1oPFp6sejW0Ln%2Fvalidator-pk.png?alt=media&#x26;token=ad907a18-f14e-417a-ad79-a06e551bd11c" alt=""><figcaption></figcaption></figure>

Important: Back up your signing key. Although it cannot move funds, misuse could lead to penalties.

## 8. Register Your Validator

The network must recognize your validator key. Register by invoking the SFC (Staking and Consensus) contract:

* SFC Contract Address: [0xFC00FACE00000000000000000000000000000000](https://sonicscan.org/address/0xFC00FACE00000000000000000000000000000000)

Call createValidator with your validator public key and at least the minimum required stake (500,000 S). Sign this transaction with your validator wallet. After confirmation, query your validator ID using the getValidatorID function. The easiest way would be to open the [Sonic explorer](https://sonicscan.org) and navigate to the SFC address.

The contract is validated and you can interact with it using SonicScan and a connected Web3 wallet. The control validator account can be imported into your Web3 wallet either using the generated JSON key store or as your hardware wallet. With the account open, you can sign the createValidator transaction call specifying the amount of stake and the public key obtained in the previous step.

<figure><img src="https://1451584663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFigzFE2ScpiZHSkLRCev%2Fuploads%2F65RxGVz2pK6ygOODyfel%2Fsonicscan-registration.png?alt=media&#x26;token=8de43338-b81c-46ed-9122-e30e1dc19813" alt=""><figcaption></figcaption></figure>

## 9. Run Your Validator Node

Stop the currently running node:

```bash
pkill sonicd
```

Wait for it to gracefully shut down. Never force-terminate it, as it could corrupt the database. Restart your node in validator mode, providing the validator ID, public key, and password file:

```bash
GOMEMLIMIT=50GiB sonicd \
    --datadir ~/.sonic \
    --cache 12000 \
    --mode validator \
    --validator.id <your_validator_ID> \
    --validator.pubkey <your_public_key> \
    --validator.password <path_to_password_file>
```

Your validator node will now participate in consensus and produce blocks.

## 10. Validator Name and Logo

Create a config file in `JSON` format that contains the following parameters (you can also leave parameters empty):

```json
{
  "name": "VALIDATOR_NAME", /* Name of the validator */
  "logoUrl": "LOGO_URL", /* Validator logo (PNG|JPEG|SVG 100x100) starting https:// */
  "website": "WEBSITE_URL", /* Website icon on the right */
  "contact": "CONTACT_URL" /* Contact icon on the right */
}

/* It could look something like this 👇 */

{
  "name": "SonicLabs",
  "logoUrl": "https://repository.sonic.soniclabs.com/validator/sonic.svg",
  "website": "https://www.soniclabs.com",
  "contact": "https://www.soniclabs.com/contact"
}
```

Host it somewhere so it is publicly accessible, such as in [this example](https://repository.sonic.soniclabs.com/validator/soniclabs.json). Make sure anybody can download the JSON file using a browser and that the hosting site supports HTTPS. A 100x100 logo size is sufficient.

Now you need to insert the JSON URL into the STI contract.

1. Go to [SonicScan](https://sonicscan.org/) and open the [STI contract](https://sonicscan.org/address/0xFf4cD89f549432c312c497628748d4d76AC180f6#writeContract).
2. Hit *Contract* -> *Write Contract*.
3. Find the function *updateInfo* and paste the JSON URL.
4. Connect using your validator account Web3 wallet (the one you used to register).
5. Sign and execute the update.

<figure><img src="https://1451584663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFigzFE2ScpiZHSkLRCev%2Fuploads%2F5MiuOlZcvU4HZaDTiyQb%2FSTI.png?alt=media&#x26;token=6d3d23b0-5fe7-4ea1-a4a6-3c861b24e209" alt=""><figcaption></figcaption></figure>

## 11. Next Steps

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Validator/Name Logo</strong></td><td><p>You can set a validator name and logo on the explorer. Check <a href="https://github.com/block42-blockchain-company/fantom-staker-info">official repositories</a> for instructions.</p><p></p><p>The STI contract on Sonic: <a href="https://sonicscan.org/address/0xFf4cD89f549432c312c497628748d4d76AC180f6">0xFf4cD89f549432c312c497628748d4d76AC180f6</a></p></td><td></td></tr><tr><td><strong>Community and Help</strong></td><td>Join <a href="https://linktr.ee/soniclabs">Sonic community channels</a>, follow updates, and use your stake to participate in network governance. If you have issues, the community can provide guidance.</td><td></td></tr><tr><td><strong>Monitoring and Health</strong></td><td>If your node goes offline, you stop earning rewards. Extended downtime (e.g. more than 5 days) may result in suspension, requiring you to withdraw and start over. Regular monitoring, maintenance, and backups are essential.</td><td></td></tr></tbody></table>

Congratulations! You are now running a Sonic validator node.
