How to Run a Solana Node? | Cherry Servers (2024)

Solana network is a cutting-edge blockchain network known for its limitless scalability and lightning-fast transactions. If you'd like to be part of and actively participate in the Solana ecosystem, you can do so by running a Solana validator node.

This guide will walk you through how to run a Solana node, including setting it up and operating it. Doing this will help strengthen the network, validate transactions, and earn rewards.

#What is a Solana node?

A Solana node is a computer that validates transactions and blocks against the consensus rules implemented by the Solana protocol. A Solana node participates in the Solana blockchain network by storing a copy of the blockchain ledger.

#How to become a Solana validator?

To become a Solana validator, you'll need powerful computing resources, fast processors, significant RAM, and SSD storage. Keep reading to see what exactly is required and the step-by-step process on how to run a Solana node.

#Solana node requirements & tools

This guide includes some hands-on demonstrations. Below we list the key hardware and software requirements for running a Solana node. To follow along, you should have the following:

  • A dedicated server with extra volumes
  • A computer
  • Good internet

Server Hardware Specification

  • CPU
    • 12 cores/24 threads, or more
    • 2.8GHz base clock speed, or faster
    • SHA extensions instruction support
      • AMD Gen 3 or newer
      • Intel Ice Lake or newer
    • AVX2 instruction support (to use official release binaries, self-compile otherwise)
    • Support for AVX512f is helpful
  • RAM
    • 256GB or more
    • Error Correction Code (ECC) memory is suggested
    • A motherboard with 512GB capacity suggested
  • Disk
    • PCIe Gen3 x4 NVME SSD, or better
    • Accounts: 500GB, or larger. High TBW (Total Bytes Written)
    • Ledger: 1TB or higher. High TBW suggested
    • OS: (Optional) 500GB, or larger. SATA OK
    • The OS may be installed on the ledger disk, though testing has shown better performance with the ledger on its own disk
    • Accounts and ledger can be stored on the same disk, however, due to high IOPS, this is not recommended
    • The Samsung 970 and 980 Pro series SSDs are popular with the validator community

Build your blockchain applications on Cherry Servers enterprise-grade, customizable, and secure cloud Web3 infrastructure designed for intensive workloads. Enjoy minimal downtime, pay-as-you-go pricing, and free 24/7 technical support. Pay in your preferred cryptocurrency.

Explore More Here

#Virtual machines on cloud platforms

While you can run a validator on a cloud computing platform, it may not be cost-efficient over the long term. However, it may be convenient to run non-voting API nodes on VM instances for your own internal usage. This use case includes exchanges and services built on Solana.

In fact, the mainnet-beta validators operated by the team are currently being run on GCE n2-standard-32 (32 vCPUs, 128 GB memory) instances with 2048 GB SSD for operational convenience.

For this demonstration, an AMD Blockchain server from Cherry Servers was used. For other cloud platforms, select server types with similar specs as mentioned in the server hardware specification section above.

#How to run a Solana node: Step-by-step process

#Step 1: Open the terminal program

To start this guide, you will be running commands on your trusted computer, not on the remote machine that you plan to use for validator operations. First, open the terminal program on your local computer. This demonstration uses an Ubuntu system and the terminal can be opened using CTRL + Alt + T.

#Step 2: Install Solana CLI locally

To create your validator vote account, you need to install the Solana command line interface on your local computer.

There are multiple ways of installing the Solana command line interface, as recorded in the documentation, but we are going to use the install tool for this demonstration.

đź’ˇ Building from source is a great option for those that want a more secure and potentially more performant executable.

In your terminal, run the following command:

sh -c "$(curl -sSfL https://release.solana.com/v1.16.8/install)"

You should get a similar output as below indicating a successful installation and a prompt asking you to either reopen your terminal or run a provided command in the existing shell to apply the PATH changes:

How to Run a Solana Node? | Cherry Servers (1)

You can confirm that the Solana CLI has been successfully installed by running the following:

solana --version

How to Run a Solana Node? | Cherry Servers (2)

Once you have successfully installed the CLI, the next step is to change the Solana CLI configuration so that it is making requests to the testnet cluster:

solana config set --url https://api.testnet.solana.com

To verify that the configuration has changed, run:

solana config get

How to Run a Solana Node? | Cherry Servers (3)

#Step 3: Create keys

Next, you need to create the three keypairs that you will need to run your validator. Execute the following commands to create the keypairs:

solana-keygen new -o validator-keypair.jsonsolana-keygen new -o vote-account-keypair.jsonsolana-keygen new -o authorized-withdrawer-keypair.json

How to Run a Solana Node? | Cherry Servers (4)

How to Run a Solana Node? | Cherry Servers (5)

How to Run a Solana Node? | Cherry Servers (6)

The commands above will generate three keypairs, one for a validator, one for a Vote account, and one for an authorized withdrawer, and then save them to the JSON files indicated in the commands.

Solana validators are responsible for maintaining the network and validating transactions. Vote accounts are used to select the validators and confirm the network's consensus and authorized withdrawers are entities allowed to withdraw funds from an account.

đź’ˇ Some operators choose to make vanity keypairs for their identity and their vote account using the grind subcommand.

#Step 4: Create a vote account and funding

Before you can create your vote account, you need to configure the Solana command line tool to use the validator keypair.

The command below sets the validator keypair you just created as the default one in the Solana configuration allowing the Solana CLI or subsequent commands to use it for authentication and other purposes:

solana config set --keypair ./validator-keypair.json

How to Run a Solana Node? | Cherry Servers (7)

Now verify your account balance of 0:

solana balance

How to Run a Solana Node? | Cherry Servers (8)

Next, you need to deposit some SOL into that keypair account in order to create a transaction (in this case, making your vote account):

solana airdrop 1

How to Run a Solana Node? | Cherry Servers (9)

Now, you can use the Solana cluster to create a vote account.Note that all commands mentioned so far should be done on your trusted computer and NOT on a server where you intend to run your validator as you shouldn’t be creating your account credentials on just any computer:

solana create-vote-account -ut \ --fee-payer ./validator-keypair.json \ ./vote-account-keypair.json \ ./validator-keypair.json \ ./authorized-withdrawer-keypair.json

This will create a new vote account with the provided parameters.

How to Run a Solana Node? | Cherry Servers (10)

#Step 5: Create a server

Next, you need to set up your server on your preferred cloud platform with the required hardware specifications mentioned in the guide. As mentioned earlier, an AMD Blockchain server (Ubuntu 22.04) was used here.

You also need to partition the data storage into two distinct areas: the ledger partition and the account partition.

  1. Ledger Partition: The ledger partition is where the actual blockchain data are stored. It contains all the transaction history, blocks, and other information that make up the Solana blockchain. Think of it as a giant record book that keeps track of every transaction ever made on the network. It is like the history book of the Solana blockchain.
  2. Account Partition: The account partition, on the other hand, is where individual user accounts and their associated data are stored. Every user who interacts with the Solana network has their own account, which holds their balance, transaction history, and other relevant information. The account partition acts as a personal storage space for each user on the Solana blockchain.

By separating the ledger and account partitions, Solana aims to achieve scalability and performance.

Also read: How to run an Ethereum node

#Step 6: SSH to your validator

Next, SSH into your server using the appropriate command for your server provider. This will allow you to access and configure the validator remotely. The command should be in this format:

ssh user@<server.hostname>

How to Run a Solana Node? | Cherry Servers (11)

Also read: How to deploy hybrid smart contracts

#Step 7: Update your Ubuntu packages

Now that you have access to the server, run the following command to update the system packages:

sudo apt update && sudo apt upgrade -y

#Step 8: Enable firewall

Next, create and enable a firewall on your virtual machine to allow incoming and outgoing traffic on the required ports (8000 - 10000 UDP/TCP). These ports are specific to testnet (so take care to update based on your desired cluster.Ensure you add all the allow rules (especially SSH) before enabling the firewall so as not to lock yourself out of the server. These firewall rules are based on the minimum necessary to operate a validator.

sudo ufw allow "OpenSSH"sudo ufw allow 8000:10000/udpsudo ufw allow 8000:10000/tcpsudo ufw allow 8000/tcpsudo ufw allow 8001/tcpsudo ufw allow 8899/tcpsudo ufw allow 8900/tcpsudo ufw enablesudo ufw status

You should get an output like in the image below:

How to Run a Solana Node? | Cherry Servers (12)

#Step 9: Add a new user

Now create a new user on your server which will be running the validator service using the adduser command.

sudo adduser sol

This will create a new user named “sol” on the server.

How to Run a Solana Node? | Cherry Servers (13)

#Hard Drive Setup

Next, on your Ubuntu server make sure that you have at least 2TB of disk space mounted. You can check disk space using the df command:

df -h

How to Run a Solana Node? | Cherry Servers (14)

If you have a drive that is not mounted/formatted, you have to set up the partition and mount the drive.

To see the hard disk devices that you have available, use the list block devices command:

lsblk -f

How to Run a Solana Node? | Cherry Servers (15)

You may see some devices in the list that have a name but do not have a Universally Unique Identifier (UUID). Any device without a UUID is unformatted.

#Step 10: Formatting and mounting the drives - for ledger & accounts

If you have an additional NVME drive for the ledger partition, format it using the mkfs command:

sudo mkfs -t ext4 /dev/nvme1n1

The device name and location may be different for your computer. After formatting the drive, you can run the lsblk -f command again to confirm that the device now has a UUID.

The devices on the server used in this demonstration have been formatted so to mount the drive, first create directories for mounting the drives (the nvme2n1 and nvme3n1 drives will be used ledger and accounts respectively) and change the ownership of the directories created to the “sol” user using the following command:

sudo mkdir -p /mnt/ledgersudo chown -R sol:sol /mnt/ledger
sudo mkdir -p /mnt/accountssudo chown -R sol:sol /mnt/accounts

How to Run a Solana Node? | Cherry Servers (16)

How to Run a Solana Node? | Cherry Servers (17)

The commands above will create the “/mnt/ledger” and the “/mnt/accounts” directories respectively and change the ownership of the directories to the “sol” user.

Now you can mount the drives using:

sudo mount /dev/nvme2n1 /mnt/ledgersudo mount /dev/nvme3n1 /mnt/accounts

How to Run a Solana Node? | Cherry Servers (18)

#Step 11: System tuning

To ensure proper system performance and successful startup of the validator, it is important to optimize the system by modifying the sysctl knobs and increasing the systemd and session file limits. The provided commands should be followed to make these necessary changes:

Optimise sysctl knobs by running the following command:

sudo bash -c "cat >/etc/sysctl.d/21-solana-validator.conf <<EOF# Increase UDP buffer sizesnet.core.rmem_default = 134217728net.core.rmem_max = 134217728net.core.wmem_default = 134217728net.core.wmem_max = 134217728# Increase memory mapped files limitvm.max_map_count = 1000000# Increase number of allowed open file descriptorsfs.nr_open = 1000000EOF"
sudo sysctl -p /etc/sysctl.d/21-solana-validator.conf

Next, increase systemd and session file limits. To increase the systemd and session file limits, you'll need to modify systemd configuration files.

If you have a specific systemd service unit file for the Solana validator, you can add the LimitNOFILE=1000000 parameter to the [Service] section of that file.

If you don't have a specific service file but want to set the file limits for all systemd units, you can add the DefaultLimitNOFILE=1000000 parameter to the /etc/systemd/system.conf file. You can run the following command to open the system.conf file with the Nano text editor:

sudo nano /etc/systemd/system.conf

Find the [Manager] section and add or modify the DefaultLimitNOFILE parameter. Then save the file and exit the text editor.

How to Run a Solana Node? | Cherry Servers (19)

Reload systemd to apply the change using:

sudo systemctl daemon-reload

Next, set the session file limit by running the following command:

sudo bash -c "cat >/etc/security/limits.d/90-solana-nofiles.conf <<EOF* - nofile 1000000EOF"

The commands above set Solana's process file descriptor count limit by creating a new configuration file at /etc/security/limits.d/90-solana-nofiles.conf and increase the process file descriptor count limit.

After tuning the system, close all open sessions (log out and then log in again).

#Step 12: Copy keypairs

Now, you need to copy the validator keypair and vote account keypair JSON files from your local computer to the virtual machine using the scpcommand. Run the following commands in the directory where you have the generated keypairs:

scp -C vote-account-keypair.json user@<server.hostname>:/home/solscp -C validator-keypair.json user@<server.hostname>:/home/sol

How to Run a Solana Node? | Cherry Servers (20)

The commands above will securely copy the specified JSON files from the local machine to the remote server's “/home/sol” directory. The user@<server.hostname> portion should be replaced with the appropriate remote username and hostname.

After copying the keypairs to the remote server, ensure you change their ownership to the “sol” user, you can do that using:

sudo chown sol:sol validator-keypair.jsonsudo chown sol:sol vote-account-keypair.json

How to Run a Solana Node? | Cherry Servers (21)

#Step 13: Switch to the sol user

Switch back to terminal where you’ve SSHed into the remote server and switch to the sol user using:

su - sol

How to Run a Solana Node? | Cherry Servers (22)

#Step 14: Install Solana CLI on remote machine

You will need to install the Solana CLI on the remote server to run the validator software. You can do that by running the following command:

sh -c "$(curl -sSfL https://release.solana.com/v1.16.8/install)"

#Step 15: Create a validator startup script

After installing the Solana CLI on the remote server, the next thing you need to do is create a startup script for your validator.Create a validator.sh file in the bin directory of the “sol” user by running the following commands:

mkdir -p /home/sol/bintouch /home/sol/bin/validator.shchmod +x /home/sol/bin/validator.sh

The commands above will create a validator.sh file in the bin directory and also make it executable.

Next, using the nano editor, open the validator.sh file:

nano /home/sol/bin/validator.sh

Copy and paste the following contents into validator.sh then save the file:

exec solana-validator \ --identity validator-keypair.json \ --vote-account vote-account-keypair.json \ --known-validator 5D1fNXzvv5NjV1ysLjirC4WY92RNsVH18vjmcszZd8on \ --known-validator 7XSY3MrYnK8vq693Rju17bbPkCN3Z7KvvfvJx4kdrsSY \ --known-validator Ft5fbkqNa76vnsjYNwjDZUXoTWpP7VYm3mtsaQckQADN \ --known-validator 9QxCLckBiJc783jnMvXZubK4wH86Eqqvashtrwvcsgkv \ --only-known-rpc \ --log /home/sol/solana-validator.log \ --ledger /mnt/ledger \ --rpc-port 8899 \ --dynamic-port-range 8000-8020 \ --entrypoint entrypoint.testnet.solana.com:8001 \ --entrypoint entrypoint2.testnet.solana.com:8001 \ --entrypoint entrypoint3.testnet.solana.com:8001 \ --expected-genesis-hash 4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY \ --wal-recovery-mode skip_any_corrupted_record \ --limit-ledger-size

You can run solana-validator --help command for more information on what each flag is doing in this script. You can also refer to the section on best practices for operating a validator in the official Solana documentation.

Check how the blockchain infrastructure-as-a-service (BIaaS) platform Zeeve leveraged Cherry Servers' robust bare metal servers with hardware control to streamline their blockchain-related operations.

Read Their Success Story Here

#Step 16: Verifying your validator is working

Now to confirm that your validator.sh script is running properly, execute it using:

/home/sol/bin/validator.sh

This should execute the solana-validator process.

How to Run a Solana Node? | Cherry Servers (23)

In another terminal window, SSH into your remote server and verify that the solana-validator process is running using the command:

ps aux | grep solana-validator

You should get an output that includes a line containing the solana-validator with all the flags that were added to the validator.sh script.

How to Run a Solana Node? | Cherry Servers (24)

You can also view the logs at /home/sol/solana-validator.log to make sure everything is working correctly.

How to Run a Solana Node? | Cherry Servers (25)

You can also monitor the contents of the solana-validator.log file in real-time. In a new terminal window, SSH into the remote server and run the following commands to switch to the “sol” user and monitor the content of the log file:

su - soltail -f solana-validator.log

How to Run a Solana Node? | Cherry Servers (26)

This will continuously monitor the file for new data as it's added and they will be displayed in the terminal. You need to look out for lines that include _ERROR_, if you don’t see any, you can exit the command.

Next, you can verify that your validator is running correctly by checking if it has registered itself with the Gossip network.In a new terminal, SSH to your remote server, log in as the “sol” user and extract the public key which will be used to identify your validator node on the Solana network from the validator-keypair.json file by running the following command:

solana-keygen pubkey ~/validator-keypair.json

Then you can run the command below to display information related to the public key from the solana gossip output:

solana gossip | grep <pubkey>

Replace <pubkey with the public key of the validator node extracted earlier. If the validator has been registered on the Gossip network, you’d get an output similar to the one in the image below:

How to Run a Solana Node? | Cherry Servers (27)

With the validator in the Gossip network, you can also confirm that the validator has joined the network using the following command:

solana validators | grep <pubkey>

You should get an output as in the image below if it has joined the network.

How to Run a Solana Node? | Cherry Servers (28)

You can also see how quickly your validator is processing blocks using the solana catchup command:

solana catchup <pubkey>

How to Run a Solana Node? | Cherry Servers (29)

#Conclusion

In this guide, we defined the Solana node requirements and provided step-by-step instructions on how to run a Solana validator node. From installing the Solana CLI to creating a validator startup script, we defined the essential parameters such as identity, vote account, known validators, log and ledger paths, RPC port, entry points, and expected genesis hash. This guide emphasizes the significance of verifying that the validator is working correctly by executing the startup script and checking the process status.

Running a Solana validator node can be a rewarding experience and at this point, you should have a better understanding of what it takes to run a Solana node. You can take advantage of this knowledge and contribute to the Solana network while also earning rewards for yourself.

How to Run a Solana Node? | Cherry Servers (2024)
Top Articles
America's Best Continuing Care Retirement Communities 2024
23 Cheap Places Where You Will Want To Retire
Riverrun Rv Park Middletown Photos
jazmen00 x & jazmen00 mega| Discover
Fat Hog Prices Today
What Are Romance Scams and How to Avoid Them
Best Big Jumpshot 2K23
Georgia Vehicle Registration Fees Calculator
Owatc Canvas
Mikayla Campinos Videos: A Deep Dive Into The Rising Star
Toonily The Carry
DIN 41612 - FCI - PDF Catalogs | Technical Documentation
Viha Email Login
Union Ironworkers Job Hotline
Band Of Loyalty 5E
SF bay area cars & trucks "chevrolet 50" - craigslist
Pokemon Unbound Shiny Stone Location
Lakewood Campground Golf Cart Rental
Sussyclassroom
Directions To Nearest T Mobile Store
January 8 Jesus Calling
From This Corner - Chief Glen Brock: A Shawnee Thinker
Walgreens On Bingle And Long Point
2023 Ford Bronco Raptor for sale - Dallas, TX - craigslist
How do you get noble pursuit?
Phoenixdabarbie
Himekishi Ga Classmate Raw
Shoe Station Store Locator
Babydepot Registry
Lininii
Napa Autocare Locator
Fandango Pocatello
Tamilrockers Movies 2023 Download
Arcane Odyssey Stat Reset Potion
Reading Craigslist Pa
Unifi Vlan Only Network
Froedtert Billing Phone Number
Lbl A-Z
Cnp Tx Venmo
Mcalister's Deli Warrington Reviews
Courtney Roberson Rob Dyrdek
Pulaski County Ky Mugshots Busted Newspaper
Citizens Bank Park - Clio
Large Pawn Shops Near Me
Craigslist Chautauqua Ny
Turok: Dinosaur Hunter
10 Best Tips To Implement Successful App Store Optimization in 2024
Marine Forecast Sandy Hook To Manasquan Inlet
Gear Bicycle Sales Butler Pa
Fahrpläne, Preise und Anbieter von Bookaway
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 5609

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.