From a1e06df4a8efa6365a491eb2a22c6dc9cf8f7d96 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 5 Jan 2021 03:06:15 +0000 Subject: [PATCH] Add validator --account-index docs (#14418) (#14428) (cherry picked from commit efd9b769fca7b2e8fc648e771018a83288c85c23) Co-authored-by: Tyera Eulberg --- docs/src/running-validator/validator-start.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/src/running-validator/validator-start.md b/docs/src/running-validator/validator-start.md index 0e5fd6f54c..1e040c51fd 100644 --- a/docs/src/running-validator/validator-start.md +++ b/docs/src/running-validator/validator-start.md @@ -405,3 +405,18 @@ Example configuration: Now add the `--accounts /mnt/solana-accounts` argument to your `solana-validator` 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`](developing/clients/jsonrpc-api.md#getprogramaccounts) and +[SPL-token-specific requests](developing/clients/jsonrpc-api.md#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`](developing/clients/jsonrpc-api.md#getprogramaccounts) +- `spl-token-mint`: each SPL token account indexed by its token Mint; used by [getTokenAccountsByDelegate](developing/clients/jsonrpc-api.md#gettokenaccountsbydelegate), and [getTokenLargestAccounts](developing/clients/jsonrpc-api.md#gettokenlargestaccounts) +- `spl-token-owner`: each SPL token account indexed by the token-owner address; used by [getTokenAccountsByOwner](developing/clients/jsonrpc-api.md#gettokenaccountsbyowner), and [`getProgramAccounts`](developing/clients/jsonrpc-api.md#getprogramaccounts) requests that include an spl-token-owner filter.