#6 - A Starter Kit for Running Solana Validator
Last updated
Last updated
Authors: @eefylin, @emersonliuuu, @ironaddicteddog
[Updated at 2022.3.31]
See Solana Beach for more details
1600+ Validators
1400+ RPC Nodes
3000+ TPS
< 1s Block Time
...
Solana’s crypto-economic system is designed to promote a healthy, long term self-sustaining economy with participant incentives aligned to the security and decentralization of the network. The main participants in this economy are validation-clients who secure solana network. At the early stage, just as many current blockchain economies (e.g. Bitcoin, Ethereum) does, rely on protocol-based rewards to support the economy, with the assumption that the revenue generated through transaction fees will support the economy in the long term, when the protocol derived rewards expire. see more here
So, where do the protocol-based rewards come from? The answer is Inflation Rate and transaction fees.
How can we avoid being affected by inflation? Stake your SOL and delegate to validator node.
Benefit
Avoid token dilution acording to inflation of SOL Staking tokens, which will receive their proportional distribution of inflation issuance, should assuage any dilution concerns for staked token holders.
Make Solana network more secure As more token holders choose to stake their SOL tokens to different validators across the network, and the total amount of stake on the network increases, it becomes increasingly difficult for even a coordinated and well-funded attacker to amass enough stake to single-handedly alter the outcome of a consensus vote for their own benefit.
Rewards people who stake their token earns their share by the formula and the figure below (or you can see here for more detail). You might notice there's a negative relation between staking yield and total SOL staked, which may be a factor that influences stake/unstake behavior.
for example: (Statistics are from here)
Risk (Slashing) "Slashing" is any process by which some portion of stake delegated to a validator is destroyed as a punitive measure for malicious actions undertaken by the validator. If you stake your stake to malicious validator, part of your stake portion might be slashed too.
malicious actions include inconsistant voting during lockout time, or nodes who cause some block fail to full finalization. See more slashing rules here[1, 2]
How to join
Run a validator (talk more about this later)
Responsibility
verified received block
sending vote transaction (consensus mechanism)
Minimum Requirement
minimum SOL: 0.02685864 SOL(vote account rent)
hardware CPU 12 cores / 24 threads, RAM 128GB, Disk 1.5 TB (Accounts: 500GB, Ledger: 1TB) ... see more detail here
Cost
1.1 SOL/day at most (vote transaction cost)
Rewards
Protocol-based Rewards Issuances from a global, protocol-defined, inflation rate(short term). These rewards are delivered on top of earnings from transaction fees (long term)
Transaction Fee a fixed portion (initially 50%) of each transaction fee is destroyed, with the remaining fee going to the current leader processing the transaction.
Validator vs RPC RPC node is a validator node who provide full functionality for public to query on-chain data and send transaction and also improved reliability, which means it needs higher hardware requirement than general validator node.
vote and stake account The rewards process is split into two on-chain programs. The Vote program solves the problem of making stakes slashable. The Stake program acts as custodian of the rewards pool and provides for passive delegation. The Stake program is responsible for paying rewards to staker and voter when shown that a staker's delegate has participated in validating the ledger. (Solana programs are stateless, thus we need accounts to store states)
identity same as keypair, in blockchain world address represent your identity.
paper wallet Solana commands can be run without ever saving a keypair to disk on a machine.
key rotation Leaders and validators are expected to use ephemeral keys for operation. And also for security concern, key rotation allows validator rotate the vote account authority keys with no effect on the stake accounts that have been delegate to the vote account.
Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
Here are the necessary steps to enroll in the test environment
Visit https://ce.qwiklabs.com
Create your own account
Verify your email by checking your email box
Login to https://ce.qwiklabs.com
Fill our meetup form with the email address you just used to create your account
Access to a standard internet browser (Chrome browser recommended).
Time to complete the lab.
If you already have your own personal Google Cloud account or project, do not use it for this lab.
If you are using a Chrome OS device, open an Incognito window to run this lab.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment.
It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.
Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.
Open the tabs in separate windows, side-by-side.
If you see the Choose an account page, click Use Another Account. Choose an account
In the Sign in page, paste the username that you copied from the left panel. Then copy and paste the password.
Important: You must use the credentials from the left panel. Do not use your Google Cloud Training credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).
Click through the subsequent pages:
Accept the terms and conditions.
Do not add recovery options or two-factor authentication (because this is a temporary account).
Do not sign up for free trials.
After a few moments, the Cloud Console opens in this tab.
Please check with the upper top selected the project assigned to you.
Create a VM (Navigation Menu -> Compute Engine -> VM instances -> Create Instance)
Use the default name, region, zone.
N2 series, Custom Machine type, CPU 24 cores, Ram 128 GB
Change the "Boot Disk", "SSD persistent disk", Size 500GB
Networking, Network tags, "solana"
Leave the rest by default
The above spec is based on Solana document
Create 1 Firewall rule (Navigation Menu -> VPC network -> Firewall -> Create Firewall Rule)
Name: solana-validator-ports
Network: default
Priority: 1000
Diretion of traffic: Ingress
Action on match: Allow
Target tags: solana
IPv4 ranges: 0.0.0.0/0
tcp:8899, 8900, 11000
udp:11000-11020
Please visit the VM page (Navigation Menu -> Compute Engine -> VM instances)
Find the virtual machine you created, and click on the [SSH] buttom.
Now let's run some scripts!
Run following command to Solana Command Line Tool:
Should get an output from previous command similiar to the following, please run it.
By default, CLI connect to Mainnet Beta, Let's connect to Devnet
Leverage a System Tuner to update configuration automatically. For more detail please check Solana document
Solana CLI support 2 ways to create key pairs, file wallet or paper wallt. Let's use file wallet in this case for convinience. Paper wallet detail please check here
To show the pubkey again by running:
Set the solana configuration to use your validator keypair for all following commands:
You can use following command to check config status at any time:
To start your Validator, we need some SOL in the wallet. With Devnet we can simply get a SOL by following:
Let's check the balance
Before we launch our Validator, we also need another key-pair for Vote Account:
Also a key-pair for Authorized Withdrawer Account:
Run this command to create your Vote Account:
Create a executable file validator.sh
Use your prefered editor to pasta following content to validator.sh
Let's make it executable:
Now it's time to create a file for Systemd, which is the Linux program we are going to use"
Paste following content to the file with your preferred editor: ( please change User, Environment, ExecStart with your own environment. )
Finally, let us run commands below to start our validator
Enable the systemd, so when the service stop will bring up agaiin
Now let's start the service
Let's check the log, once you see your validator catch up with other validator, can move to next step.
Check our Validator from the Solana Devnet
If you see your pubkey and the IP matching your VM external IP, Your Done!
Goal Incentivize new validators to join to secure Solana network
Get delegation from fundation
meet the Testnet Participation Criteria and all of the Baseline Criteria -> receive a “baseline” delegation from the Solana Foundation of 25,000 SOL
Example: Baseline criteria for Epoch 252
Vote Credits
227,047 or more
Maximum Commission
10% or under
Solana Release
1.7.14 or greater
Self Stake
100 or more
Total Stake
3,000,000 or less
Infrastructure Concentration
10% or less
Infrastructure Concentration
Baseline in 5 of last 10 testnet epochs
meets all criteria to receive the baseline delegation and also meets all of the Bonus Criteria -> receive a “bonus” delegation (size is dynamic, this part depends on current participants)
Get delegation from external
starting a website and explaining why delegators should stake to you
starting a stake pool that promotes decentralization
joining a stake pool (https://solana.foundation/stake-pools) and receiving additional delegations from them.
(source)
https://github.com/DappioWonderland/solana
https://docs.solana.com/running-validator/validator-start
https://hackmd.io/@ironaddicteddog/solana-starter-kit
https://github.com/DappioWonderland/solana
Initial Inflation Rate: 8% Dis-inflation Rate: −15% Long-term Inflation Rate: 1.5%