Shardeum Documentation
NodeRunValidator

Self Hosting

The instructions on this page are primarily written for Ubuntu/Linux operating systems. If you are using a different operating system you will need to adapt the commands and steps accordingly. The core concepts remain the same, but package installation methods and system commands may differ.

For true decentralization and censorship resistance, it's crucial to minimize reliance on cloud providers. Self-hosting your Shardeum validator on personal hardware offer several advantages:

  1. Enhanced network security and resilience
  2. Reduced risk of centralized points of failure
  3. Greater control over your node's operation and data

Shardeum nodes are versatile and can run on various personal hardware platforms:

  • Desktop computers
  • Laptops
  • Dedicated servers

While it's possible to run a validator on your everyday computer, it is generally recommended to use a dedicated machine for optimal performance and security. This approach ensures your validator operates consistently without interfering with your daily computing tasks.

By choosing to self-host, you're not just running a validator – you're actively contributing to the robustness and decentralization of the Shardeum network.

Benefits of operating a Shardeum validator

  • Earn SHM for securing the network.
  • Contribute to the security, scalability and decentralization of Shardeum.

Minimum Hardware Requirements

  • 250 GB SSD storage
  • Quad core CPU less than 10 years old if self hosting
  • Dual core CPU works if hosted with newer Xeons / EPYC
  • 16 GB of ram, 4+ GB of virtual memory recommended
  • Hosting: 8 GB RAM + 8 GB Virtual Memory

Access the terminal interface for Shell CLI commands:

(Press at the same time)
Ctrl + Alt + T

Install the Shardeum Validator

Install package managers

We will use curl in this tutorial to download files:

sudo apt-get install curl

Update package managers

sudo apt update

Install docker and docker.io

sudo apt install docker.io

Check that docker is working with (should return version 20.10.12 or higher):

docker --version

Download and Install Validator

Using cURL

To use the installer script, run the following command in your terminal:

curl -O https://raw.githubusercontent.com/shardeum/shardeum-validator/refs/heads/itn4/install.sh && chmod +x install.sh && ./install.sh

The terminal will ask questions about your setup settings.

Give permission to collect validator data for bug reporting:

By running this installer, you agree to allow the Shardeum team to collect this data. (y/n)?:

Enter y to setup the web based dashboard:

Do you want to run the web based Dashboard? (y/n):

Set a password for dashboard access:

Set the password to access the Dashboard:

Add a custom session port for the web based dashboard or hit enter for port 8080:

Enter the port (1025-65536) to access the web based Dashboard (default 8080):

Add a custom external IP address or use an automatically detected IP address:

If you wish to set an explicit external IP, enter an IPv4 address (default=auto):

Add a custom internal IP address or use an automatically detected IP address:

If you wish to set an explicit internal IP, enter an IPv4 address (default=auto):

Set the first p2p port (default 9001):

To run a validator on the Sphinx Atomium network, you will need to open two ports in your firewall.
This allows p2p communication between nodes.
Enter the first port (1025-65536) for p2p communication (default 9001):

Set the second p2p port (default 10001):

Enter the second port (1025-65536) for p2p communication (default 10001):

Add a custom path or install to root:

What base directory should the node use (defaults to ~/.shardeum):

Wait for the installation process to complete.

Using Docker

If you prefer to set up the validator directly using Docker, follow these steps:

docker pull ghcr.io/shardeum/shardeum-validator
docker run \
    --name shardeum-validator \
    -p 8080:8080 \
    -p 9001:9001 \
    -p 10001:10001 \
    -v $(pwd)/shardeum:/home/node/config \
    --restart=always \
    --detach \
    ghcr.io/shardeum/shardeum-validator:latest
docker exec -it shardeum-validator operator-cli gui set password "YOUR_NEW_PASSWORD"

Replace YOUR_NEW_PASSWORD with a secure password of your choice.

This will start the validator with the default ports, 8080 for the dashboard GUI, and 9001 and 10001 for the validator P2P ports. To change the default ports the validator uses, set the following environment variables. In this example:

  • The dashboard GUI port is set to 10080.
  • The validator P2P ports are set to 11001 (internal) and 12002 (external).
docker run \
    --name validator-dashboard \
    -p 10080:10080 \
    -p 11001:11001 \
    -p 12002:12002 \
    -e SHMINT=11001 \
    -e SHMEXT=12002 \
    -e DASHPORT=10080 \
    -v $(pwd)/shardeum:/home/node/config \
    --restart=always \
    --detach \
    ghcr.io/shardeum/shardeum-validator

To change the password for the dashboard GUI, run the set-password.sh script located in the ~/shardeum directory:

cd ~/shardeum
./set-password.sh

Open validator GUI

Go to your web browser and go to:

https://localhost:8080/

You might see a warning page when trying to access this address in your web browser. Ignore this warning and continue to the validator dashboard. Another way to work around this warning:

Enter the password you set during the installation process.

loginPage.png

You should now see the “Overview” page for the Shardeum Validator Dashboard in your web browser:

overviewBetanet.png

Start validator

Click the “Start Node” button in the top right white box:

if that does not work, you can also try running the following command on cli:

operator-cli start

Set password for logging into the GUI

operator-cli gui set password 123456 #log into the GUI with 123456 as your password

Monitor validator

Go to “Performance” to see your node’s hardware performance here:

performanceBetanet.png

For more details about your node status run the following inside the CLI:

operator-cli status

Connect Wallet to Shardeum Testnet

Connect to Shardeum Validator with your wallet by configuring the network with the network details here.

Get SHM from ITN Faucet

Claim testnet tokens from Shardeum Discord SHM Faucet.

Stake SHM to validator

GUI

After you start the validator, you will be asked to connect your wallet:

connectWalletBetanet.png

After you connect your wallet, click on the "Add Stake" button, you will see the following:

connectedWalletAddStake.png

-Stake Wallet Address [wallet connected]
-Nominee Public Key [filled in automatically while validator is running]
-Stake amount (SHM) [empty and is in units ether not wei]

This example has filled in 10 SHM tokens to stake.

Stake the specified minimum amount to start earning rewards.(For testnet, its 10 SHM)

Once all fields are filled, click the “Stake” button.

Your wallet will ask you to sign the transaction stake your SHM.

Once the transaction is signed and complete, you have staked your SHM tokens successfully.

If your node status is on Standby and you have 10 SHM or more staked, your validator node is setup correctly.

The network will automatically add your validator to be active in the network.

The time to be added as an active validator will vary based on network load and validators in the network.

CLI

You can also stake and unstake from the Validator CLI if you are not able to access a web browser for the Validator GUI.

Open validator CLI:

Make sure you are in the root directory by running:

cd shardeum

Start the CLI by running the following shell script:

./shell.sh

First, set your private key in your Validator CLI:

Be very careful with your private keys. We recommend you use a private key which has testnet tokens only to be safe.

Please note, this is not the recommended method for staking with the Shardeum validator. Mishandling of private key may result in loss of assets. Shardeum discards private key after the transaction is signed. Take precaution when extracting your private key.

export PRIV_KEY=<private_key>

Make sure your private key is stored in your Validator CLI by running:

echo $PRIV_KEY

Add stake with:

operator-cli stake 10

Check your stake amount with:

operator-cli stake_info <wallet_address>

Remove stake with:

operator-cli unstake

Validator

Version

It is necessary to keep your validator updated by checking the minimum version required and your current version periodically.

Run:

curl localhost:9001/nodeinfo

Update

  • Stop your validator before updating (you don't need to unstake though)
  • In your terminal, first exit from the container using
exit
cd ..
  • Run the following curl script
curl -O https://raw.githubusercontent.com/shardeum/shardeum-validator/refs/heads/itn4/install.sh && chmod +x install.sh && ./install.sh

You might manually have to start the GUI afterwards with:

operator-cli gui start
  • Check your currect version from either CLI or GUI and make sure it is the latest version.

CLI And GUI

Version

Run:

operator-cli version

Update

Run:

operator-cli update

Commands

To see all CLI commands, run:

operator-cli help

Uninstall Validator

Useful if your validator is outdated and you want to clean your last installation.

You can delete the validator folder while in your root directory with:

rm -rf .shardeum