How to Setup and Run a Solana RPC Node (2024)

Solana's RPC (Remote Procedure Call) node acts as a gateway to the network, allowing developers to interact with the blockchain for Solana blockchain development services. If you're looking to build dApps or interact with the Solana ecosystem, running your own RPC node offers several advantages:

  • Reduced Reliance: Free yourself from dependence on public RPC nodes, ensuring data sovereignty and potentially faster response times.
  • Customization: Tailor the node to your specific needs, enabling features like filtering or whitelisting requests.

Solana relies on validators, which are computers that maintain the network. Each validator runs a program to track accounts and validate transactions. Without validators, Solana wouldn't function.

Before diving into RPC, let's clarify a key distinction. The validator software offers two deployment options: voting/consensus nodes and RPC nodes. While both leverage the same software, RPC nodes prioritize performance and refrain from voting. Unlike validator nodes focused on consensus, RPC nodes serve a distinct purpose within the cluster. They act as information providers, responding to blockchain inquiries and facilitating transaction submissions from users.

Also, Read | A Guide to Meme Coin Development on Solana

Set Up and Run a Solana RPC Node

Solana Validator Requirements

Minimum SOL requirements

Running a Solana validator doesn't require a strict initial SOL investment. However, to participate in consensus and earn rewards, you'll need a vote account with a minimum balance of 0.02685864 SOL to cover rent exemption. Additionally, voting on blocks incurs daily transaction fees, estimated around 1.1 SOL.

Hardware recommendations:

You can check hardware requirements from the doc mentionedhttps://docs.solanalabs.com/operations/requirements#hardware-recommendations

Running the RPC node

To create your validator vote account, ensure you have the Solana command-line interface installed on your local computer.

Also, Check | Compressed NFTs (cNFTs) | Solana's Cost-Effective NFT standard

In this blog we are going to use linux for reference.

Install solana release using the following command

sh -c "$(curl -sSfLhttps://release.solana.com/v1.18.12/install)"

Verify that you have the desired version of Solana installed by running the following command:

solana --version

After confirming successful installation of the Solana CLI (command-line interface), update your configuration to target the testnet cluster for interacting with the Solana test network.

solana config set --urlhttps://api.testnet.solana.com

Create an identity keypair for your validator by running:

solana-keygen new -o ~/validator-keypair.json

You can view the identity public key by executing the following command:

solana-keygen pubkey ~/validator-keypair.json

To connect to the machine running the node, we recommend using a non-privileged user with sudo permissions. If necessary, you can SSH as root on remote machines. For local development, open a terminal and use sudo su to elevate your privileges.

Make sure you have the latest and greatest package versions on your server.

sudo apt updatesudo apt upgrade

Ensure you have a minimum of 2TB of disk space mounted on your Ubuntu computer. You can verify disk space using the "df" command.

df -h

Use the "list block devices" command to view the available hard disk devices.

lsblk -f

If you have an unformatted NVMe drive, you'll need to format it before you can proceed with mounting it. Once formatted, you can then proceed to mount it.

For example, if your computer has a device located at /dev/nvme0n1, then you can format the drive with the command:

sudo mkfs -t ext4 /dev/nvme0n1

Device names and locations can vary for different computers.

Next, confirm that you have a UUID assigned to the device by running:

Now that you've formatted the drive, it's time to mount it. Create a directory for mounting your drive:

sudo mkdir -p /mnt/ledger

Now you can mount the drive:

sudo mount /dev/nvme0n1 /mnt/ledger

To ensure optimal performance, consider mounting the accounts database on a separate hard drive. Follow a process similar to the ledger example mentioned earlier.

Also, Explore | Solana for Real Estate Asset Tokenization

If you have a device located at /dev/nvme1n1, format the device and verify its existence.

sudo mkfs -t ext4 /dev/nvme1n1

Create a directory for mounting:

sudo mkdir -p /mnt/accounts

And lastly, mount the drive:

sudo mount /dev/nvme1n1 /mnt/accounts

System Tuning

Proper system tuning is essential for the successful operation of your validator. Failure to implement the settings below may result in your validator failing to start.

Optimize sysctl knobs

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
Increase systemd and session file limits
Add
LimitNOFILE=1000000

to the [Service] section of your systemd service file, if you use one, otherwise add

DefaultLimitNOFILE=1000000

to the [Manager] section of /etc/systemd/system.conf.

sudo systemctl daemon-reload
sudo bash -c "cat >/etc/security/limits.d/90-solana-nofiles.conf <<EOF# Increase process file descriptor count limit* - nofile 1000000EOF"


Transfer your validator-keypair.json and vote-account-keypair.json files securely from your personal computer to the validator server.

scp validator-keypair.json sol@<server.hostname>:scp vote-account-keypair.json sol@<server.hostname>:
Create A Validator Startup Script"‹

n your sol home directory (e.g. /home/sol/), create a folder called bin. Inside that folder create a file called validator.sh and make it executable:

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

Next, open the validator.sh file for editing:

nano /home/sol/bin/validator.sh

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

Due to the Solana blockchain's high transaction throughput, storing the entire chain on an RPC node isn't feasible. Operators set block storage limits with the --limit-ledger-size flag in startup scripts. For historical data, RPC servers access older blocks via Solana's bigtable instance.

#!/bin/bashexec solana-validator \ --identity /home/sol/validator-keypair.json \ --known-validator 5D1fNXzvv5NjV1ysLjirC4WY92RNsVH18vjmcszZd8on \ --known-validator dDzy5SR3AXdYWVqbDEkVFdvSPCtS9ihF5kJkHCtXoFs \ --known-validator eoKpUABi59aT4rR9HGS3LcMecfut9x7zJyodWWP43YQ \ --known-validator 7XSY3MrYnK8vq693Rju17bbPkCN3Z7KvvfvJx4kdrsSY \ --known-validator Ft5fbkqNa76vnsjYNwjDZUXoTWpP7VYm3mtsaQckQADN \ --known-validator 9QxCLckBiJc783jnMvXZubK4wH86Eqqvashtrwvcsgkv \ --only-known-rpc \ --full-rpc-api \ --no-voting \ --ledger /mnt/ledger \ --accounts /mnt/accounts \ --log /home/sol/solana-rpc.log \ --rpc-port 8899 \ --rpc-bind-address 0.0.0.0 \ --private-rpc \ --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 may also like | Exploring Solana Blockchain Development for Enterprises
Verifying your validator is working

Test that your validator.sh file is running properly by executing the validator.sh script:

/home/sol/bin/validator.sh

The script should initiate the solana-validator process. In a new terminal window, SSH into your server, then confirm that the process is running:

ps aux | grep solana-validator

You should encounter a line in the output containing "solana-validator" along with all the flags added to your validator.sh script.

Next, examine the logs to ensure smooth operation.

In a new terminal window, SSH into your validator machine, switch to the sol user, and tail the logs:

su - soltail -f solana-validator.log

The "tail" command continuously displays the output of a file as it changes. You should observe a continuous stream of log output as your validator runs. Watch for any lines indicating "_ERROR_".

If no error messages are visible, exit the command.

To confirm that your validator is running correctly, ensure that it has registered itself with the gossip network.

In a new terminal window, establish an SSH connection to your server. Identify your validator's pubkey:

solana-keygen pubkey ~/validator-keypair.json

The "solana gossip" command displays all validators registered with the protocol. To verify whether the newly set up validator is listed in gossip, we'll use "grep" to search for our pubkey in the output:

solana gossip | grep <pubkey>

If you don't observe any output after using "grep" on the gossip output, your validator might be encountering startup issues. In such a scenario, initiate debugging by examining the validator log output.


Once you've confirmed that your validator is in gossip, you can verify its network membership by using the "solana validators" command. This command provides a list of all validators in the network. You can filter the output to focus on the specific validator of interest using the "grep" command as before.

solana validators | grep <pubkey>

For more about Solana blockchain development, connect with our Solana blockchain developers.

How to Setup and Run a Solana RPC Node (2024)
Top Articles
Does Overhead Include Payroll?
Software Testing Best Practices: 11 Ways to Improve Testing
Craigslist Vans
What are Dietary Reference Intakes?
Chalupp's Pizza Taos Menu
5 Bijwerkingen van zwemmen in een zwembad met te veel chloor - Bereik uw gezondheidsdoelen met praktische hulpmiddelen voor eten en fitness, deskundige bronnen en een betrokken gemeenschap.
Corpse Bride Soap2Day
ds. J.C. van Trigt - Lukas 23:42-43 - Preekaantekeningen
True Statement About A Crown Dependency Crossword
Florida (FL) Powerball - Winning Numbers & Results
Used Wood Cook Stoves For Sale Craigslist
Nonuclub
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Nebraska Furniture Tables
Classic Lotto Payout Calculator
Viha Email Login
Napa Autocare Locator
Grayling Purnell Net Worth
Epguides Strange New Worlds
Skip The Games Fairbanks Alaska
Craigslist Pearl Ms
Is Windbound Multiplayer
Yosemite Sam Hood Ornament
Play It Again Sports Norman Photos
Avatar: The Way Of Water Showtimes Near Maya Pittsburg Cinemas
Elite Dangerous How To Scan Nav Beacon
Craigslist Hunting Land For Lease In Ga
800-695-2780
Wonder Film Wiki
Is Henry Dicarlo Leaving Ktla
Waters Funeral Home Vandalia Obituaries
How do you get noble pursuit?
30+ useful Dutch apps for new expats in the Netherlands
Srjc.book Store
Ringcentral Background
Noaa Marine Forecast Florida By Zone
Moonrise Time Tonight Near Me
new haven free stuff - craigslist
Jr Miss Naturist Pageant
Craigslist Lakeside Az
Buhsd Studentvue
Sunrise Garden Beach Resort - Select Hurghada günstig buchen | billareisen.at
Skip The Games Grand Rapids Mi
RECAP: Resilient Football rallies to claim rollercoaster 24-21 victory over Clarion - Shippensburg University Athletics
Makes A Successful Catch Maybe Crossword Clue
CrossFit 101
Noga Funeral Home Obituaries
Goosetown Communications Guilford Ct
Kenmore Coldspot Model 106 Light Bulb Replacement
Noelleleyva Leaks
Vrca File Converter
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 6337

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.