solana/docs/src/operations/guides/validator-start.md

485 lines
16 KiB
Markdown
Raw Normal View History

---
title: "Validator Guide: Starting a Validator"
sidebar_position: 0
sidebar_label: Starting a Validator
pagination_label: "Validator Guides: Starting a Validator"
---
## Configure Solana CLI
The solana cli includes `get` and `set` configuration commands to automatically
set the `--url` argument for cli commands. For example:
```bash
2021-05-14 09:45:34 -07:00
solana config set --url http://api.devnet.solana.com
```
2020-04-21 16:59:09 -07:00
While this section demonstrates how to connect to the Devnet cluster, the steps
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
are similar for the other [Solana Clusters](../../clusters/available.md).
2020-04-21 16:59:09 -07:00
## Confirm The Cluster Is Reachable
Before attaching a validator node, sanity check that the cluster is accessible
to your machine by fetching the transaction count:
```bash
solana transaction-count
```
View the [metrics dashboard](https://metrics.solana.com:3000/d/monitor/cluster-telemetry) for more
detail on cluster activity.
## Enabling CUDA
If your machine has a GPU with CUDA installed \(Linux-only currently\), include
the `--cuda` argument to `agave-validator`.
When your validator is started look for the following log message to indicate
that CUDA is enabled: `"[<timestamp> solana::validator] CUDA is enabled"`
## System Tuning
2020-08-17 21:41:26 -07:00
### Linux
2020-08-17 21:41:26 -07:00
If you would prefer to manage system settings on your own, you may do so with
the following commands.
#### **Optimize sysctl knobs**
2020-08-17 21:41:26 -07:00
```bash
sudo bash -c "cat >/etc/sysctl.d/21-agave-validator.conf <<EOF
# Increase UDP buffer sizes
2020-08-17 21:41:26 -07:00
net.core.rmem_default = 134217728
net.core.rmem_max = 134217728
net.core.wmem_default = 134217728
net.core.wmem_max = 134217728
2020-08-17 21:41:26 -07:00
# Increase memory mapped files limit
2021-08-03 23:17:12 -07:00
vm.max_map_count = 1000000
# Increase number of allowed open file descriptors
fs.nr_open = 1000000
2020-08-17 21:41:26 -07:00
EOF"
```
2020-08-17 21:41:26 -07:00
```bash
sudo sysctl -p /etc/sysctl.d/21-agave-validator.conf
2020-08-17 21:41:26 -07:00
```
#### **Increase systemd and session file limits**
2020-08-17 21:41:26 -07:00
Add
2020-08-17 21:41:26 -07:00
```
2021-08-03 23:17:12 -07:00
LimitNOFILE=1000000
2020-08-17 21:41:26 -07:00
```
2020-08-17 21:41:26 -07:00
to the `[Service]` section of your systemd service file, if you use one,
otherwise add
```
2021-08-03 23:17:12 -07:00
DefaultLimitNOFILE=1000000
```
to the `[Manager]` section of `/etc/systemd/system.conf`.
2020-08-17 21:41:26 -07:00
```bash
sudo systemctl daemon-reload
```
2020-08-17 21:41:26 -07:00
```bash
sudo bash -c "cat >/etc/security/limits.d/90-solana-nofiles.conf <<EOF
# Increase process file descriptor count limit
2021-08-03 23:17:12 -07:00
* - nofile 1000000
2020-08-17 21:41:26 -07:00
EOF"
```
2020-08-17 21:41:26 -07:00
```bash
### Close all open sessions (log out then, in again) ###
```
[docs] Validator guidebook incorporated into docs (#31660) * docs: adding multiple pages in from the guidebook * fix: minor updates to the rpc node setup page * fix: added known validators info to the rpc page * docs: added best practices pages * fix: updated internal linking * docs: added faq page and update links * Expanding the validator FAQ, updating hardware req * Updates to validator setup * Fixed broken RPC API links * Remove GPU reqs, clarify install best practices * Updating neworking requirements in validator reqs * Removing trailing white spaces * Removing systuner usage from docs * ssh authentication note, more on withdrawls * Adding feedback from educational workshop * Details on system clock, cpu freq, validator set * add link to gossip for clock drift system req Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/best-practices/monitoring.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * clarification on monitoring docs Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * adding a reference to the hardware requirements Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * fixing link to clusters page Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * typo fix Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/get-started/setup-a-validator.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/best-practices/monitoring.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/best-practices/monitoring.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Referencing the validator health report * Removed trailing whitespace --------- Co-authored-by: nickfrosty <nfrostbutter@gmail.com> Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com>
2023-06-13 12:11:37 -07:00
#### System Clock
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
Large system clock drift can prevent a node from properly participating in Solana's [gossip protocol](../../validator/gossip.md). Ensure that your system clock is accurate. To check the current system clock, use:
[docs] Validator guidebook incorporated into docs (#31660) * docs: adding multiple pages in from the guidebook * fix: minor updates to the rpc node setup page * fix: added known validators info to the rpc page * docs: added best practices pages * fix: updated internal linking * docs: added faq page and update links * Expanding the validator FAQ, updating hardware req * Updates to validator setup * Fixed broken RPC API links * Remove GPU reqs, clarify install best practices * Updating neworking requirements in validator reqs * Removing trailing white spaces * Removing systuner usage from docs * ssh authentication note, more on withdrawls * Adding feedback from educational workshop * Details on system clock, cpu freq, validator set * add link to gossip for clock drift system req Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/best-practices/monitoring.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * clarification on monitoring docs Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * adding a reference to the hardware requirements Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * fixing link to clusters page Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * typo fix Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/get-started/setup-a-validator.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/best-practices/monitoring.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Update docs/src/validator/best-practices/monitoring.md Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com> * Referencing the validator health report * Removed trailing whitespace --------- Co-authored-by: nickfrosty <nfrostbutter@gmail.com> Co-authored-by: Nick Frostbutter <75431177+nickfrosty@users.noreply.github.com>
2023-06-13 12:11:37 -07:00
```bash
timedatectl
```
Operators commonly use an ntp server to maintain an accurate system clock.
## Generate identity
Create an identity keypair for your validator by running:
```bash
solana-keygen new -o ~/validator-keypair.json
```
The identity public key can now be viewed by running:
```bash
solana-keygen pubkey ~/validator-keypair.json
```
> Note: The "validator-keypair.json” file is also your \(ed25519\) private key.
### Paper Wallet identity
You can create a paper wallet for your identity file instead of writing the
keypair file to disk with:
```bash
solana-keygen new --no-outfile
```
The corresponding identity public key can now be viewed by running:
```bash
solana-keygen pubkey ASK
```
and then entering your seed phrase.
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
See [Paper Wallet Usage](../../cli/wallets/paper.md) for more info.
---
### Vanity Keypair
You can generate a custom vanity keypair using solana-keygen. For instance:
```bash
solana-keygen grind --starts-with e1v1s:1
```
You may request that the generated vanity keypair be expressed as a seed phrase
which allows recovery of the keypair from the seed phrase and an optionally
supplied passphrase (note that this is significantly slower than grinding without
a mnemonic):
```bash
solana-keygen grind --use-mnemonic --starts-with e1v1s:1
```
Depending on the string requested, it may take days to find a match...
---
Your validator identity keypair uniquely identifies your validator within the
network. **It is crucial to back-up this information.**
If you dont back up this information, you WILL NOT BE ABLE TO RECOVER YOUR
VALIDATOR if you lose access to it. If this happens, YOU WILL LOSE YOUR
2020-04-21 16:59:09 -07:00
ALLOCATION OF SOL TOO.
To back-up your validator identify keypair, **back-up your
"validator-keypair.json” file or your seed phrase to a secure location.**
## More Solana CLI Configuration
Now that you have a keypair, set the solana configuration to use your validator
keypair for all following commands:
```bash
2020-01-21 07:53:44 -08:00
solana config set --keypair ~/validator-keypair.json
```
You should see the following output:
```text
Config File: /home/solana/.config/solana/cli/config.yml
RPC URL: http://api.devnet.solana.com
WebSocket URL: ws://api.devnet.solana.com/ (computed)
Keypair Path: /home/solana/validator-keypair.json
Commitment: confirmed
```
## Airdrop & Check Validator Balance
Airdrop yourself some SOL to get started:
```bash
2021-03-30 14:04:00 -07:00
solana airdrop 1
```
2020-10-26 12:58:45 -07:00
Note that airdrops are only available on Devnet and Testnet. Both are limited
2021-03-30 14:04:00 -07:00
to 1 SOL per request.
To view your current balance:
```text
solana balance
```
Or to see in finer detail:
```text
solana balance --lamports
```
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
Read more about the [difference between SOL and lamports here](https://solana.com/docs/intro#what-are-sols).
## Create Authorized Withdrawer Account
If you haven't already done so, create an authorized-withdrawer keypair to be used
as the ultimate authority over your validator. This keypair will have the
authority to withdraw from your vote account, and will have the additional
authority to change all other aspects of your vote account. Needless to say,
this is a very important keypair as anyone who possesses it can make any
changes to your vote account, including taking ownership of it permanently.
So it is very important to keep your authorized-withdrawer keypair in a safe
location. It does not need to be stored on your validator, and should not be
stored anywhere from where it could be accessed by unauthorized parties. To
create your authorized-withdrawer keypair:
```bash
solana-keygen new -o ~/authorized-withdrawer-keypair.json
```
## Create Vote Account
If you havent already done so, create a vote-account keypair and create the
vote account on the network. If you have completed this step, you should see the
“vote-account-keypair.json” in your Solana runtime directory:
```bash
solana-keygen new -o ~/vote-account-keypair.json
```
The following command can be used to create your vote account on the blockchain
with all the default options:
```bash
solana create-vote-account ~/vote-account-keypair.json ~/validator-keypair.json ~/authorized-withdrawer-keypair.json
```
Remember to move your authorized withdrawer keypair into a very secure location after running the above command.
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
Read more about [creating and managing a vote account](./vote-accounts.md).
## Known validators
If you know and respect other validator operators, you can specify this on the command line with the `--known-validator <PUBKEY>`
argument to `agave-validator`. You can specify multiple ones by repeating the argument `--known-validator <PUBKEY1> --known-validator <PUBKEY2>`.
This has two effects, one is when the validator is booting with `--only-known-rpc`, it will only ask that set of
2022-01-23 12:21:10 -08:00
known nodes for downloading genesis and snapshot data. Another is that in combination with the `--halt-on-known-validators-accounts-hash-mismatch` option,
it will monitor the merkle root hash of the entire accounts state of other known nodes on gossip and if the hashes produce any mismatch,
the validator will halt the node to prevent the validator from voting or processing potentially incorrect state values. At the moment, the slot that
the validator publishes the hash on is tied to the snapshot interval. For the feature to be effective, all validators in the known
set should be set to the same snapshot interval value or multiples of the same.
It is highly recommended you use these options to prevent malicious snapshot state download or
account state divergence.
## Connect Your Validator
2020-04-21 16:59:09 -07:00
Connect to the cluster by running:
```bash
agave-validator \
2020-04-21 16:59:09 -07:00
--identity ~/validator-keypair.json \
--vote-account ~/vote-account-keypair.json \
--rpc-port 8899 \
2021-04-14 09:07:42 -07:00
--entrypoint entrypoint.devnet.solana.com:8001 \
--limit-ledger-size \
--log ~/agave-validator.log
```
To force validator logging to the console add a `--log -` argument, otherwise
the validator will automatically log to a file.
The ledger will be placed in the `ledger/` directory by default, use the
`--ledger` argument to specify a different location.
> Note: You can use a
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
> [paper wallet seed phrase](../../cli/wallets/paper.md)
> for your `--identity` and/or
> `--authorized-voter` keypairs. To use these, pass the respective argument as
> `agave-validator --identity ASK ... --authorized-voter ASK ...`
> and you will be prompted to enter your seed phrases and optional passphrase.
Confirm your validator is connected to the network by opening a new terminal and
running:
```bash
solana gossip
```
If your validator is connected, its public key and IP address will appear in the list.
### Controlling local network port allocation
By default the validator will dynamically select available network ports in the
8000-10000 range, and may be overridden with `--dynamic-port-range`. For
example, `agave-validator --dynamic-port-range 11000-11020 ...` will restrict
the validator to ports 11000-11020.
### Limiting ledger size to conserve disk space
2020-10-20 10:18:54 -07:00
The `--limit-ledger-size` parameter allows you to specify how many ledger
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
[shreds](https://solana.com/docs/terminology#shred) your node retains on disk. If you do not
include this parameter, the validator will keep all received ledger data
until it runs out of disk space. Otherwise, the validator will continually
purge the oldest data once to stay under the specified `--limit-ledger-size`
value.
The default value attempts to keep the blockstore (data within the rocksdb
directory) disk usage under 500 GB. More or less disk usage may be requested
by adding an argument to `--limit-ledger-size` if desired. More information
about selecting a custom limit value is [available
here](https://github.com/solana-labs/solana/blob/aa72aa87790277619d12c27f1ebc864d23739557/core/src/ledger_cleanup_service.rs#L26-L37).
Note that the above target of 500 GB does not account for other items that
may reside in the `ledger` directory, depending on validator configuration.
These items may include (but are not limited to):
- Persistent accounts data
- Persistent accounts index
- Snapshots
### Systemd Unit
Running the validator as a systemd unit is one easy way to manage running in the
background.
Assuming you have a user called `sol` on your machine, create the file `/etc/systemd/system/sol.service` with
the following:
```
[Unit]
Description=Solana Validator
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=sol
2021-08-03 23:17:12 -07:00
LimitNOFILE=1000000
LogRateLimitIntervalSec=0
Environment="PATH=/bin:/usr/bin:/home/sol/.local/share/solana/install/active_release/bin"
ExecStart=/home/sol/bin/validator.sh
[Install]
WantedBy=multi-user.target
```
Now create `/home/sol/bin/validator.sh` to include the desired
`agave-validator` command-line. Ensure that the 'exec' command is used to
start the validator process (i.e. "exec agave-validator ..."). This is
important because without it, logrotate will end up killing the validator
every time the logs are rotated.
Ensure that running `/home/sol/bin/validator.sh` manually starts
the validator as expected. Don't forget to mark it executable with `chmod +x /home/sol/bin/validator.sh`
Start the service with:
```bash
sudo systemctl enable --now sol
```
2021-01-07 11:10:24 -08:00
### Logging
2021-01-07 11:10:24 -08:00
#### Log output tuning
The messages that a validator emits to the log can be controlled by the `RUST_LOG`
environment variable. Details can by found in the [documentation](https://docs.rs/env_logger/latest/env_logger/#enabling-logging)
for the `env_logger` Rust crate.
Note that if logging output is reduced, this may make it difficult to debug issues
encountered later. Should support be sought from the team, any changes will need
to be reverted and the issue reproduced before help can be provided.
#### Log rotation
The validator log file, as specified by `--log ~/agave-validator.log`, can get
very large over time and it's recommended that log rotation be configured.
The validator will re-open its log file when it receives the `USR1` signal, which is the
basic primitive that enables log rotation.
If the validator is being started by a wrapper shell script, it is important to
launch the process with `exec` (`exec agave-validator ...`) when using logrotate.
This will prevent the `USR1` signal from being sent to the script's process
instead of the validator's, which will kill them both.
2021-01-07 11:10:24 -08:00
#### Using logrotate
An example setup for the `logrotate`, which assumes that the validator is
running as a systemd service called `sol.service` and writes a log file at
/home/sol/agave-validator.log:
```bash
# Setup log rotation
cat > logrotate.sol <<EOF
/home/sol/agave-validator.log {
rotate 7
daily
missingok
postrotate
systemctl kill -s USR1 sol.service
endscript
}
EOF
sudo cp logrotate.sol /etc/logrotate.d/sol
systemctl restart logrotate.service
```
As mentioned earlier, be sure that if you use logrotate, any script you create
which starts the solana validator process uses "exec" to do so (example: "exec
agave-validator ..."); otherwise, when logrotate sends its signal to the
validator, the enclosing script will die and take the validator process with
it.
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
### Using a ramdisk with spill-over into swap for the accounts database to reduce SSD wear
If your machine has plenty of RAM, a tmpfs ramdisk
([tmpfs](https://man7.org/linux/man-pages/man5/tmpfs.5.html)) may be used to hold
the accounts database
When using tmpfs it's essential to also configure swap on your machine as well to
avoid running out of tmpfs space periodically.
A 300GB tmpfs partition is recommended, with an accompanying 250GB swap
partition.
Example configuration:
1. `sudo mkdir /mnt/solana-accounts`
2. Add a 300GB tmpfs partition by adding a new line containing `tmpfs /mnt/solana-accounts tmpfs rw,size=300G,user=sol 0 0` to `/etc/fstab`
(assuming your validator is running under the user "sol"). **CAREFUL: If you
incorrectly edit /etc/fstab your machine may no longer boot**
3. Create at least 250GB of swap space
- Choose a device to use in place of `SWAPDEV` for the remainder of these instructions.
Ideally select a free disk partition of 250GB or greater on a fast disk. If one is not
available, create a swap file with `sudo dd if=/dev/zero of=/swapfile bs=1MiB count=250KiB`,
set its permissions with `sudo chmod 0600 /swapfile` and use `/swapfile` as `SWAPDEV` for
the remainder of these instructions
- Format the device for usage as swap with `sudo mkswap SWAPDEV`
4. Add the swap file to `/etc/fstab` with a new line containing `SWAPDEV swap swap defaults 0 0`
5. Enable swap with `sudo swapon -a` and mount the tmpfs with `sudo mount /mnt/solana-accounts/`
6. Confirm swap is active with `free -g` and the tmpfs is mounted with `mount`
Now add the `--accounts /mnt/solana-accounts` argument to your `agave-validator`
[docs] docs migration (#34096) * feat: moved common docs to repo * refactor: removed sidebar items * refactor: removed unused images * fix: terminology link * fix: introduction links * fix: developing links * refactor: fixed assorted links * fix: added back the home index * refactor: home page links * refactor: primary links * fix: links * fix: updated existing redirects * feat: added new redirects * refactor: moved cli index file to cli folder * feat: turned breadcrumbs on * feat: auto generated cli sidebar * refactor: page titles * feat: added usage and wallets categories * refactor: moved wallet-guide/cli * style: page titles * refactor: renamed file to install * style: page title * refactor: relocated file to cli/usage/index.md * style: page title * refactor: relocat detailed usage generator for cli commands * refactor: relocated clie usage files * refactor: relocated paper wallet file * refactor: relocated file system wallet doc * feat: added hardware wallet category * refactor: relocated hardware wallet overview * refactor: relocated ledger wallet doc * style: clie wallet titles * refactor(revert): relocated cli usage doc * refactor: relocated to examples * style: cli examples category title * style: usage doc title * refactor: relocated cli intro doc * style: category title * refactor: renamed file * refactor: renamed file * fix: cli links * refactor: relocated file * refactor: relocated files * fix: more cli links * refactor: sidebar order * fix: final cli links? * refactor: proposals * refactor: split sidebars * refactor: removed unused icons * refactor: relocated file * refactor: relocated file * refactor: relocated file * refactor: relocated file * feat: added architecture page * refactor: reloacted filed * refactor: adjusted header links * style: sidebar labels * feat: clusters sidebar details * style: sidebar label * refactor: relocate file * refactor: relocated files * refactor: relocated files * refactor: relocated files * style: validator sidebar * style: sidebar styles * refactor: internal links * style: sidebar order * fix: internal links * feat: master sidebar * refactor: removed unneeded h2 * fix: link redirects * refactor: relocated pages * style: runtime links * refactor: simplified runtime redirects * fix: internal redirect * refactor: moved proposals to dropdown * docs: Removes accounts-on-ramdisk section (#33655) * RPC: update websocket docs (#33460) * [rpc]: update websocket docs * rename rewards to showRewards * add remaining optional fields for slotsUpdates * update block subscription showRewards * Change getHealth to compare optimistically confirmed slots (#33651) The current getHealth mechanism checks a local accounts hash slot vs. those of other nodes as specified by --known-validator. This is a very coarse comparison given that the default for this value is 100 slots. More so, any nodes using a value larger than the default (ie --incremental-snapshot-interval 500) will likely see getHealth return status behind at some point. Change the underlying mechanism of how health is computed. Instead of using the accounts hash slots published in gossip, use the latest optimistically confirmed slot from the cluster. Even when a node is behind, it is able to observe cluster optimistically confirmed by slots by viewing votes published in gossip. Thus, the latest cluster optimistically confirmed slot can be compared against the latest optimistically confirmed bank from replay to determine health. This new comparison is much more granular, and not needing to depend on individual known validators is also a plus. * build(deps): bump @babel/traverse from 7.19.6 to 7.23.2 in /docs (#33726) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.6 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: move rpc info to rpc docs (#33723) docs: link fixes docs: link fixes docs: link fixes * Fix typos in documentation for Secp256k1 native program (#33796) * docs: outline requirement of stake in order to vote (#33842) * docs: outline requirement of stake in order to vote * pr feedback: move stake section up * chore: fix some typos (#33833) * fix spelling of "retrieved" * fix spelling of "should" * fix spelling of "comparisons" * docs: updating apt install to apt upgrade (#33920) * Fix some typo in the documentation (#34058) Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> * fix: internal links * refactor: removed rpc api docs * refactor: removed rpc sidebar * fix: updated remaining rpc api links * refactor: removed final rpc /api route * refactor: removed dangling component files * refactor: changed copyright * fix: dangling ordered list * refactor: wording around solana docs * feat: home page content * refactor: updated docs url * Link to latest version of the off-chain message signing proposal in the docs (#34329) * docs: (cli) minor updates to deploy-a-program.md (#34307) * docs: (cli) minor updates to deploy-a-program.md * address review comments * remove unnecessary impl details from the docs about deploy command upgrade flow * clarify program redeploy section --------- Co-authored-by: norwnd <norwnd> * refactor: removed GA --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Brooks <brooks@solana.com> Co-authored-by: Joe C <joe.caulfield@solana.com> Co-authored-by: steviez <steven@solana.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com> Co-authored-by: Nick Guo <1387955+nickguo@users.noreply.github.com> Co-authored-by: Ashwin Sekar <ashwin@solana.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: Max Kaplan <max@maxkaplan.me> Co-authored-by: hugo-syn <61210734+hugo-syn@users.noreply.github.com> Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> Co-authored-by: norwnd <112318969+norwnd@users.noreply.github.com>
2023-12-11 12:17:13 -08:00
command-line arguments and restart the validator.
### Account indexing
As the number of populated accounts on the cluster grows, account-data RPC
requests that scan the entire account set -- like
[`getProgramAccounts`](https://solana.com/docs/rpc/http/getprogramaccounts) and
[SPL-token-specific requests](https://solana.com/docs/rpc/http/gettokenaccountsbydelegate) --
may perform poorly. If your validator needs to support any of these requests,
you can use the `--account-index` parameter to activate one or more in-memory
account indexes that significantly improve RPC performance by indexing accounts
by the key field. Currently supports the following parameter values:
- `program-id`: each account indexed by its owning program; used by [getProgramAccounts](https://solana.com/docs/rpc/http/getprogramaccounts)
- `spl-token-mint`: each SPL token account indexed by its token Mint; used by [getTokenAccountsByDelegate](https://solana.com/docs/rpc/http/gettokenaccountsbydelegate), and [getTokenLargestAccounts](https://solana.com/docs/rpc/http/gettokenlargestaccounts)
- `spl-token-owner`: each SPL token account indexed by the token-owner address; used by [getTokenAccountsByOwner](https://solana.com/docs/rpc/http/gettokenaccountsbyowner), and [getProgramAccounts](https://solana.com/docs/rpc/http/getprogramaccounts) requests that include an spl-token-owner filter.