[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>
This commit is contained in:
Nick Frostbutter 2023-12-11 15:17:13 -05:00 committed by GitHub
parent 4b762320cb
commit 676e80c80a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
237 changed files with 1934 additions and 20074 deletions

View File

@ -2,6 +2,3 @@
build
html
static
# prettier interferes with the json response too much
src/developing/clients/jsonrpc-api.md

View File

@ -1,11 +1,11 @@
# Solana Docs Readme
# Solana Validator Docs Readme
Solana's Docs are built using [Docusaurus v2](https://v2.docusaurus.io/) with `npm`.
This validator's docs are built using [Docusaurus v2](https://v2.docusaurus.io/) with `npm`.
Static content delivery is handled using `vercel`.
## Local Development
To set up the Solana Docs site locally:
To set up the Solana Validator Docs site locally:
- install dependencies using `npm`
- build locally via `./build.sh`
@ -30,7 +30,7 @@ The build script generates static content into the `build` directory and can be
./build.sh
```
Running this build script requires **Docker**, and will auto fetch the [solanalabs/rust](https://hub.docker.com/r/solanalabs/rust) image from Docker hub to compile the desired version of the [Solana CLI](https://docs.solana.com/cli) from source.
Running this build script requires **Docker**, and will auto fetch the [solanalabs/rust](https://hub.docker.com/r/solanalabs/rust) image from Docker hub to compile the desired version of the [Solana CLI](https://docs.solanalabs.com/cli) from source.
This build script will also:
@ -75,9 +75,9 @@ The docs are built and published in Travis CI with the `./build.sh` script. On e
In each post-commit build, docs are built and published using `vercel` to their respective domain depending on the build branch.
- Master branch docs are published to `edge.docs.solana.com`
- Beta branch docs are published to `beta.docs.solana.com`
- Latest release tag docs are published to `docs.solana.com`
- Master branch docs are published to `edge.docs.solanalabs.com`
- Beta branch docs are published to `beta.docs.solanalabs.com`
- Latest release tag docs are published to `docs.solanalabs.com`
## Common Issues

View File

@ -15,7 +15,7 @@ out=${1:-src/cli/usage.md}
# load the usage file's header
cat src/cli/.usage.md.header > "$out"
# Skip generating the usage doc for non deployment commits of the docs
# Skip generating the detailed usage doc for non deployment commits of the docs
if [[ -n $CI ]]; then
if [[ $CI_BRANCH != $EDGE_CHANNEL* ]] && [[ $CI_BRANCH != $BETA_CHANNEL* ]] && [[ $CI_BRANCH != $STABLE_CHANNEL* ]]; then
echo "**NOTE:** The usage doc is only auto-generated during full production deployments of the docs"

View File

@ -1,161 +0,0 @@
import React from "react";
import Link from "@docusaurus/Link";
// import clsx from "clsx";
import styles from "../src/pages/CodeDocBlock.module.css";
export function DocBlock({ children }) {
return <section className={styles.DocBlock}>{children}</section>;
}
export function DocSideBySide({ children }) {
return <section className={styles.DocSideBySide}>{children}</section>;
}
export function CodeParams({ children }) {
return <section className={styles.CodeParams}>{children}</section>;
}
export function CodeSnippets({ children }) {
return (
<section className={styles.CodeSnippets}>
{/* <p className={styles.Heading}>Code Sample:</p> */}
{children}
</section>
);
}
/*
Display a single Parameter
*/
export function Parameter(props) {
const {
name = null,
type = null,
required = null,
optional = null,
children,
} = computeHeader(props);
return (
<section className={styles.Parameter}>
<p className={styles.ParameterHeader}>
{name && name} {type && type} {required && required}{" "}
{optional && optional}
</p>
{children}
</section>
);
}
/*
Display a single Parameter's field data
*/
export function Field(props) {
const {
name = null,
type = null,
values = null,
required = null,
defaultValue = null,
optional = null,
children,
} = computeHeader(props);
return (
<section className={styles.Field}>
<p className={styles.ParameterHeader}>
{name && name} {type && type} {required && required}{" "}
{optional && optional}
{defaultValue && defaultValue}
</p>
<section>
{values && values}
{children}
</section>
</section>
);
}
/*
Parse an array of string values to display
*/
export function Values({ values = null }) {
// format the Parameter's values
if (values && Array.isArray(values) && values?.length) {
values = values.map((value) => (
<code style={{ marginRight: ".5em" }} key={value}>
{value}
</code>
));
}
return (
<p style={{}}>
<span className={styles.SubHeading}>Values:</span>&nbsp;{values}
</p>
);
}
/*
Compute the formatted Parameter and Field component's header meta data
*/
function computeHeader({
name = null,
type = null,
href = null,
values = null,
required = null,
defaultValue = null,
optional = null,
children,
}) {
// format the Parameter's name
if (name) {
name = <span className={styles.ParameterName}>{name}</span>;
if (href) name = <Link href={href}>{name}</Link>;
}
// format the Parameter's type
if (type) type = <code>{type}</code>;
// format the Parameter's values
if (values && Array.isArray(values)) {
values = values.map((value) => (
<code style={{ marginRight: ".5em" }}>{value}</code>
));
}
// format the `defaultValue` flag
if (defaultValue) {
defaultValue = (
<span className={styles.FlagItem}>
Default: <code>{defaultValue.toString()}</code>
</span>
);
}
// format the `required` flag
if (required) {
required = <span className={styles.FlagItem}>required</span>;
}
// format the `optional` flag
else if (optional) {
optional = <span className={styles.FlagItem}>optional</span>;
}
return {
name,
type,
href,
values,
required,
defaultValue,
optional,
children,
};
}

View File

@ -6,7 +6,7 @@ export default function HomeCtaLinks() {
<div className="container">
<div className="row cards__container">
<Card
to="developers"
to="https://solana.com/developers"
header={{
label: "Developers",
translateId: "cta-developers",
@ -14,15 +14,15 @@ export default function HomeCtaLinks() {
/>
<Card
to="running-validator"
to="operations"
header={{
label: "Validators",
label: "Operate a Validator",
translateId: "cta-validators",
}}
/>
<Card
to="cluster/overview"
to="clusters"
header={{
label: "Architecture",
translateId: "cta-architecture",

View File

@ -1,10 +1,10 @@
const math = require("remark-math");
const katex = require("rehype-katex");
module.exports = {
title: "Solana Docs",
title: "Solana Validator",
tagline:
"Solana is an open source project implementing a new, high-performance, permissionless blockchain.",
url: "https://docs.solana.com",
url: "https://docs.solanalabs.com",
baseUrl: "/",
favicon: "img/favicon.ico",
organizationName: "solana-labs", // Usually your GitHub org/user name.
@ -55,43 +55,29 @@ module.exports = {
srcDark: "img/logo-horizontal-dark.svg",
},
items: [
{
to: "introduction",
label: "Learn",
position: "left",
},
{
to: "cluster/overview",
label: "Architecture",
position: "left",
},
{
to: "cli",
label: "CLI",
position: "left",
},
{
to: "/developers",
label: "Developers",
to: "architecture",
label: "Architecture",
position: "left",
},
{
to: "running-validator",
label: "Validators",
to: "operations",
label: "Operating a Validator",
position: "left",
},
{
label: "More",
position: "left",
items: [
{ label: "Terminology", to: "terminology" },
{ label: "Staking", to: "staking" },
{ label: "Integrations", to: "integrations/exchange" },
{ label: "Economics", to: "economics_overview" },
{ label: "Proposals", to: "proposals" },
{
href: "https://spl.solana.com",
label: "Solana Program Library »",
label: "Solana Program Library",
},
],
},
@ -129,16 +115,12 @@ module.exports = {
title: "Documentation",
items: [
{
label: "Learn",
to: "introduction",
label: "Developers »",
href: "https://solana.com/developers",
},
{
label: "Developers",
to: "/developers",
},
{
label: "Validators",
to: "running-validator",
label: "Running a Validator",
to: "operations",
},
{
label: "Command Line",
@ -146,7 +128,7 @@ module.exports = {
},
{
label: "Architecture",
to: "cluster/overview",
to: "architecture",
},
],
},
@ -167,7 +149,7 @@ module.exports = {
},
{
label: "Twitter »",
href: "https://twitter.com/solana",
href: "https://solana.com/twitter",
},
{
label: "Forum »",
@ -179,12 +161,12 @@ module.exports = {
title: "Resources",
items: [
{
label: "Proposals",
to: "proposals",
label: "Terminology »",
href: "https://solana.com/docs/terminology",
},
{
label: "Integrations",
to: "integrations/exchange",
label: "Proposals",
to: "proposals",
},
{
href: "https://spl.solana.com",
@ -193,7 +175,7 @@ module.exports = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Solana Foundation`,
copyright: `Copyright © ${new Date().getFullYear()} Solana Labs`,
},
},
presets: [
@ -202,7 +184,7 @@ module.exports = {
{
docs: {
path: "src",
breadcrumbs: false,
breadcrumbs: true,
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
remarkPlugins: [math],
@ -212,11 +194,11 @@ module.exports = {
customCss: require.resolve("./src/css/custom.css"),
},
// Google Analytics are only active in prod
gtag: {
// this GA code is safe to be published
trackingID: "G-94WS0LRZRS",
anonymizeIP: true,
},
// gtag: {
// this GA code is safe to be published
// trackingID: "",
// anonymizeIP: true,
// },
},
],
],

View File

@ -1,92 +0,0 @@
import React from "react";
import Layout from "@theme/Layout";
import DocSidebar from "@theme/DocSidebar";
import SidebarStyles from "@docusaurus/theme-classic/lib/theme/DocPage/Layout/Sidebar/styles.module.css";
import DocPageStyles from "@docusaurus/theme-classic/lib/theme/DocPage/Layout/styles.module.css";
import sidebar from "../sidebars";
function CardLayout({
children,
sidebarKey = false,
title = "",
description = "",
path = "",
}) {
// load the sidebar item from the master `sidebars.js` file
let sidebarItems = (sidebarKey && sidebar?.[sidebarKey]) || [];
// process each of the loaded sidebar items for formatting
if (sidebarItems?.length) sidebarItems = parseSidebar(sidebarItems);
// return the page layout, ready to go
return (
<Layout title={title} description={description}>
<div className={DocPageStyles.docPage}>
{sidebarItems?.length > 0 && (
<aside className={SidebarStyles.docSidebarContainer}>
<DocSidebar sidebar={sidebarItems} path={path}></DocSidebar>
</aside>
)}
<main className={DocPageStyles.docPage}>{children}</main>
</div>
</Layout>
);
}
export default CardLayout;
/*
Create a simple label based on the string of a doc file path
*/
const computeLabel = (label) => {
label = label.split("/");
label = label[label?.length - 1]?.replace("-", " ");
label = label.charAt(0).toUpperCase() + label.slice(1);
return label && label;
};
/*
Recursively parse the sidebar
*/
const parseSidebar = (sidebarItems) => {
Object.keys(sidebarItems).forEach((key) => {
if (sidebarItems[key]?.type?.toLowerCase() === "category") {
sidebarItems[key].items = parseSidebar(sidebarItems[key].items);
} else sidebarItems[key] = formatter(sidebarItems[key]);
});
return sidebarItems;
};
/*
Parser to format a sidebar item to be compatible with the `DocSidebar` component
*/
const formatter = (item) => {
// handle string only document ids
if (typeof item === "string") {
item = {
type: "link",
href: item,
label: computeLabel(item) || item || "[unknown label]",
};
}
// handle object style docs
else if (item?.type?.toLowerCase() === "doc") {
item.type = "link";
item.href = item.id;
item.label = item.label || computeLabel(item.href) || "[unknown label]";
delete item.id;
}
// fix for local routing that does not specify starting at the site root
if (
!(
item?.href?.startsWith("/") ||
item?.href?.startsWith("http:") ||
item?.href?.startsWith("https")
)
)
item.href = `/${item?.href}`;
return item;
};

View File

@ -31,22 +31,125 @@ cat > "$CONFIG_FILE" <<EOF
"scope": "$VERCEL_SCOPE",
"redirects": [
{ "source": "/apps", "destination": "/developers" },
{ "source": "/developing/programming-model/overview", "destination": "/developers" },
{ "source": "/apps/backwards-compatibility", "destination": "/developing/backwards-compatibility" },
{ "source": "/apps/break", "destination": "/developing/on-chain-programs/examples" },
{ "source": "/apps/builtins", "destination": "/developing/runtime-facilities/programs" },
{ "source": "/apps/drones", "destination": "/developing/on-chain-programs/examples" },
{ "source": "/apps/hello-world", "destination": "/developing/on-chain-programs/examples" },
{ "source": "/apps/javascript-api", "destination": "/developing/clients/javascript-api" },
{ "source": "/apps/jsonrpc-api", "destination": "/api/http" },
{ "source": "/developing/clients/jsonrpc-api", "destination": "/api/http" },
{ "source": "/apps/programming-faq", "destination": "/developing/on-chain-programs/faq" },
{ "source": "/apps/rent", "destination": "/developing/programming-model/accounts#rent" },
{ "source": "/developing/programming-model/overview", "destination": "https://solana.com/docs/programs" },
{ "source": "/apps/break", "destination": "https://solana.com/docs/programs/examples" },
{ "source": "/apps/drones", "destination": "https://solana.com/docs/programs/examples" },
{ "source": "/apps/hello-world", "destination": "https://solana.com/docs/programs/examples" },
{ "source": "/apps/javascript-api", "destination": "https://solana.com/docs/clients/javascript" },
{ "source": "/apps/programming-faq", "destination": "https://solana.com/docs/programs/faq" },
{ "source": "/apps/rent", "destination": "https://solana.com/docs/core/rent" },
{ "source": "/apps/webwallet", "destination": "https://solana.com/docs/intro/wallets" },
{ "source": "/implemented-proposals/cross-program-invocation", "destination": "https://solana.com/docs/core/cpi" },
{ "source": "/implemented-proposals/program-derived-addresses", "destination": "https://solana.com/docs/core/cpi#program-derived-addresses" },
{ "source": "/apps/sysvars", "destination": "/developing/runtime-facilities/sysvars" },
{ "source": "/apps/webwallet", "destination": "/wallet-guide" },
{ "source": "/implemented-proposals/cross-program-invocation", "destination": "/developing/programming-model/calling-between-programs" },
{ "source": "/implemented-proposals/program-derived-addresses", "destination": "/developing/programming-model/calling-between-programs#program-derived-addresses" },
{ "source": "/implemented-proposals/secp256k1_instruction", "destination": "/developing/runtime-facilities/programs#secp256k1-program" }
{ "source": "/apps/builtins", "destination": "/developing/runtime-facilities/programs" },
{ "source": "/apps/backwards-compatibility", "destination": "/developing/backwards-compatibility" },
{ "source": "/implemented-proposals/secp256k1_instruction", "destination": "/developing/runtime-facilities/programs#secp256k1-program" },
{ "source": "/implemented-proposals/implemented-proposals", "destination": "/implemented-proposals" },
{ "source": "/cli/install-solana-cli-tools", "destination": "/cli/install" },
{ "source": "/cli/conventions", "destination": "/cli/intro" },
{ "source": "/cli/choose-a-cluster", "destination": "/cli/examples/choose-a-cluster" },
{ "source": "/cli/delegate-stake", "destination": "/cli/examples/delegate-stake" },
{ "source": "/delegate-stake", "destination": "/cli/examples/delegate-stake" },
{ "source": "/cli/sign-offchain-message", "destination": "/cli/examples/sign-offchain-message" },
{ "source": "/cli/deploy-a-program", "destination": "/cli/examples/deploy-a-program" },
{ "source": "/cli/transfer-tokens", "destination": "/cli/examples/transfer-tokens" },
{ "source": "/offline-signing/durable-nonce", "destination": "/cli/examples/durable-nonce" },
{ "source": "/offline-signing", "destination": "/cli/examples/offline-signing" },
{ "source": "/developing/test-validator", "destination": "/cli/examples/test-validator" },
{ "source": "/wallet-guide/cli", "destination": "/cli/wallets" },
{ "source": "/wallet-guide/paper-wallet", "destination": "/cli/wallets/paper" },
{ "source": "/wallet-guide/file-system-wallet", "destination": "/cli/wallets/file-system" },
{ "source": "/wallet-guide/hardware-wallet", "destination": "/cli/wallets/hardware-wallet" },
{ "source": "/wallet-guide/hardware-wallet/ledger", "destination": "/cli/wallets/hardware-wallet/ledger" },
{ "source": "/cluster/overview", "destination": "/clusters/index" },
{ "source": "/cluster/bench-tps", "destination": "/clusters/benchmark" },
{ "source": "/cluster/performance-metrics", "destination": "/clusters/metrics" },
{ "source": "/running-validator", "destination": "/operations" },
{ "source": "/validator/get-started/setup-a-validator", "destination": "/operations/setup-a-validator" },
{ "source": "/validator/get-started/setup-an-rpc-node", "destination": "/operations/setup-an-rpc-node" },
{ "source": "/validator/best-practices/operations", "destination": "/operations/best-practices/general" },
{ "source": "/validator/best-practices/monitoring", "destination": "/operations/best-practices/monitoring" },
{ "source": "/validator/best-practices/security", "destination": "/operations/best-practices/security" },
{ "source": "/validator/overview/running-validator-or-rpc-node", "destination": "/operations/validator-or-rpc-node" },
{ "source": "/validator/overview/validator-prerequisites", "destination": "/operations/prerequisites" },
{ "source": "/validator/overview/validator-initiatives", "destination": "/operations/validator-initiatives" },
{ "source": "/running-validator/validator-reqs", "destination": "/operations/requirements" },
{ "source": "/running-validator/validator-troubleshoot", "destination": "/operations/guides/validator-troubleshoot" },
{ "source": "/running-validator/validator-start", "destination": "/operations/guides/validator-start" },
{ "source": "/running-validator/vote-accounts", "destination": "/operations/guides/vote-accounts" },
{ "source": "/running-validator/validator-stake", "destination": "/operations/guides/validator-stake" },
{ "source": "/running-validator/validator-monitor", "destination": "/operations/guides/validator-monitor" },
{ "source": "/running-validator/validator-info", "destination": "/operations/guides/validator-info" },
{ "source": "/running-validator/validator-failover", "destination": "/operations/guides/validator-failover" },
{ "source": "/running-validator/restart-cluster", "destination": "/operations/guides/restart-cluster" },
{ "source": "/cluster/synchronization", "destination": "/consensus/synchronization" },
{ "source": "/cluster/leader-rotation", "destination": "/consensus/leader-rotation" },
{ "source": "/cluster/fork-generation", "destination": "/consensus/fork-generation" },
{ "source": "/cluster/managing-forks", "destination": "/consensus/managing-forks" },
{ "source": "/cluster/turbine-block-propagation", "destination": "/consensus/turbine-block-propagation" },
{ "source": "/cluster/commitments", "destination": "/consensus/commitments" },
{ "source": "/cluster/vote-signing", "destination": "/consensus/vote-signing" },
{ "source": "/cluster/stake-delegation-and-rewards", "destination": "/consensus/stake-delegation-and-rewards" },
{ "source": "/developing/backwards-compatibility", "destination": "/backwards-compatibility" },
{ "source": "/validator/faq", "destination": "/faq" },
{ "source": "/developing/plugins/geyser-plugins", "destination": "/validator/geyser" },
{ "source": "/validator/overview/what-is-an-rpc-node", "destination": "/what-is-an-rpc-node" },
{ "source": "/validator/overview/what-is-a-validator", "destination": "/what-is-a-validator" },
{ "source": "/developing/runtime-facilities/:path*", "destination": "/runtime/:path*" },
{ "destination": "https://solana.com/docs/rpc/:path*", "source": "/api/:path*" },
{ "destination": "https://solana.com/docs/rpc/:path*", "source": "/developing/clients/jsonrpc-api" },
{ "destination": "https://solana.com/docs/rpc/:path*", "source": "/apps/jsonrpc-api" },
{ "destination": "https://solana.com/docs/terminology", "source": "/terminology" },
{ "destination": "https://solana.com/docs/core/rent", "source": "/developing/intro/rent" },
{ "destination": "https://solana.com/docs/core/programs", "source": "/developing/intro/programs" },
{ "destination": "https://solana.com/docs/core/accounts", "source": "/developing/programming-model/accounts" },
{ "destination": "https://solana.com/docs/core/cpi", "source": "/developing/programming-model/calling-between-programs" },
{ "destination": "https://solana.com/docs/core/runtime", "source": "/developing/programming-model/runtime" },
{ "destination": "https://solana.com/docs/core/transactions", "source": "/developing/programming-model/transactions" },
{ "destination": "https://solana.com/docs/core/transactions/fees", "source": "/developing/intro/transaction_fees" },
{ "destination": "https://solana.com/docs/core/transactions/confirmation", "source": "/developing/transaction_confirmation" },
{ "destination": "https://solana.com/docs/core/transactions/versions", "source": "/developing/versioned-transactions" },
{ "destination": "https://solana.com/docs/core/transactions/retry", "source": "/integrations/retrying-transactions" },
{ "destination": "https://solana.com/docs/intro/dev", "source": "/developing/programming-model/overview" },
{ "destination": "https://solana.com/docs/advanced/lookup-tables", "source": "/developing/lookup-tables" },
{ "destination": "https://solana.com/docs/advanced/state-compression", "source": "/learn/state-compression" },
{ "destination": "https://solana.com/developers/guides/javascript/compressed-nfts", "source": "/developing/guides/compressed-nfts" },
{ "destination": "https://solana.com/docs/programs", "source": "/developing/on-chain-programs/overview" },
{ "destination": "https://solana.com/docs/programs/debugging", "source": "/developing/on-chain-programs/debugging" },
{ "destination": "https://solana.com/docs/programs/deploying", "source": "/developing/on-chain-programs/deploying" },
{ "destination": "https://solana.com/docs/programs/examples", "source": "/developing/on-chain-programs/examples" },
{ "destination": "https://solana.com/docs/programs/faq", "source": "/developing/on-chain-programs/faq" },
{ "destination": "https://solana.com/docs/programs/limitations", "source": "/developing/on-chain-programs/limitations" },
{ "destination": "https://solana.com/docs/programs/lang-rust", "source": "/developing/on-chain-programs/developing-rust" },
{ "destination": "https://solana.com/docs/programs/lang-c", "source": "/developing/on-chain-programs/developing-c" },
{ "destination": "https://solana.com/docs/clients/javascript-reference", "source": "/developing/clients/javascript-reference" },
{ "destination": "https://solana.com/docs/clients/javascript", "source": "/developing/clients/javascript-api" },
{ "destination": "https://solana.com/docs/clients/rust", "source": "/developing/clients/rust-api" },
{ "destination": "https://solana.com/docs/intro/dev", "source": "/getstarted/overview" },
{ "destination": "https://solana.com/developers/guides/getstarted/hello-world-in-your-browser", "source": "/getstarted/hello-world" },
{ "destination": "https://solana.com/developers/guides/getstarted/setup-local-development", "source": "/getstarted/local" },
{ "destination": "https://solana.com/developers/guides/getstarted/local-rust-hello-world", "source": "/getstarted/rust" },
{ "destination": "https://solana.com/docs/core/clusters", "source": "/clusters/rpc-endpoints" },
{ "destination": "https://solana.com/docs/economics/staking", "source": "/staking" },
{ "destination": "https://solana.com/docs/economics/staking/:path*", "source": "/staking/:path*" },
{ "destination": "https://solana.com/docs/economics/inflation/:path*", "source": "/inflation/:path*" },
{ "destination": "https://solana.com/docs/more/exchange", "source": "/integrations/exchange" },
{ "destination": "https://solana.com/docs/intro/transaction_fees", "source": "/transaction_fees" },
{ "destination": "https://solana.com/docs/intro/economics", "source": "/storage_rent_economics" },
{ "destination": "https://solana.com/docs/intro/economics", "source": "/economics_overview" },
{ "destination": "https://solana.com/docs/intro/history", "source": "/history" },
{ "destination": "https://solana.com/docs/intro/wallets", "source": "/wallet-guide/support" },
{ "destination": "https://solana.com/docs/intro/wallets", "source": "/wallet-guide" },
{ "destination": "https://solana.com/docs/intro", "source": "/introduction" }
]
}
EOF

View File

@ -1,523 +1,134 @@
module.exports = {
// load the API specific sidebars file
...require("./sidebars/api.js"),
introductionSidebar: [
{
type: "category",
collapsed: false,
label: "Introduction to Solana",
items: [
{
type: "doc",
id: "introduction",
label: "What is Solana?",
},
// This will be the future home for the economics overview page
// {
// type: "doc",
// id: "economics_overview",
// label: "How do the economics work?",
// },
{
type: "doc",
id: "history",
label: "History of Solana",
},
],
},
{
type: "category",
collapsed: false,
label: "Getting started with Solana",
items: [
{
type: "doc",
id: "wallet-guide",
label: "Wallets",
},
// This will be the future home of the `staking` page, with the introductory info on what staking on Solana looks like
// {
// type: "doc",
// id: "staking",
// label: "Staking",
// },
],
},
{
type: "category",
collapsed: false,
label: "Dive into Solana",
items: [
"terminology",
{
type: "link",
href: "/developers",
label: "Developers",
},
{
type: "ref",
label: "Validators",
id: "running-validator",
},
{
type: "ref",
label: "Command Line",
id: "cli",
},
{
type: "ref",
label: "Economics",
id: "economics_overview",
},
{
type: "ref",
label: "Proposals",
id: "proposals",
},
],
},
],
developerSidebar: [
{
type: "link",
href: "/developers",
label: "Overview",
},
{
type: "category",
label: "Get Started",
items: [
{
type: "link",
href: "/getstarted",
label: "All guides",
},
{
type: "doc",
id: "getstarted/overview",
label: "Overview",
},
{
type: "doc",
id: "getstarted/hello-world",
label: "Hello world",
},
{
type: "doc",
id: "getstarted/local",
label: "Local development",
},
{
type: "doc",
id: "getstarted/rust",
label: "Rust program",
},
// {
// type: "doc",
// id: "getstarted/token",
// label: "Create a token",
// },
// {
// type: "doc",
// id: "getstarted/nft",
// label: "Create a NFT",
// },
// {
// type: "doc",
// id: "getstarted/c",
// label: "C / C++",
// },
// {
// type: "doc",
// id: "getstarted/web3js",
// label: "Web3.js",
// },
],
},
{
type: "category",
label: "Core Concepts",
// collapsed: false,
items: [
{
type: "doc",
id: "developing/programming-model/accounts",
label: "Accounts",
},
{
type: "category",
label: "Transactions",
items: [
{
type: "doc",
id: "developing/programming-model/transactions",
label: "Overview",
},
{
type: "doc",
id: "developing/versioned-transactions",
label: "Versioned Transactions",
},
{
type: "doc",
id: "developing/lookup-tables",
label: "Address Lookup Tables",
},
{
type: "doc",
id: "developing/intro/transaction_fees",
label: "Transaction Fees",
},
{
type: "doc",
id: "developing/transaction_confirmation",
label: "Transaction Confirmation",
},
],
},
{
type: "doc",
id: "developing/intro/programs",
label: "Programs",
},
{
type: "doc",
id: "developing/intro/rent",
label: "Rent",
},
{
type: "doc",
id: "developing/programming-model/calling-between-programs",
label: "Calling between programs",
},
{
type: "doc",
id: "developing/programming-model/runtime",
label: "Runtime",
},
],
},
{
type: "category",
label: "Advanced Concepts",
// collapsed: false,
items: [
{
type: "doc",
id: "learn/state-compression",
label: "State Compression",
},
],
},
{
type: "category",
label: "Clients",
items: [
{
type: "link",
href: "/api",
label: "JSON RPC API",
},
{
type: "doc",
id: "developing/clients/javascript-api",
label: "Web3 JavaScript API",
},
{
type: "doc",
id: "developing/clients/javascript-reference",
label: "Web3 API Reference",
},
{
type: "doc",
id: "developing/clients/rust-api",
label: "Rust API",
},
],
},
{
type: "category",
label: "Guides",
items: [
{
type: "doc",
id: "developing/guides/compressed-nfts",
label: "Compressed NFTs",
},
],
},
{
type: "category",
label: "Writing Programs",
items: [
{
type: "doc",
id: "developing/on-chain-programs/overview",
label: "Overview",
},
{
type: "doc",
id: "developing/on-chain-programs/developing-rust",
label: "Developing with Rust",
},
{
type: "doc",
id: "developing/on-chain-programs/developing-c",
label: "Developing with C/C++",
},
{
type: "doc",
label: "Deploying",
id: "developing/on-chain-programs/deploying",
},
{
type: "doc",
label: "Debugging",
id: "developing/on-chain-programs/debugging",
},
{
type: "doc",
id: "developing/on-chain-programs/examples",
label: "Program Examples",
},
{
type: "doc",
id: "developing/on-chain-programs/limitations",
label: "Limitations",
},
{
type: "doc",
id: "developing/on-chain-programs/faq",
label: "FAQ",
},
],
},
{
type: "category",
label: "Native Programs",
items: [
{
type: "doc",
label: "Overview",
id: "developing/runtime-facilities/programs",
},
{
type: "doc",
id: "developing/runtime-facilities/sysvars",
label: "Sysvar Cluster Data",
},
{
type: "doc",
label: "ZK Token Proof Program",
id: "developing/runtime-facilities/zk-token-proof",
}
],
},
{
type: "category",
label: "Local Development",
collapsed: false,
items: [
{
type: "doc",
id: "developing/test-validator",
label: "Solana Test Validator",
},
],
},
{
type: "doc",
id: "developing/backwards-compatibility",
label: "Backward Compatibility Policy",
},
],
validatorsSidebar: [
"running-validator",
"validator/faq",
masterSidebar: [
"home",
{
type: "category",
label: "Introduction",
collapsed: false,
items: [
"validator/overview/what-is-a-validator",
"validator/overview/what-is-an-rpc-node",
"validator/overview/running-validator-or-rpc-node",
"validator/overview/validator-prerequisites",
"validator/overview/validator-initiatives",
"what-is-a-validator",
"what-is-an-rpc-node",
"faq",
"backwards-compatibility",
],
},
{
type: "category",
label: "Getting Started",
collapsed: false,
label: "Command Line Tools",
// collapsed: false,
items: [
"running-validator/validator-reqs",
"validator/get-started/setup-a-validator",
"validator/get-started/setup-an-rpc-node",
{
type: "autogenerated",
dirName: "cli",
},
],
},
{
type: "category",
label: "Best Practices",
collapsed: false,
label: "Architecture",
// collapsed: false,
items: [
"validator/best-practices/operations",
"validator/best-practices/monitoring",
"validator/best-practices/security",
],
},
{
type: "category",
label: "Voting Setup",
collapsed: false,
items: [
"running-validator/validator-start",
"running-validator/vote-accounts",
"running-validator/validator-stake",
"running-validator/validator-monitor",
"running-validator/validator-info",
"running-validator/validator-failover",
"running-validator/validator-troubleshoot",
],
},
{
type: "category",
label: "Geyser",
collapsed: false,
items: ["developing/plugins/geyser-plugins"],
},
],
cliSidebar: [
"cli",
"cli/install-solana-cli-tools",
{
type: "category",
label: "Command-line Wallets",
items: [
"wallet-guide/cli",
"wallet-guide/paper-wallet",
"architecture",
{
type: "category",
label: "Hardware Wallets",
label: "Clusters",
// collapsed: false,
items: [
"wallet-guide/hardware-wallets",
"wallet-guide/hardware-wallets/ledger",
{
type: "autogenerated",
dirName: "clusters",
},
],
},
"wallet-guide/file-system-wallet",
"wallet-guide/support",
],
},
"cli/conventions",
"cli/choose-a-cluster",
"cli/transfer-tokens",
"cli/delegate-stake",
"cli/deploy-a-program",
"offline-signing",
"offline-signing/durable-nonce",
"cli/usage",
"cli/sign-offchain-message",
],
architectureSidebar: [
{
type: "doc",
label: "What is a Solana Cluster?",
id: "cluster/overview",
},
{
type: "category",
label: "Clusters",
collapsed: false,
items: [
"clusters",
{
type: "doc",
label: "RPC Endpoints",
id: "cluster/rpc-endpoints",
type: "category",
label: "Consensus",
// collapsed: false,
items: [
{
type: "autogenerated",
dirName: "consensus",
},
],
},
"cluster/bench-tps",
"cluster/performance-metrics",
],
},
{
type: "category",
label: "Consensus",
collapsed: false,
items: [
"cluster/synchronization",
"cluster/leader-rotation",
"cluster/fork-generation",
"cluster/managing-forks",
"cluster/turbine-block-propagation",
"cluster/commitments",
"cluster/vote-signing",
"cluster/stake-delegation-and-rewards",
],
},
{
type: "category",
label: "Validators",
collapsed: false,
items: [
{
type: "doc",
label: "Overview",
id: "validator/anatomy",
type: "category",
label: "Runtime",
// collapsed: false,
items: [
{
type: "autogenerated",
dirName: "runtime",
},
],
},
{
type: "category",
label: "Validators",
// collapsed: false,
items: [
{
type: "autogenerated",
dirName: "validator",
},
],
},
"validator/tpu",
"validator/tvu",
"validator/blockstore",
"validator/gossip",
"validator/runtime",
],
},
],
"Design Proposals": [
"proposals",
{
type: "category",
label: "Accepted Proposals",
collapsed: true,
label: "Operating a Validator",
// collapsed: false,
link: {
type: "doc",
id: "operations/index",
},
items: [
{
type: "autogenerated",
dirName: "proposals",
dirName: "operations",
},
],
},
],
proposalsSidebar: [
{
type: "category",
label: "Implemented Proposals",
collapsed: true,
label: "System Design Proposals",
collapsed: false,
items: [
"proposals",
{
type: "autogenerated",
dirName: "implemented-proposals",
type: "category",
label: "Accepted Proposals",
collapsed: true,
link: {
type: "doc",
id: "proposals/accepted-design-proposals",
},
items: [
{
type: "autogenerated",
dirName: "proposals",
},
],
},
{
type: "category",
label: "Implemented Proposals",
collapsed: true,
link: {
type: "doc",
id: "implemented-proposals/index",
},
items: [
{
type: "autogenerated",
dirName: "implemented-proposals",
},
],
},
],
},
],
stakingSidebar: ["staking", "staking/stake-accounts"],
integratingSidebar: [
"integrations/exchange",
"integrations/retrying-transactions",
],
economicsSidebar: [
{
type: "doc",
id: "economics_overview",
// label: "How do the economics work?",
},
{
type: "category",
label: "Inflation Design",
items: [
"inflation/terminology",
"inflation/inflation_schedule",
"inflation/adjusted_staking_yield",
],
},
"transaction_fees",
"storage_rent_economics",
],
};

View File

@ -1,502 +0,0 @@
module.exports = {
apiSidebar: [
{
type: "link",
href: "/api",
label: "JSON RPC API",
},
{
type: "doc",
id: "api/http",
label: "HTTP Methods",
},
{
type: "doc",
id: "api/websocket",
label: "Websocket Methods",
},
],
apiHttpMethodsSidebar: [
{
type: "link",
href: "/api",
label: "JSON RPC API",
},
{
type: "doc",
id: "api/websocket",
label: "Websocket Methods",
},
{
type: "category",
link: { type: "doc", id: "api/http" },
label: "HTTP Methods",
collapsed: false,
items: [
{
type: "link",
href: "#getaccountinfo",
label: "getAccountInfo",
},
{
type: "link",
href: "#getbalance",
label: "getBalance",
},
{
type: "link",
href: "#getblockheight",
label: "getBlockHeight",
},
{
type: "link",
href: "#getblock",
label: "getBlock",
},
{
type: "link",
href: "#getblockproduction",
label: "getBlockProduction",
},
{
type: "link",
href: "#getblockcommitment",
label: "getBlockCommitment",
},
{
type: "link",
href: "#getblocks",
label: "getBlocks",
},
{
type: "link",
href: "#getblockswithlimit",
label: "getBlocksWithLimit",
},
{
type: "link",
href: "#getblocktime",
label: "getBlockTime",
},
{
type: "link",
href: "#getclusternodes",
label: "getClusterNodes",
},
{
type: "link",
href: "#getepochinfo",
label: "getEpochInfo",
},
{
type: "link",
href: "#getepochschedule",
label: "getEpochSchedule",
},
{
type: "link",
href: "#getfeeformessage",
label: "getFeeForMessage",
},
{
type: "link",
href: "#getfirstavailableblock",
label: "getFirstAvailableBlock",
},
{
type: "link",
href: "#getgenesishash",
label: "getGenesisHash",
},
{
type: "link",
href: "#gethealth",
label: "getHealth",
},
{
type: "link",
href: "#gethighestsnapshotslot",
label: "getHighestSnapshotSlot",
},
{
type: "link",
href: "#getidentity",
label: "getIdentity",
},
{
type: "link",
href: "#getinflationgovernor",
label: "getInflationGovernor",
},
{
type: "link",
href: "#getinflationrate",
label: "getInflationRate",
},
{
type: "link",
href: "#getinflationreward",
label: "getInflationReward",
},
{
type: "link",
href: "#getlargestaccounts",
label: "getLargestAccounts",
},
{
type: "link",
href: "#getlatestblockhash",
label: "getLatestBlockhash",
},
{
type: "link",
href: "#getleaderschedule",
label: "getLeaderSchedule",
},
{
type: "link",
href: "#getmaxretransmitslot",
label: "getMaxRetransmitSlot",
},
{
type: "link",
href: "#getmaxshredinsertslot",
label: "getMaxShredInsertSlot",
},
{
type: "link",
href: "#getminimumbalanceforrentexemption",
label: "getMinimumBalanceForRentExemption",
},
{
type: "link",
href: "#getmultipleaccounts",
label: "getMultipleAccounts",
},
{
type: "link",
href: "#getprogramaccounts",
label: "getProgramAccounts",
},
{
type: "link",
href: "#getrecentperformancesamples",
label: "getRecentPerformanceSamples",
},
{
type: "link",
href: "#getrecentprioritizationfees",
label: "getRecentPrioritizationFees",
},
{
type: "link",
href: "#getsignaturesforaddress",
label: "getSignaturesForAddress",
},
{
type: "link",
href: "#getsignaturestatuses",
label: "getSignatureStatuses",
},
{
type: "link",
href: "#getslot",
label: "getSlot",
},
{
type: "link",
href: "#getslotleader",
label: "getSlotLeader",
},
{
type: "link",
href: "#getslotleaders",
label: "getSlotLeaders",
},
{
type: "link",
href: "#getstakeactivation",
label: "getStakeActivation",
},
{
type: "link",
href: "#getstakeminimumdelegation",
label: "getStakeMinimumDelegation",
},
{
type: "link",
href: "#getsupply",
label: "getSupply",
},
{
type: "link",
href: "#gettokenaccountbalance",
label: "getTokenAccountBalance",
},
{
type: "link",
href: "#gettokenaccountsbydelegate",
label: "getTokenAccountsByDelegate",
},
{
type: "link",
href: "#gettokenaccountsbyowner",
label: "getTokenAccountsByOwner",
},
{
type: "link",
href: "#gettokenlargestaccounts",
label: "getTokenLargestAccounts",
},
{
type: "link",
href: "#gettokensupply",
label: "getTokenSupply",
},
{
type: "link",
href: "#gettransaction",
label: "getTransaction",
},
{
type: "link",
href: "#gettransactioncount",
label: "getTransactionCount",
},
{
type: "link",
href: "#getversion",
label: "getVersion",
},
{
type: "link",
href: "#getvoteaccounts",
label: "getVoteAccounts",
},
{
type: "link",
href: "#isblockhashvalid",
label: "isBlockhashValid",
},
{
type: "link",
href: "#minimumledgerslot",
label: "minimumLedgerSlot",
},
{
type: "link",
href: "#requestairdrop",
label: "requestAirdrop",
},
{
type: "link",
href: "#sendtransaction",
label: "sendTransaction",
},
{
type: "link",
href: "#simulatetransaction",
label: "simulateTransaction",
},
],
},
// {
// type: "category",
// label: "Unstable Methods",
// collapsed: true,
// items: [
// {
// type: "link",
// href: "#blocksubscribe",
// label: "blockSubscribe",
// },
// ],
// },
{
type: "category",
label: "Deprecated Methods",
collapsed: true,
items: [
{
type: "link",
href: "#getconfirmedblock",
label: "getConfirmedBlock",
},
{
type: "link",
href: "#getconfirmedblocks",
label: "getConfirmedBlocks",
},
{
type: "link",
href: "#getconfirmedblockswithlimit",
label: "getConfirmedBlocksWithLimit",
},
{
type: "link",
href: "#getconfirmedsignaturesforaddress2",
label: "getConfirmedSignaturesForAddress2",
},
{
type: "link",
href: "#getconfirmedtransaction",
label: "getConfirmedTransaction",
},
{
type: "link",
href: "#getfeecalculatorforblockhash",
label: "getFeeCalculatorForBlockhash",
},
{
type: "link",
href: "#getfeerategovernor",
label: "getFeeRateGovernor",
},
{
type: "link",
href: "#getfees",
label: "getFees",
},
{
type: "link",
href: "#getrecentblockhash",
label: "getRecentBlockhash",
},
{
type: "link",
href: "#getsnapshotslot",
label: "getSnapshotSlot",
},
],
},
],
apiWebsocketMethodsSidebar: [
{
type: "link",
href: "/api",
label: "JSON RPC API",
},
{
type: "doc",
id: "api/http",
label: "HTTP Methods",
},
{
type: "category",
link: { type: "doc", id: "api/websocket" },
label: "Websocket Methods",
collapsed: false,
items: [
{
type: "link",
href: "#accountsubscribe",
label: "accountSubscribe",
},
{
type: "link",
href: "#accountunsubscribe",
label: "accountUnsubscribe",
},
{
type: "link",
href: "#logssubscribe",
label: "logsSubscribe",
},
{
type: "link",
href: "#logsunsubscribe",
label: "logsUnsubscribe",
},
{
type: "link",
href: "#programsubscribe",
label: "programSubscribe",
},
{
type: "link",
href: "#programunsubscribe",
label: "programUnsubscribe",
},
{
type: "link",
href: "#rootsubscribe",
label: "rootSubscribe",
},
{
type: "link",
href: "#rootunsubscribe",
label: "rootUnsubscribe",
},
{
type: "link",
href: "#signaturesubscribe",
label: "signatureSubscribe",
},
{
type: "link",
href: "#signatureunsubscribe",
label: "signatureUnsubscribe",
},
{
type: "link",
href: "#slotsubscribe",
label: "slotSubscribe",
},
{
type: "link",
href: "#slotunsubscribe",
label: "slotUnsubscribe",
},
],
},
{
type: "category",
label: "Unstable Methods",
collapsed: false,
items: [
{
type: "link",
href: "#blocksubscribe",
label: "blockSubscribe",
},
{
type: "link",
href: "#blockunsubscribe",
label: "blockUnsubscribe",
},
{
type: "link",
href: "#slotsupdatessubscribe",
label: "slotsUpdatesSubscribe",
},
{
type: "link",
href: "#slotsupdatesunsubscribe",
label: "slotsUpdatesUnsubscribe",
},
{
type: "link",
href: "#votesubscribe",
label: "voteSubscribe",
},
{
type: "link",
href: "#voteunsubscribe",
label: "voteUnsubscribe",
},
],
},
// {
// type: "category",
// label: "Deprecated Methods",
// collapsed: true,
// items: [
// {
// type: "link",
// href: "#getconfirmedblock",
// label: "getConfirmedBlock",
// },
// ],
// },
],
};

View File

@ -1,169 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getConfirmedBlock
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0.
**Please use [getBlock](#getblock) instead**
:::
Returns identity and transaction information about a confirmed block in the ledger
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
slot number, as u64 integer
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
defaultValue="finalized"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field
name="transactionDetails"
type="string"
defaultValue="full"
optional={true}
>
level of transaction detail to return, either "full", "signatures", or "none"
</Field>
<Field name="rewards" type="bool" defaultValue={true} optional={true}>
whether to populate the `rewards` array.
</Field>
<Field name="encoding" type="string" defaultValue="json" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["json", "base58", "base64", "jsonParsed"]} />
<details>
- `jsonParsed` encoding attempts to use program-specific instruction parsers to return
more human-readable and explicit data in the `transaction.message.instructions` list.
- If `jsonParsed` is requested but a parser cannot be found, the instruction
falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields).
</details>
</Field>
</Parameter>
### Result:
The result field will be an object with the following fields:
- `<null>` - if specified block is not confirmed
- `<object>` - if block is confirmed, an object with the following fields:
- `blockhash: <string>` - the blockhash of this block, as base-58 encoded string
- `previousBlockhash: <string>` - the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111"
- `parentSlot: <u64>` - the slot index of this block's parent
- `transactions: <array>` - present if "full" transaction details are requested; an array of JSON objects containing:
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `meta: <object>` - transaction status metadata object, containing `null` or:
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
- `innerInstructions: <array|null>` - List of [inner instructions](#inner-instructions-structure) or `null` if inner instruction recording was not enabled during this transaction
- `preTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `postTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `logMessages: <array|null>` - array of string log messages or `null` if log message recording was not enabled during this transaction
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
- `signatures: <array>` - present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the block
- `rewards: <array>` - present if rewards are requested; an array of JSON objects containing:
- `pubkey: <string>` - The public key, as base-58 encoded string, of the account that received the reward
- `lamports: <i64>`- number of reward lamports credited or debited by the account, as a i64
- `postBalance: <u64>` - account balance in lamports after the reward was applied
- `rewardType: <string|undefined>` - type of reward: "fee", "rent", "voting", "staking"
- `commission: <u8|undefined>` - vote account commission when the reward was credited, only present for voting and staking rewards
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
#### For more details on returned data:
- [Transaction Structure](#transaction-structure)
- [Inner Instructions Structure](#inner-instructions-structure)
- [Token Balances Structure](#token-balances-structure)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getConfirmedBlock",
"params": [430, "base64"]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"rewards": [],
"transactions": [
{
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"logMessages": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"transaction": [
"AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==",
"base64"
]
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,71 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getConfirmedBlocks
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getBlocks](#getblocks) instead**
:::
Returns a list of confirmed blocks between two slots
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
start_slot, as u64 integer
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result field will be an array of u64 integers listing confirmed blocks
between `start_slot` and either `end_slot` - if provided, or latest confirmed block,
inclusive. Max range allowed is 500,000 slots.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlocks","params":[5, 10]}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": [5, 6, 7, 8, 9, 10], "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,78 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getConfirmedBlocksWithLimit
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getBlocksWithLimit](#getblockswithlimit) instead**
:::
Returns a list of confirmed blocks starting at the given slot
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
start_slot, as u64 integer
</Parameter>
<Parameter type={"u64"} required={true}>
limit, as u64 integer
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result field will be an array of u64 integers listing confirmed blocks
starting at `start_slot` for up to `limit` blocks, inclusive.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getConfirmedBlocksWithLimit",
"params": [5, 3]
}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": [5, 6, 7], "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,114 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getConfirmedSignaturesForAddress2
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getSignaturesForAddress](#getsignaturesforaddress) instead**
:::
Returns signatures for confirmed transactions that include the given address in
their `accountKeys` list. Returns signatures backwards in time from the
provided signature or most recent confirmed block
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
account address, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
defaultValue="finalized"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="limit" type="number" optional={true}>
maximum transaction signatures to return (between 1 and 1,000, default:
1,000).
</Field>
<Field name="before" type="string" optional={true}>
start searching backwards from this transaction signature. (If not provided
the search starts from the top of the highest max confirmed block.)
</Field>
<Field name="until" type="string" optional={true}>
search until this transaction signature, if found before limit reached.
</Field>
</Parameter>
### Result:
The result field will be an array of `<object>`, ordered
from newest to oldest transaction, containing transaction signature information with the following fields:
- `signature: <string>` - transaction signature as base-58 encoded string
- `slot: <u64>` - The slot that contains the block with the transaction
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `memo: <string|null>` - Memo associated with the transaction, null if no memo is present
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getConfirmedSignaturesForAddress2",
"params": [
"Vote111111111111111111111111111111111111111",
{
"limit": 1
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"err": null,
"memo": null,
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 114,
"blockTime": null
}
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,133 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getConfirmedTransaction
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getTransaction](#gettransaction) instead**
:::
Returns transaction details for a confirmed transaction
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
transaction signature, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="encoding" defaultValue="json" type="string" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["json", "base58", "base64", "jsonParsed"]} />
<details>
- `base58` is slow and limited to less than 129 bytes of Account data.
- `jsonParsed` encoding attempts to use program-specific instruction parsers
to return more human-readable and explicit data in the `transaction.message.instructions` list.
- If `jsonParsed` is requested but a parser cannot be found, the instruction
falls back to regular `json` encoding (`accounts`, `data`, and `programIdIndex` fields).
</details>
</Field>
</Parameter>
### Result:
- `<null>` - if transaction is not found or not confirmed
- `<object>` - if transaction is confirmed, an object with the following fields:
- `slot: <u64>` - the slot this transaction was processed in
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
- `meta: <object|null>` - transaction status metadata object:
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/transaction/enum.TransactionError.html)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
- `innerInstructions: <array|null>` - List of [inner instructions](#inner-instructions-structure) or `null` if inner instruction recording was not enabled during this transaction
- `preTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `postTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `logMessages: <array|null>` - array of string log messages or `null` if log message recording was not enabled during this transaction
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getConfirmedTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"base64"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"status": {
"Ok": null
}
},
"slot": 430,
"transaction": [
"AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==",
"base64"
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,97 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getFeeCalculatorForBlockhash
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [isBlockhashValid](#isblockhashvalid) or [getFeeForMessage](#getfeeformessage) instead**
:::
Returns the fee calculator associated with the query blockhash, or `null` if the blockhash has expired
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
query blockhash, as a base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to:
- `<null>` - if the query blockhash has expired; or
- `<object>` - otherwise, a JSON object containing:
- `feeCalculator: <object>` - `FeeCalculator` object describing the cluster fee rate at the queried blockhash
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getFeeCalculatorForBlockhash",
"params": [
"GJxqhuxcgfn5Tcj6y3f8X4FeCDd2RQ6SnEMo1AAxrPRZ"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 221
},
"value": {
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,76 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getFeeRateGovernor
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
:::
Returns the fee rate governor information from the root bank
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
The result will be an RpcResponse JSON object with `value` equal to an `object` with the following fields:
- `burnPercent: <u8>` - Percentage of fees collected to be destroyed
- `maxLamportsPerSignature: <u64>` - Largest value `lamportsPerSignature` can attain for the next slot
- `minLamportsPerSignature: <u64>` - Smallest value `lamportsPerSignature` can attain for the next slot
- `targetLamportsPerSignature: <u64>` - Desired fee rate for the cluster
- `targetSignaturesPerSlot: <u64>` - Desired signature rate for the cluster
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getFeeRateGovernor"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 54
},
"value": {
"feeRateGovernor": {
"burnPercent": 50,
"maxLamportsPerSignature": 100000,
"minLamportsPerSignature": 5000,
"targetLamportsPerSignature": 10000,
"targetSignaturesPerSlot": 20000
}
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,92 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getFees
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getFeeForMessage](#getfeeformessage) instead**
:::
Returns a recent block hash from the ledger, a fee schedule that can be used to
compute the cost of submitting a transaction using it, and the last slot in
which the blockhash will be valid.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` set to a JSON object with the following fields:
- `blockhash: <string>` - a Hash as base-58 encoded string
- `feeCalculator: <object>` - FeeCalculator object, the fee schedule for this block hash
- `lastValidSlot: <u64>` - DEPRECATED - this value is inaccurate and should not be relied upon
- `lastValidBlockHeight: <u64>` - last [block height](../../terminology.md#block-height) at which the blockhash will be valid
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{ "jsonrpc":"2.0", "id": 1, "method":"getFees"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": {
"blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR",
"feeCalculator": {
"lamportsPerSignature": 5000
},
"lastValidSlot": 297,
"lastValidBlockHeight": 296
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,87 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getRecentBlockhash
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getLatestBlockhash](#getlatestblockhash) instead**
:::
Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
An RpcResponse containing a JSON object consisting of a string blockhash and FeeCalculator JSON object.
- `RpcResponse<object>` - RpcResponse JSON object with `value` field set to a JSON object including:
- `blockhash: <string>` - a Hash as base-58 encoded string
- `feeCalculator: <object>` - FeeCalculator object, the fee schedule for this block hash
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": {
"blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,64 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSnapshotSlot
:::warning DEPRECATED
This method is expected to be removed in solana-core v2.0
**Please use [getHighestSnapshotSlot](#gethighestsnapshotslot) instead**
:::
Returns the highest slot that the node has a snapshot for
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`<u64>` - Snapshot slot
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSnapshotSlot"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 100, "id": 1 }
```
Result when the node has no snapshot:
```json
{
"jsonrpc": "2.0",
"error": { "code": -32008, "message": "No snapshot" },
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,417 +0,0 @@
---
title: JSON RPC HTTP Methods
displayed_sidebar: apiHttpMethodsSidebar
hide_table_of_contents: true
---
Solana nodes accept HTTP requests using the [JSON-RPC 2.0](https://www.jsonrpc.org/specification) specification.
:::info
For JavaScript applications, use the [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) library as a convenient interface for the RPC methods to interact with a Solana node.
For an PubSub connection to a Solana node, use the [Websocket API](./websocket.md).
:::
## RPC HTTP Endpoint
**Default port:** 8899 e.g. [http://localhost:8899](http://localhost:8899), [http://192.168.1.88:8899](http://192.168.1.88:8899)
## Request Formatting
To make a JSON-RPC request, send an HTTP POST request with a `Content-Type: application/json` header. The JSON request data should contain 4 fields:
- `jsonrpc: <string>` - set to `"2.0"`
- `id: <number>` - a unique client-generated identifying integer
- `method: <string>` - a string containing the method to be invoked
- `params: <array>` - a JSON array of ordered parameter values
Example using curl:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
]
}
'
```
The response output will be a JSON object with the following fields:
- `jsonrpc: <string>` - matching the request specification
- `id: <number>` - matching the request identifier
- `result: <array|number|object|string>` - requested data or success confirmation
Requests can be sent in batches by sending an array of JSON-RPC request objects as the data for a single POST.
## Definitions
- Hash: A SHA-256 hash of a chunk of data.
- Pubkey: The public key of a Ed25519 key-pair.
- Transaction: A list of Solana instructions signed by a client keypair to authorize those actions.
- Signature: An Ed25519 signature of transaction's payload data including instructions. This can be used to identify transactions.
## Configuring State Commitment
For preflight checks and transaction processing, Solana nodes choose which bank
state to query based on a commitment requirement set by the client. The
commitment describes how finalized a block is at that point in time. When
querying the ledger state, it's recommended to use lower levels of commitment
to report progress and higher levels to ensure the state will not be rolled back.
In descending order of commitment (most finalized to least finalized), clients
may specify:
- `"finalized"` - the node will query the most recent block confirmed by supermajority
of the cluster as having reached maximum lockout, meaning the cluster has
recognized this block as finalized
- `"confirmed"` - the node will query the most recent block that has been voted on by supermajority of the cluster.
- It incorporates votes from gossip and replay.
- It does not count votes on descendants of a block, only direct votes on that block.
- This confirmation level also upholds "optimistic confirmation" guarantees in
release 1.3 and onwards.
- `"processed"` - the node will query its most recent block. Note that the block
may still be skipped by the cluster.
For processing many dependent transactions in series, it's recommended to use
`"confirmed"` commitment, which balances speed with rollback safety.
For total safety, it's recommended to use`"finalized"` commitment.
#### Example
The commitment parameter should be included as the last element in the `params` array:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
{
"commitment": "finalized"
}
]
}
'
```
#### Default:
If commitment configuration is not provided, the node will default to `"finalized"` commitment
Only methods that query bank state accept the commitment parameter. They are indicated in the API Reference below.
#### RpcResponse Structure
Many methods that take a commitment parameter return an RpcResponse JSON object comprised of two parts:
- `context` : An RpcResponseContext JSON structure including a `slot` field at which the operation was evaluated.
- `value` : The value returned by the operation itself.
#### Parsed Responses
Some methods support an `encoding` parameter, and can return account or
instruction data in parsed JSON format if `"encoding":"jsonParsed"` is requested
and the node has a parser for the owning program. Solana nodes currently support
JSON parsing for the following native and SPL programs:
| Program | Account State | Instructions |
| ---------------------------- | ------------- | ------------ |
| Address Lookup | v1.15.0 | v1.15.0 |
| BPF Loader | n/a | stable |
| BPF Upgradeable Loader | stable | stable |
| Config | stable | |
| SPL Associated Token Account | n/a | stable |
| SPL Memo | n/a | stable |
| SPL Token | stable | stable |
| SPL Token 2022 | stable | stable |
| Stake | stable | stable |
| Vote | stable | stable |
The list of account parsers can be found [here](https://github.com/solana-labs/solana/blob/master/account-decoder/src/parse_account_data.rs), and instruction parsers [here](https://github.com/solana-labs/solana/blob/master/transaction-status/src/parse_instruction.rs).
## Filter criteria
Some methods support providing a `filters` object to enable pre-filtering the data returned within the RpcResponse JSON object. The following filters exist:
- `memcmp: object` - compares a provided series of bytes with program account data at a particular offset. Fields:
- `offset: usize` - offset into program account data to start comparison
- `bytes: string` - data to match, as encoded string
- `encoding: string` - encoding for filter `bytes` data, either "base58" or "base64". Data is limited in size to 128 or fewer decoded bytes.<br />
**NEW: This field, and base64 support generally, is only available in solana-core v1.14.0 or newer. Please omit when querying nodes on earlier versions**
- `dataSize: u64` - compares the program account data length with the provided data size
## Health Check
Although not a JSON RPC API, a `GET /health` at the RPC HTTP Endpoint provides a
health-check mechanism for use by load balancers or other network
infrastructure. This request will always return a HTTP 200 OK response with a body of
"ok", "behind" or "unknown":
- `ok`: The node is within `HEALTH_CHECK_SLOT_DISTANCE` slots from the latest cluster confirmed slot
- `behind { distance }`: The node is behind `distance` slots from the latest cluster confirmed slot where `distance > HEALTH_CHECK_SLOT_DISTANCE`
- `unknown`: The node is unable to determine where it stands in relation to the cluster
## JSON RPC API Reference
import GetAccountInfo from "./methods/\_getAccountInfo.mdx"
<GetAccountInfo />
import GetBalance from "./methods/\_getBalance.mdx"
<GetBalance />
import GetBlock from "./methods/\_getBlock.mdx"
<GetBlock />
import GetBlockHeight from "./methods/\_getBlockHeight.mdx"
<GetBlockHeight />
import GetBlockProduction from "./methods/\_getBlockProduction.mdx"
<GetBlockProduction />
import GetBlockCommitment from "./methods/\_getBlockCommitment.mdx"
<GetBlockCommitment />
import GetBlocks from "./methods/\_getBlocks.mdx"
<GetBlocks />
import GetBlocksWithLimit from "./methods/\_getBlocksWithLimit.mdx"
<GetBlocksWithLimit />
import GetBlockTime from "./methods/\_getBlockTime.mdx"
<GetBlockTime />
import GetClusterNodes from "./methods/\_getClusterNodes.mdx"
<GetClusterNodes />
import GetEpochInfo from "./methods/\_getEpochInfo.mdx"
<GetEpochInfo />
import GetEpochSchedule from "./methods/\_getEpochSchedule.mdx"
<GetEpochSchedule />
import GetFeeForMessage from "./methods/\_getFeeForMessage.mdx"
<GetFeeForMessage />
import GetFirstAvailableBlock from "./methods/\_getFirstAvailableBlock.mdx"
<GetFirstAvailableBlock />
import GetGenesisHash from "./methods/\_getGenesisHash.mdx"
<GetGenesisHash />
import GetHealth from "./methods/\_getHealth.mdx"
<GetHealth />
import GetHighestSnapshotSlot from "./methods/\_getHighestSnapshotSlot.mdx"
<GetHighestSnapshotSlot />
import GetIdentity from "./methods/\_getIdentity.mdx"
<GetIdentity />
import GetInflationGovernor from "./methods/\_getInflationGovernor.mdx"
<GetInflationGovernor />
import GetInflationRate from "./methods/\_getInflationRate.mdx"
<GetInflationRate />
import GetInflationReward from "./methods/\_getInflationReward.mdx"
<GetInflationReward />
import GetLargestAccounts from "./methods/\_getLargestAccounts.mdx"
<GetLargestAccounts />
import GetLatestBlockhash from "./methods/\_getLatestBlockhash.mdx"
<GetLatestBlockhash />
import GetLeaderSchedule from "./methods/\_getLeaderSchedule.mdx"
<GetLeaderSchedule />
import GetMaxRetransmitSlot from "./methods/\_getMaxRetransmitSlot.mdx"
<GetMaxRetransmitSlot />
import GetMaxShredInsertSlot from "./methods/\_getMaxShredInsertSlot.mdx"
<GetMaxShredInsertSlot />
import GetMinimumBalanceForRentExemption from "./methods/\_getMinimumBalanceForRentExemption.mdx"
<GetMinimumBalanceForRentExemption />
import GetMultipleAccounts from "./methods/\_getMultipleAccounts.mdx"
<GetMultipleAccounts />
import GetProgramAccounts from "./methods/\_getProgramAccounts.mdx"
<GetProgramAccounts />
import GetRecentPerformanceSamples from "./methods/\_getRecentPerformanceSamples.mdx"
<GetRecentPerformanceSamples />
import GetRecentPrioritizationFees from "./methods/\_getRecentPrioritizationFees.mdx"
<GetRecentPrioritizationFees />
import GetSignaturesForAddress from "./methods/\_getSignaturesForAddress.mdx"
<GetSignaturesForAddress />
import GetSignatureStatuses from "./methods/\_getSignatureStatuses.mdx"
<GetSignatureStatuses />
import GetSlot from "./methods/\_getSlot.mdx"
<GetSlot />
import GetSlotLeader from "./methods/\_getSlotLeader.mdx"
<GetSlotLeader />
import GetSlotLeaders from "./methods/\_getSlotLeaders.mdx"
<GetSlotLeaders />
import GetStakeActivation from "./methods/\_getStakeActivation.mdx"
<GetStakeActivation />
import GetStakeMinimumDelegation from "./methods/\_getStakeMinimumDelegation.mdx"
<GetStakeMinimumDelegation />
import GetSupply from "./methods/\_getSupply.mdx"
<GetSupply />
import GetTokenAccountBalance from "./methods/\_getTokenAccountBalance.mdx"
<GetTokenAccountBalance />
import GetTokenAccountsByDelegate from "./methods/\_getTokenAccountsByDelegate.mdx"
<GetTokenAccountsByDelegate />
import GetTokenAccountsByOwner from "./methods/\_getTokenAccountsByOwner.mdx"
<GetTokenAccountsByOwner />
import GetTokenLargestAccounts from "./methods/\_getTokenLargestAccounts.mdx"
<GetTokenLargestAccounts />
import GetTokenSupply from "./methods/\_getTokenSupply.mdx"
<GetTokenSupply />
import GetTransaction from "./methods/\_getTransaction.mdx"
<GetTransaction />
import GetTransactionCount from "./methods/\_getTransactionCount.mdx"
<GetTransactionCount />
import GetVersion from "./methods/\_getVersion.mdx"
<GetVersion />
import GetVoteAccounts from "./methods/\_getVoteAccounts.mdx"
<GetVoteAccounts />
import IsBlockhashValid from "./methods/\_isBlockhashValid.mdx"
<IsBlockhashValid />
import MinimumLedgerSlot from "./methods/\_minimumLedgerSlot.mdx"
<MinimumLedgerSlot />
import RequestAirdrop from "./methods/\_requestAirdrop.mdx"
<RequestAirdrop />
import SendTransaction from "./methods/\_sendTransaction.mdx"
<SendTransaction />
import SimulateTransaction from "./methods/\_simulateTransaction.mdx"
<SimulateTransaction />
## JSON RPC API Deprecated Methods
import GetConfirmedBlock from "./deprecated/\_getConfirmedBlock.mdx"
<GetConfirmedBlock />
import GetConfirmedBlocks from "./deprecated/\_getConfirmedBlocks.mdx"
<GetConfirmedBlocks />
import GetConfirmedBlocksWithLimit from "./deprecated/\_getConfirmedBlocksWithLimit.mdx"
<GetConfirmedBlocksWithLimit />
import GetConfirmedSignaturesForAddress2 from "./deprecated/\_getConfirmedSignaturesForAddress2.mdx"
<GetConfirmedSignaturesForAddress2 />
import GetConfirmedTransaction from "./deprecated/\_getConfirmedTransaction.mdx"
<GetConfirmedTransaction />
import GetFeeCalculatorForBlockhash from "./deprecated/\_getFeeCalculatorForBlockhash.mdx"
<GetFeeCalculatorForBlockhash />
import GetFeeRateGovernor from "./deprecated/\_getFeeRateGovernor.mdx"
<GetFeeRateGovernor />
import GetFees from "./deprecated/\_getFees.mdx"
<GetFees />
import GetRecentBlockhash from "./deprecated/\_getRecentBlockhash.mdx"
<GetRecentBlockhash />
import GetSnapshotSlot from "./deprecated/\_getSnapshotSlot.mdx"
<GetSnapshotSlot />

View File

@ -1,138 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getAccountInfo
Returns all information associated with the account of provided Pubkey
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="encoding" type="string" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["base58", "base64", "base64+zstd", "jsonParsed"]} />
<details>
- `base58` is slow and limited to less than 129 bytes of Account data.
- `base64` will return base64 encoded data for Account data of any size.
- `base64+zstd` compresses the Account data using [Zstandard](https://facebook.github.io/zstd/)
and base64-encodes the result.
- `jsonParsed` encoding attempts to use program-specific state parsers to return
more human-readable and explicit account state data.
- If `jsonParsed` is requested but a parser cannot be found, the field falls
back to `base64` encoding, detectable when the `data` field is type `string`.
</details>
</Field>
<Field name="dataSlice" type="object" optional={true}>
Request a slice of the account&apos;s data.
- `length: <usize>` - number of bytes to return
- `offset: <usize>` - byte offset from which to start reading
:::info
Data slicing is only available for <code>base58</code>, <code>base64</code>, or <code>base64+zstd</code> encodings.
:::
</Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to:
- `<null>` - if the requested account doesn't exist
- `<object>` - otherwise, a JSON object containing:
- `lamports: <u64>` - number of lamports assigned to this account, as a u64
- `owner: <string>` - base-58 encoded Pubkey of the program this account has been assigned to
- `data: <[string, encoding]|object>` - data associated with the account, either as encoded binary data or JSON format `{<program>: <state>}` - depending on encoding parameter
- `executable: <bool>` - boolean indicating if the account contains a program \(and is strictly read-only\)
- `rentEpoch: <u64>` - the epoch at which this account will next owe rent, as u64
- `size: <u64>` - the data size of the account
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getAccountInfo",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
{
"encoding": "base58"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHRTPuR3oZ1EioKtYGiYxpxMG5vpbZLsbcBYBEmZZcMKaSoGx9JZeAuWf",
"base58"
],
"executable": false,
"lamports": 1000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 2,
"space": 80
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,78 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBalance
Returns the balance of the account of provided Pubkey
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
`RpcResponse<u64>` - RpcResponse JSON object with `value` field set to the balance
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getBalance",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": { "context": { "slot": 1 }, "value": 0 },
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,288 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlock
Returns identity and transaction information about a confirmed block in the ledger
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
slot number, as <code>u64</code> integer
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
defaultValue={"finalized"}
href="/api/http#configuring-state-commitment"
>
<li>
the default is <code>finalized</code>
</li>
<li>
<code>processed</code> is not supported.
</li>
</Field>
<Field name="encoding" type="string" optional={true} defaultValue={"json"} href="/api/http#parsed-responses">
encoding format for each returned Transaction
<Values values={["json", "jsonParsed", "base58", "base64"]} />
<details>
- `jsonParsed` attempts to use program-specific instruction parsers to return
more human-readable and explicit data in the `transaction.message.instructions` list.
- If `jsonParsed` is requested but a parser cannot be found, the instruction
falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields).
</details>
</Field>
<Field name="transactionDetails" type="string" optional={true} defaultValue={"full"}>
level of transaction detail to return
<Values values={["full", "accounts", "signatures", "none"]} />
<details>
- If `accounts` are requested, transaction details only include signatures and
an annotated list of accounts in each transaction.
- Transaction metadata is limited to only: fee, err, pre_balances,
post_balances, pre_token_balances, and post_token_balances.
</details>
</Field>
<Field name="maxSupportedTransactionVersion" type="number" optional={true}>
the max transaction version to return in responses.
<details>
- If the requested block contains a transaction with a higher version, an
error will be returned.
- If this parameter is omitted, only legacy transactions will be returned, and
a block containing any versioned transaction will prompt the error.
</details>
</Field>
<Field name="rewards" type="bool" optional={true}>
whether to populate the `rewards` array. If parameter not provided, the
default includes rewards.
</Field>
</Parameter>
### Result:
The result field will be an object with the following fields:
- `<null>` - if specified block is not confirmed
- `<object>` - if block is confirmed, an object with the following fields:
- `blockhash: <string>` - the blockhash of this block, as base-58 encoded string
- `previousBlockhash: <string>` - the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111"
- `parentSlot: <u64>` - the slot index of this block's parent
- `transactions: <array>` - present if "full" transaction details are requested; an array of JSON objects containing:
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `meta: <object>` - transaction status metadata object, containing `null` or:
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
- `innerInstructions: <array|null>` - List of [inner instructions](#inner-instructions-structure) or `null` if inner instruction recording was not enabled during this transaction
- `preTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `postTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `logMessages: <array|null>` - array of string log messages or `null` if log message recording was not enabled during this transaction
- `rewards: <array|null>` - transaction-level rewards, populated if rewards are requested; an array of JSON objects containing:
- `pubkey: <string>` - The public key, as base-58 encoded string, of the account that received the reward
- `lamports: <i64>`- number of reward lamports credited or debited by the account, as a i64
- `postBalance: <u64>` - account balance in lamports after the reward was applied
- `rewardType: <string|undefined>` - type of reward: "fee", "rent", "voting", "staking"
- `commission: <u8|undefined>` - vote account commission when the reward was credited, only present for voting and staking rewards
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
- `loadedAddresses: <object|undefined>` - Transaction addresses loaded from address lookup tables. Undefined if `maxSupportedTransactionVersion` is not set in request params, or if `jsonParsed` encoding is set in request params.
- `writable: <array[string]>` - Ordered list of base-58 encoded addresses for writable loaded accounts
- `readonly: <array[string]>` - Ordered list of base-58 encoded addresses for readonly loaded accounts
- `returnData: <object|undefined>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `programId: <string>` - the program that generated the return data, as base-58 encoded Pubkey
- `data: <[string, encoding]>` - the return data itself, as base-64 encoded binary data
- `computeUnitsConsumed: <u64|undefined>` - number of [compute units](developing/programming-model/runtime.md#compute-budget) consumed by the transaction
- `version: <"legacy"|number|undefined>` - Transaction version. Undefined if `maxSupportedTransactionVersion` is not set in request params.
- `signatures: <array>` - present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the block
- `rewards: <array|undefined>` - block-level rewards, present if rewards are requested; an array of JSON objects containing:
- `pubkey: <string>` - The public key, as base-58 encoded string, of the account that received the reward
- `lamports: <i64>`- number of reward lamports credited or debited by the account, as a i64
- `postBalance: <u64>` - account balance in lamports after the reward was applied
- `rewardType: <string|undefined>` - type of reward: "fee", "rent", "voting", "staking"
- `commission: <u8|undefined>` - vote account commission when the reward was credited, only present for voting and staking rewards
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
- `blockHeight: <u64|null>` - the number of blocks beneath this block
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0","id":1,
"method":"getBlock",
"params": [
430,
{
"encoding": "json",
"maxSupportedTransactionVersion":0,
"transactionDetails":"full",
"rewards":false
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"blockHeight": 428,
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"transactions": [
{
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"logMessages": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"rewards": null,
"status": {
"Ok": null
}
},
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
"SysvarS1otHashes111111111111111111111111111",
"SysvarC1ock11111111111111111111111111111111",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 2, 3, 0],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
}
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
---
#### Transaction Structure
Transactions are quite different from those on other blockchains. Be sure to review [Anatomy of a Transaction](developing/programming-model/transactions.md) to learn about transactions on Solana.
The JSON structure of a transaction is defined as follows:
- `signatures: <array[string]>` - A list of base-58 encoded signatures applied to the transaction. The list is always of length `message.header.numRequiredSignatures` and not empty. The signature at index `i` corresponds to the public key at index `i` in `message.accountKeys`. The first one is used as the [transaction id](../../terminology.md#transaction-id).
- `message: <object>` - Defines the content of the transaction.
- `accountKeys: <array[string]>` - List of base-58 encoded public keys used by the transaction, including by the instructions and for signatures. The first `message.header.numRequiredSignatures` public keys must sign the transaction.
- `header: <object>` - Details the account types and signatures required by the transaction.
- `numRequiredSignatures: <number>` - The total number of signatures required to make the transaction valid. The signatures must match the first `numRequiredSignatures` of `message.accountKeys`.
- `numReadonlySignedAccounts: <number>` - The last `numReadonlySignedAccounts` of the signed keys are read-only accounts. Programs may process multiple transactions that load read-only accounts within a single PoH entry, but are not permitted to credit or debit lamports or modify account data. Transactions targeting the same read-write account are evaluated sequentially.
- `numReadonlyUnsignedAccounts: <number>` - The last `numReadonlyUnsignedAccounts` of the unsigned keys are read-only accounts.
- `recentBlockhash: <string>` - A base-58 encoded hash of a recent block in the ledger used to prevent transaction duplication and to give transactions lifetimes.
- `instructions: <array[object]>` - List of program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
- `programIdIndex: <number>` - Index into the `message.accountKeys` array indicating the program account that executes this instruction.
- `accounts: <array[number]>` - List of ordered indices into the `message.accountKeys` array indicating which accounts to pass to the program.
- `data: <string>` - The program input data encoded in a base-58 string.
- `addressTableLookups: <array[object]|undefined>` - List of address table lookups used by a transaction to dynamically load addresses from on-chain address lookup tables. Undefined if `maxSupportedTransactionVersion` is not set.
- `accountKey: <string>` - base-58 encoded public key for an address lookup table account.
- `writableIndexes: <array[number]>` - List of indices used to load addresses of writable accounts from a lookup table.
- `readonlyIndexes: <array[number]>` - List of indices used to load addresses of readonly accounts from a lookup table.
#### Inner Instructions Structure
The Solana runtime records the cross-program instructions that are invoked during transaction processing and makes these available for greater transparency of what was executed on-chain per transaction instruction. Invoked instructions are grouped by the originating transaction instruction and are listed in order of processing.
The JSON structure of inner instructions is defined as a list of objects in the following structure:
- `index: number` - Index of the transaction instruction from which the inner instruction(s) originated
- `instructions: <array[object]>` - Ordered list of inner program instructions that were invoked during a single transaction instruction.
- `programIdIndex: <number>` - Index into the `message.accountKeys` array indicating the program account that executes this instruction.
- `accounts: <array[number]>` - List of ordered indices into the `message.accountKeys` array indicating which accounts to pass to the program.
- `data: <string>` - The program input data encoded in a base-58 string.
#### Token Balances Structure
The JSON structure of token balances is defined as a list of objects in the following structure:
- `accountIndex: <number>` - Index of the account in which the token balance is provided for.
- `mint: <string>` - Pubkey of the token's mint.
- `owner: <string|undefined>` - Pubkey of token balance's owner.
- `programId: <string|undefined>` - Pubkey of the Token program that owns the account.
- `uiTokenAmount: <object>` -
- `amount: <string>` - Raw amount of tokens as a string, ignoring decimals.
- `decimals: <number>` - Number of decimals configured for token's mint.
- `uiAmount: <number|null>` - Token amount as a float, accounting for decimals. **DEPRECATED**
- `uiAmountString: <string>` - Token amount as a string, accounting for decimals.
</DocBlock>

View File

@ -1,70 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlockCommitment
Returns commitment for particular block
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
block number, identified by Slot
</Parameter>
### Result:
The result field will be a JSON object containing:
- `commitment` - commitment, comprising either:
- `<null>` - Unknown block
- `<array>` - commitment, array of u64 integers logging the amount of cluster stake in lamports that has voted on the block at each depth from 0 to `MAX_LOCKOUT_HISTORY` + 1
- `totalStake` - total active stake, in lamports, of the current epoch
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getBlockCommitment",
"params":[5]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"commitment": [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 10, 32
],
"totalStake": 42
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,73 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlockHeight
Returns the current block height of the node
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
- `<u64>` - Current block height
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0","id":1,
"method":"getBlockHeight"
}
'
```
Result:
### Response:
```json
{
"jsonrpc": "2.0",
"result": 1233,
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,97 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlockProduction
Returns recent block production information from the current or previous epoch.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="identity" type="string" optional={true}>
Only return results for this validator identity (base-58 encoded)
</Field>
<Field name="range" type="object" optional={true}>
Slot range to return block production for. If parameter not provided, defaults to current epoch.
- `firstSlot: <u64>` - first slot to return block production information for (inclusive)
- (optional) `lastSlot: <u64>` - last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to:
- `<object>`
- `byIdentity: <object>` - a dictionary of validator identities,
as base-58 encoded strings. Value is a two element array containing the
number of leader slots and the number of blocks produced.
- `range: <object>` - Block production slot range
- `firstSlot: <u64>` - first slot of the block production information (inclusive)
- `lastSlot: <u64>` - last slot of block production information (inclusive)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockProduction"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 9887
},
"value": {
"byIdentity": {
"85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr": [9888, 9886]
},
"range": {
"firstSlot": 0,
"lastSlot": 9887
}
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,81 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlockTime
Returns the estimated production time of a block.
:::info
Each validator reports their UTC time to the ledger on a regular interval by
intermittently adding a timestamp to a Vote for a particular block. A requested
block's time is calculated from the stake-weighted mean of the Vote timestamps
in a set of recent blocks recorded on the ledger.
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
block number, identified by Slot
</Parameter>
### Result:
- `<i64>` - estimated production time, as Unix timestamp (seconds since the Unix epoch)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0", "id":1,
"method": "getBlockTime",
"params":[5]
}
'
```
### Response:
When a block time is available:
```json
{
"jsonrpc": "2.0",
"result": 1574721591,
"id": 1
}
```
When a block time is not available:
```json
{
"jsonrpc": "2.0",
"error": {
"code": -32004,
"message": "Block not available for slot 150"
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,86 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlocks
Returns a list of confirmed blocks between two slots
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
start_slot, as <code>u64</code> integer
</Parameter>
<Parameter type={"u64"} optional={true}>
end_slot, as <code>u64</code> integer (must be no more than 500,000 blocks
higher than the `start_slot`)
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
defaultValue={"finalized"}
href="/api/http#configuring-state-commitment"
>
- "processed" is not supported
</Field>
</Parameter>
### Result:
The result field will be an array of u64 integers listing confirmed blocks
between `start_slot` and either `end_slot` - if provided, or latest confirmed block,
inclusive. Max range allowed is 500,000 slots.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getBlocks",
"params": [
5, 10
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [5, 6, 7, 8, 9, 10],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,84 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getBlocksWithLimit
Returns a list of confirmed blocks starting at the given slot
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} required={true}>
start_slot, as <code>u64</code> integer
</Parameter>
<Parameter type={"u64"} required={true}>
limit, as <code>u64</code> integer (must be no more than 500,000 blocks higher
than the <code>start_slot</code>)
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following field:
<Field
name="commitment"
type="string"
optional={true}
defaultValue="finalized"
href="/api/http#configuring-state-commitment"
>
- "processed" is not supported
</Field>
</Parameter>
### Result:
The result field will be an array of u64 integers listing confirmed blocks
starting at `start_slot` for up to `limit` blocks, inclusive.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id":1,
"method":"getBlocksWithLimit",
"params":[5, 3]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [5, 6, 7],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,71 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getClusterNodes
Returns information about all the nodes participating in the cluster
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
The result field will be an array of JSON objects, each with the following sub fields:
- `pubkey: <string>` - Node public key, as base-58 encoded string
- `gossip: <string|null>` - Gossip network address for the node
- `tpu: <string|null>` - TPU network address for the node
- `rpc: <string|null>` - JSON RPC network address for the node, or `null` if the JSON RPC service is not enabled
- `version: <string|null>` - The software version of the node, or `null` if the version information is not available
- `featureSet: <u32|null >` - The unique identifier of the node's feature set
- `shredVersion: <u16|null>` - The shred version the node has been configured to use
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getClusterNodes"
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"gossip": "10.239.6.48:8001",
"pubkey": "9QzsJf7LPLj8GkXbYT3LFDKqsj2hHG7TA3xinJHu8epQ",
"rpc": "10.239.6.48:8899",
"tpu": "10.239.6.48:8856",
"version": "1.0.0 c375ce1f"
}
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,81 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getEpochInfo
Returns information about the current epoch
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
The result field will be an object with the following fields:
- `absoluteSlot: <u64>` - the current slot
- `blockHeight: <u64>` - the current block height
- `epoch: <u64>` - the current epoch
- `slotIndex: <u64>` - the current slot relative to the start of the current epoch
- `slotsInEpoch: <u64>` - the number of slots in this epoch
- `transactionCount: <u64|null>` - total number of transactions processed without error since genesis
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"absoluteSlot": 166598,
"blockHeight": 166500,
"epoch": 27,
"slotIndex": 2790,
"slotsInEpoch": 8192,
"transactionCount": 22661093
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,67 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getEpochSchedule
Returns the epoch schedule information from this cluster's genesis config
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
The result field will be an object with the following fields:
- `slotsPerEpoch: <u64>` - the maximum number of slots in each epoch
- `leaderScheduleSlotOffset: <u64>` - the number of slots before beginning of an epoch to calculate a leader schedule for that epoch
- `warmup: <bool>` - whether epochs start short and grow
- `firstNormalEpoch: <u64>` - first normal-length epoch, log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)
- `firstNormalSlot: <u64>` - MINIMUM_SLOTS_PER_EPOCH \* (2.pow(firstNormalEpoch) - 1)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0","id":1,
"method":"getEpochSchedule"
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"firstNormalEpoch": 8,
"firstNormalSlot": 8160,
"leaderScheduleSlotOffset": 8192,
"slotsPerEpoch": 8192,
"warmup": true
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,86 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getFeeForMessage
Get the fee the network will charge for a particular Message
:::caution
**NEW: This method is only available in solana-core v1.9 or newer. Please use
[getFees](#getFees) for solana-core v1.8**
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Base-64 encoded Message
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
- `<u64|null>` - Fee corresponding to the message at the specified blockhash
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"id":1,
"jsonrpc":"2.0",
"method":"getFeeForMessage",
"params":[
"AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA",
{
"commitment":"processed"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": { "context": { "slot": 5068 }, "value": 5000 },
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,50 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getFirstAvailableBlock
Returns the slot of the lowest confirmed block that has not been purged from the ledger
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
- `<u64>` - Slot
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0","id":1,
"method":"getFirstAvailableBlock"
}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 250000, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,51 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getGenesisHash
Returns the genesis hash
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
- `<string>` - a Hash as base-58 encoded string
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getGenesisHash"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": "GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC",
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,83 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getHealth
Returns the current health of the node. A healthy node is one that is within
`HEALTH_CHECK_SLOT_DISTANCE` slots of the latest cluster confirmed slot.
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
If the node is healthy: "ok"
If the node is unhealthy, a JSON RPC error response is returned. The specifics of the error response are **UNSTABLE** and may change in the future
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getHealth"}
'
```
### Response:
Healthy Result:
```json
{ "jsonrpc": "2.0", "result": "ok", "id": 1 }
```
Unhealthy Result (generic):
```json
{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Node is unhealthy",
"data": {}
},
"id": 1
}
```
Unhealthy Result (if additional information is available)
```json
{
"jsonrpc": "2.0",
"error": {
"code": -32005,
"message": "Node is behind by 42 slots",
"data": {
"numSlotsBehind": 42
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,78 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getHighestSnapshotSlot
Returns the highest slot information that the node has snapshots for.
This will find the highest full snapshot slot, and the highest incremental
snapshot slot _based on_ the full snapshot slot, if there is one.
:::caution
NEW: This method is only available in solana-core v1.9 or newer. Please use
[getSnapshotSlot](/api/http#getsnapshotslot) for solana-core v1.8
:::
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
When the node has a snapshot, this returns a JSON object with the following fields:
- `full: <u64>` - Highest full snapshot slot
- `incremental: <u64|null>` - Highest incremental snapshot slot _based on_ `full`
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1,"method":"getHighestSnapshotSlot"}
'
```
### Response:
Result when the node has a snapshot:
```json
{
"jsonrpc": "2.0",
"result": {
"full": 100,
"incremental": 110
},
"id": 1
}
```
Result when the node has no snapshot:
```json
{
"jsonrpc": "2.0",
"error": { "code": -32008, "message": "No snapshot" },
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,55 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getIdentity
Returns the identity pubkey for the current node
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
The result field will be a JSON object with the following fields:
- `identity` - the identity pubkey of the current node \(as a base-58 encoded string\)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getIdentity"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"identity": "2r1F4iWqVcb8M1DbAjQuFpebkQHY9hcVU4WuW2DJBppN"
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,75 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getInflationGovernor
Returns the current inflation governor
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result field will be a JSON object with the following fields:
- `initial: <f64>` - the initial inflation percentage from time 0
- `terminal: <f64>` - terminal inflation percentage
- `taper: <f64>` - rate per year at which inflation is lowered. (Rate reduction is derived using the target slot time in genesis config)
- `foundation: <f64>` - percentage of total inflation allocated to the foundation
- `foundationTerm: <f64>` - duration of foundation pool inflation in years
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getInflationGovernor"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"foundation": 0.05,
"foundationTerm": 7,
"initial": 0.15,
"taper": 0.15,
"terminal": 0.015
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,62 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getInflationRate
Returns the specific inflation values for the current epoch
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
The result field will be a JSON object with the following fields:
- `total: <f64>` - total inflation
- `validator: <f64>` -inflation allocated to validators
- `foundation: <f64>` - inflation allocated to the foundation
- `epoch: <u64>` - epoch for which these values are valid
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getInflationRate"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"epoch": 100,
"foundation": 0.001,
"total": 0.149,
"validator": 0.148
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,101 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getInflationReward
Returns the inflation / staking reward for a list of addresses for an epoch
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"array"} optional={true}>
An array of addresses to query, as base-58 encoded strings
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="epoch" type="u64" optional={true}>
An epoch for which the reward occurs. If omitted, the previous epoch will be
used
</Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
The result field will be a JSON array with the following fields:
- `epoch: <u64>` - epoch for which reward occured
- `effectiveSlot: <u64>` - the slot in which the rewards are effective
- `amount: <u64>` - reward amount in lamports
- `postBalance: <u64>` - post balance of the account in lamports
- `commission: <u8|undefined>` - vote account commission when the reward was credited
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getInflationReward",
"params": [
[
"6dmNQ5jwLeLk5REvio1JcMshcbvkYMwy26sJ8pbkvStu",
"BGsqMegLpV6n6Ve146sSX2dTjUMj3M92HnU8BbNRMhF2"
],
{"epoch": 2}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"amount": 2500,
"effectiveSlot": 224,
"epoch": 2,
"postBalance": 499999442500
},
null
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,150 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getLargestAccounts
Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours)
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="filter" type="string" optional={true}>
filter results by account type
<Values values={["circulating", "nonCirculating"]} />
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to an array of `<object>` containing:
- `address: <string>` - base-58 encoded address of the account
- `lamports: <u64>` - number of lamports in the account, as a u64
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getLargestAccounts"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 54
},
"value": [
{
"lamports": 999974,
"address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ"
},
{
"lamports": 42,
"address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL"
},
{
"lamports": 42,
"address": "aYJCgU7REfu3XF8b3QhkqgqQvLizx8zxuLBHA25PzDS"
},
{
"lamports": 42,
"address": "CTvHVtQ4gd4gUcw3bdVgZJJqApXE9nCbbbP4VTS5wE1D"
},
{
"lamports": 20,
"address": "4fq3xJ6kfrh9RkJQsmVd5gNMvJbuSHfErywvEjNQDPxu"
},
{
"lamports": 4,
"address": "AXJADheGVp9cruP8WYu46oNkRbeASngN5fPCMVGQqNHa"
},
{
"lamports": 2,
"address": "8NT8yS6LiwNprgW4yM1jPPow7CwRUotddBVkrkWgYp24"
},
{
"lamports": 1,
"address": "SysvarEpochSchedu1e111111111111111111111111"
},
{
"lamports": 1,
"address": "11111111111111111111111111111111"
},
{
"lamports": 1,
"address": "Stake11111111111111111111111111111111111111"
},
{
"lamports": 1,
"address": "SysvarC1ock11111111111111111111111111111111"
},
{
"lamports": 1,
"address": "StakeConfig11111111111111111111111111111111"
},
{
"lamports": 1,
"address": "SysvarRent111111111111111111111111111111111"
},
{
"lamports": 1,
"address": "Config1111111111111111111111111111111111111"
},
{
"lamports": 1,
"address": "SysvarStakeHistory1111111111111111111111111"
},
{
"lamports": 1,
"address": "SysvarRecentB1ockHashes11111111111111111111"
},
{
"lamports": 1,
"address": "SysvarFees111111111111111111111111111111111"
},
{
"lamports": 1,
"address": "Vote111111111111111111111111111111111111111"
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,92 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getLatestBlockhash
Returns the latest blockhash
:::caution
NEW: This method is only available in solana-core v1.9 or newer. Please use
[getRecentBlockhash](#getrecentblockhash) for solana-core v1.8
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
`RpcResponse<object>` - RpcResponse JSON object with `value` field set to a JSON object including:
- `blockhash: <string>` - a Hash as base-58 encoded string
- `lastValidBlockHeight: <u64>` - last [block height](../../terminology.md#block-height) at which the blockhash will be valid
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"id":1,
"jsonrpc":"2.0",
"method":"getLatestBlockhash",
"params":[
{
"commitment":"processed"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 2792
},
"value": {
"blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
"lastValidBlockHeight": 3090
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,96 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getLeaderSchedule
Returns the leader schedule for an epoch
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} optional={true}>
Fetch the leader schedule for the epoch that corresponds to the provided slot.
<li>If unspecified, the leader schedule for the current epoch is fetched</li>
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="identity" type="string" optional={true}>
Only return results for this validator identity (base-58 encoded)
</Field>
</Parameter>
### Result:
Returns a result with one of the two following values:
- `<null>` - if requested epoch is not found, or
- `<object>` - the result field will be a dictionary of validator identities,
as base-58 encoded strings, and their corresponding leader slot indices as values
(indices are relative to the first slot in the requested epoch)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLeaderSchedule",
"params": [
null,
{
"identity": "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F": [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,48 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getMaxRetransmitSlot
Get the max slot seen from retransmit stage.
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`<u64>` - Slot number
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getMaxRetransmitSlot"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 1234, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,48 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getMaxShredInsertSlot
Get the max slot seen from after shred insert.
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`<u64>` - Slot number
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getMaxShredInsertSlot"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 1234, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,67 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getMinimumBalanceForRentExemption
Returns minimum balance required to make account rent exempt.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"usize"} optional={true}>
the Account's data length
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
`<u64>` - minimum lamports required in the Account to remain rent free
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getMinimumBalanceForRentExemption",
"params": [50]
}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 500, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,148 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getMultipleAccounts
Returns the account information for a list of Pubkeys.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"array"} required={true}>
An array of Pubkeys to query, as base-58 encoded strings (up to a maximum of
100)
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
<Field name="dataSlice" type="object" optional={true}>
Request a slice of the account&apos;s data.
- `length: <usize>` - number of bytes to return
- `offset: <usize>` - byte offset from which to start reading
:::info
Data slicing is only available for <code>base58</code>, <code>base64</code>, or <code>base64+zstd</code> encodings.
:::
</Field>
<Field name="encoding" type="string" optional={true} defaultValue={"base64"} href="/api/http#parsed-responses">
encoding format for the returned Account data
<Values values={["jsonParsed", "base58", "base64", "base64+zstd"]} />
<details>
- `base58` is slow and limited to less than 129 bytes of Account data.
- `base64` will return base64 encoded data for Account data of any size.
- `base64+zstd` compresses the Account data using [Zstandard](https://facebook.github.io/zstd/)
and base64-encodes the result.
- [`jsonParsed` encoding](/api/http#parsed-responses) attempts to use program-specific state parsers to
return more human-readable and explicit account state data.
- If `jsonParsed` is requested but a parser cannot be found, the field falls back to `base64`
encoding, detectable when the `data` field is type `<string>`.
</details>
</Field>
</Parameter>
### Result:
The result will be a JSON object with `value` equal to an array of:
- `<null>` - if the account at that Pubkey doesn't exist, or
- `<object>` - a JSON object containing:
- `lamports: <u64>` - number of lamports assigned to this account, as a u64
- `owner: <string>` - base-58 encoded Pubkey of the program this account has been assigned to
- `data: <[string, encoding]|object>` - data associated with the account, either as encoded binary data or JSON format `{<program>: <state>}` - depending on encoding parameter
- `executable: <bool>` - boolean indicating if the account contains a program \(and is strictly read-only\)
- `rentEpoch: <u64>` - the epoch at which this account will next owe rent, as u64
- `size: <u64>` - the data size of the account
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getMultipleAccounts",
"params": [
[
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
],
{
"encoding": "base58"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1
},
"value": [
{
"data": ["", "base64"],
"executable": false,
"lamports": 1000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 2,
"space": 16
},
{
"data": ["", "base64"],
"executable": false,
"lamports": 5000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 2,
"space": 0
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,164 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getProgramAccounts
Returns all accounts owned by the provided program Pubkey
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of program, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
<Field name="withContext" type="bool" optional={true}>
wrap the result in an RpcResponse JSON object
</Field>
<Field name="encoding" type="string" optional={true} defaultValue={"json"} href="/api/http#parsed-responses">
encoding format for the returned Account data
<Values values={["jsonParsed", "base58", "base64", "base64+zstd"]} />
<details>
- `base58` is slow and limited to less than 129 bytes of Account data.
- `base64` will return base64 encoded data for Account data of any size.
- `base64+zstd` compresses the Account data using [Zstandard](https://facebook.github.io/zstd/) and
base64-encodes the result.
- [`jsonParsed` encoding](/api/http#parsed-responses) attempts to use program-specific state
parsers to return more human-readable and explicit account state data.
- If `jsonParsed` is requested but a parser cannot be found, the field falls back
to `base64` encoding, detectable when the `data` field is type `<string>`.
</details>
</Field>
<Field name="dataSlice" type="object" optional={true}>
Request a slice of the account&apos;s data.
- `length: <usize>` - number of bytes to return
- `offset: <usize>` - byte offset from which to start reading
:::info
Data slicing is only available for <code>base58</code>, <code>base64</code>, or <code>base64+zstd</code> encodings.
:::
</Field>
<Field name="filters" type="array" optional={true} href={"/api/http#filter-criteria"}>
filter results using up to 4 filter objects
:::info
The resultant account(s) must meet **ALL** filter criteria to be included in the returned results
:::
</Field>
</Parameter>
### Result:
By default, the result field will be an array of JSON objects.
:::info
If `withContext` flag is set the array will be wrapped in an RpcResponse JSON object.
:::
The resultant response array will contain:
- `pubkey: <string>` - the account Pubkey as base-58 encoded string
- `account: <object>` - a JSON object, with the following sub fields:
- `lamports: <u64>` - number of lamports assigned to this account, as a u64
- `owner: <string>` - base-58 encoded Pubkey of the program this account has been assigned to
- `data: <[string,encoding]|object>` - data associated with the account, either as encoded binary data or JSON format `{<program>: <state>}` - depending on encoding parameter
- `executable: <bool>` - boolean indicating if the account contains a program \(and is strictly read-only\)
- `rentEpoch: <u64>` - the epoch at which this account will next owe rent, as u64
- `size: <u64>` - the data size of the account
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"filters": [
{
"dataSize": 17
},
{
"memcmp": {
"offset": 4,
"bytes": "3Mc6vR"
}
}
]
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"account": {
"data": "2R9jLfiAQ9bgdcw6h8s44439",
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28,
"space": 42
},
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
}
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,103 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getRecentPerformanceSamples
Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and
include the number of transactions and slots that occur in a given time window.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter name="limit" type={"usize"} optional={true}>
number of samples to return (maximum 720)
</Parameter>
### Result:
An array of `RpcPerfSample<object>` with the following fields:
- `slot: <u64>` - Slot in which sample was taken at
- `numTransactions: <u64>` - Number of transactions processed during the sample period
- `numSlots: <u64>` - Number of slots completed during the sample period
- `samplePeriodSecs: <u16>` - Number of seconds in a sample window
- `numNonVoteTransaction: <u64>` - Number of non-vote transactions processed during the
sample period.
:::info
`numNonVoteTransaction` is present starting with v1.15.
To get a number of voting transactions compute:<br />
`numTransactions - numNonVoteTransaction`
:::
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0", "id":1,
"method": "getRecentPerformanceSamples",
"params": [4]}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"numSlots": 126,
"numTransactions": 126,
"numNonVoteTransaction": 1,
"samplePeriodSecs": 60,
"slot": 348125
},
{
"numSlots": 126,
"numTransactions": 126,
"numNonVoteTransaction": 1,
"samplePeriodSecs": 60,
"slot": 347999
},
{
"numSlots": 125,
"numTransactions": 125,
"numNonVoteTransaction": 0,
"samplePeriodSecs": 60,
"slot": 347873
},
{
"numSlots": 125,
"numTransactions": 125,
"numNonVoteTransaction": 0,
"samplePeriodSecs": 60,
"slot": 347748
}
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,95 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getRecentPrioritizationFees
Returns a list of prioritization fees from recent blocks.
:::info
Currently, a node's prioritization-fee cache stores data from up to 150 blocks.
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"array"} optional={true}>
An array of Account addresses (up to a maximum of 128 addresses), as base-58 encoded strings
:::note
If this parameter is provided, the response will reflect a fee to land a transaction locking all of the provided accounts as writable.
:::
</Parameter>
### Result:
An array of `RpcPrioritizationFee<object>` with the following fields:
- `slot: <u64>` - slot in which the fee was observed
- `prioritizationFee: <u64>` - the per-compute-unit fee paid by at least
one successfully landed transaction, specified in increments of micro-lamports (0.000001 lamports)
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0", "id":1,
"method": "getRecentPrioritizationFees",
"params": [
["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"slot": 348125,
"prioritizationFee": 0
},
{
"slot": 348126,
"prioritizationFee": 1000
},
{
"slot": 348127,
"prioritizationFee": 500
},
{
"slot": 348128,
"prioritizationFee": 0
},
{
"slot": 348129,
"prioritizationFee": 1234
}
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,114 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSignatureStatuses
Returns the statuses of a list of signatures. Each signature must be a [txid](/terminology#transaction-id), the first signature of a transaction.
:::info
Unless the `searchTransactionHistory` configuration parameter is included,
this method only searches the recent status cache of signatures, which
retains statuses for all active slots plus `MAX_RECENT_BLOCKHASHES` rooted slots.
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"array"} required={true}>
An array of transaction signatures to confirm, as base-58 encoded strings (up
to a maximum of 256)
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field name="searchTransactionHistory" type="bool" optional={true}>
if `true` - a Solana node will search its ledger cache for any signatures not
found in the recent status cache
</Field>
</Parameter>
### Result:
An array of `RpcResponse<object>` consisting of either:
- `<null>` - Unknown transaction, or
- `<object>`
- `slot: <u64>` - The slot the transaction was processed
- `confirmations: <usize|null>` - Number of blocks since signature confirmation, null if rooted, as well as finalized by a supermajority of the cluster
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded.
See [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `confirmationStatus: <string|null>` - The transaction's cluster confirmation status;
Either `processed`, `confirmed`, or `finalized`. See [Commitment](/api/http#configuring-state-commitment) for more on optimistic confirmation.
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getSignatureStatuses",
"params": [
[
"5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"
],
{
"searchTransactionHistory": true
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 82
},
"value": [
{
"slot": 48,
"confirmations": null,
"err": null,
"status": {
"Ok": null
},
"confirmationStatus": "finalized"
},
null
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,117 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSignaturesForAddress
Returns signatures for confirmed transactions that include the given address in
their `accountKeys` list. Returns signatures backwards in time from the
provided signature or most recent confirmed block
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Account address as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
<Field name="limit" type="number" optional={true} defaultValue={"1000"}>
maximum transaction signatures to return (between 1 and 1,000).
</Field>
<Field name="before" type="string" optional={true}>
start searching backwards from this transaction signature. If not provided the
search starts from the top of the highest max confirmed block.
</Field>
<Field name="until" type="string" optional={true}>
search until this transaction signature, if found before limit reached
</Field>
</Parameter>
### Result:
An array of `<object>`, ordered from **newest** to **oldest** transaction, containing transaction
signature information with the following fields:
- `signature: <string>` - transaction signature as base-58 encoded string
- `slot: <u64>` - The slot that contains the block with the transaction
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded.
See [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
for more info.
- `memo: <string|null>` - Memo associated with the transaction, null if no memo is present
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch)
of when transaction was processed. null if not available.
- `confirmationStatus: <string|null>` - The transaction's cluster confirmation status;
Either `processed`, `confirmed`, or `finalized`. See [Commitment](/api/http#configuring-state-commitment)
for more on optimistic confirmation.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getSignaturesForAddress",
"params": [
"Vote111111111111111111111111111111111111111",
{
"limit": 1
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": [
{
"err": null,
"memo": null,
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"slot": 114,
"blockTime": null
}
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,63 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSlot
Returns the slot that has reached the [given or default commitment level](/api/http#configuring-state-commitment)
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
`<u64>` - Current slot
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSlot"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 1234, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,67 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSlotLeader
Returns the current slot leader
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
`<string>` - Node identity Pubkey as base-58 encoded string
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getSlotLeader"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": "ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS",
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,77 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSlotLeaders
Returns the slot leaders for a given slot range
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"u64"} optional={true}>
Start slot, as u64 integer
</Parameter>
<Parameter type={"u64"} optional={true}>
Limit, as u64 integer (between 1 and 5,000)
</Parameter>
### Result:
`<array[string]>` - array of Node identity public keys as base-58 encoded strings
</CodeParams>
<CodeSnippets>
### Code sample:
If the current slot is `#99` - query the next `10` leaders with the following request:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0", "id": 1,
"method": "getSlotLeaders",
"params": [100, 10]
}
'
```
### Response:
The first leader returned is the leader for slot `#100`:
```json
{
"jsonrpc": "2.0",
"result": [
"ChorusmmK7i1AxXeiTtQgQZhQNiXYU84ULeaYF1EH15n",
"ChorusmmK7i1AxXeiTtQgQZhQNiXYU84ULeaYF1EH15n",
"ChorusmmK7i1AxXeiTtQgQZhQNiXYU84ULeaYF1EH15n",
"ChorusmmK7i1AxXeiTtQgQZhQNiXYU84ULeaYF1EH15n",
"Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM",
"Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM",
"Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM",
"Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM",
"DWvDTSh3qfn88UoQTEKRV2JnLt5jtJAVoiCo3ivtMwXP",
"DWvDTSh3qfn88UoQTEKRV2JnLt5jtJAVoiCo3ivtMwXP"
],
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,96 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getStakeActivation
Returns epoch activation information for a stake account
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of stake Account to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
<Field name="epoch" type="u64" optional={true}>
epoch for which to calculate activation details. If parameter not provided,
defaults to current epoch.
**DEPRECATED**, inputs other than the current epoch return an error.
</Field>
</Parameter>
### Result:
The result will be a JSON object with the following fields:
- `state: <string>` - the stake account's activation state,
either: `active`, `inactive`, `activating`, or `deactivating`
- `active: <u64>` - stake active during the epoch
- `inactive: <u64>` - stake inactive during the epoch
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getStakeActivation",
"params": [
"CYRJWqiSjLitBAcRxPvWpgX3s5TvmN2SuRY3eEYypFvT",
{
"epoch": 4
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"active": 124429280,
"inactive": 73287840,
"state": "activating"
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,73 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getStakeMinimumDelegation
Returns the stake minimum delegation, in lamports.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to:
- `<u64>` - The stake minimum delegation, in lamports
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0", "id":1,
"method": "getStakeMinimumDelegation"
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 501
},
"value": 1000000000
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,87 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getSupply
Returns information about the current supply.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="excludeNonCirculatingAccountsList" type="bool" optional={true}>
exclude non circulating accounts list from response
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to a JSON object containing:
- `total: <u64>` - Total supply in lamports
- `circulating: <u64>` - Circulating supply in lamports
- `nonCirculating: <u64>` - Non-circulating supply in lamports
- `nonCirculatingAccounts: <array>` - an array of account addresses of non-circulating accounts, as strings. If `excludeNonCirculatingAccountsList` is enabled, the returned array will be empty.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0", "id":1, "method":"getSupply"}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": {
"circulating": 16000,
"nonCirculating": 1000000,
"nonCirculatingAccounts": [
"FEy8pTbP5fEoqMV1GdTz83byuA8EKByqYat1PKDgVAq5",
"9huDUZfxoJ7wGMTffUE7vh1xePqef7gyrLJu9NApncqA",
"3mi1GmwEE3zo2jmfDuzvjSX9ovRXsDUKHvsntpkhuLJ9",
"BYxEJTDerkaRWBem3XgnVcdhppktBXa2HbkHPKj2Ui4Z"
],
"total": 1016000
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,91 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTokenAccountBalance
Returns the token balance of an SPL Token account.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of Token account to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to a JSON object containing:
- `amount: <string>` - the raw balance without decimals, a string representation of u64
- `decimals: <u8>` - number of base 10 digits to the right of the decimal place
- `uiAmount: <number|null>` - the balance, using mint-prescribed decimals **DEPRECATED**
- `uiAmountString: <string>` - the balance as a string, using mint-prescribed decimals
For more details on returned data, the [Token Balances Structure](#token-balances-structure)
response from [getBlock](#getblock) follows a similar structure.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getTokenAccountBalance",
"params": [
"7fUAJdStEuGbc3sM84cKRL6yYaaSstyLSU4ve5oovLS7"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": {
"amount": "9864",
"decimals": 2,
"uiAmount": 98.64,
"uiAmountString": "98.64"
},
"id": 1
}
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,180 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTokenAccountsByDelegate
Returns all SPL Token accounts by approved Delegate.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account delegate to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
A JSON object with one of the following fields:
- `mint: <string>` - Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; or
- `programId: <string>` - Pubkey of the Token program that owns the accounts, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
<Field name="dataSlice" type="object" optional={true}>
Request a slice of the account&apos;s data.
- `length: <usize>` - number of bytes to return
- `offset: <usize>` - byte offset from which to start reading
:::info
Data slicing is only available for <code>base58</code>, <code>base64</code>, or <code>base64+zstd</code> encodings.
:::
</Field>
<Field name="encoding" type="string" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["base58", "base64", "base64+zstd", "jsonParsed"]} />
<details>
- `base58` is slow and limited to less than 129 bytes of Account data.
- `base64` will return base64 encoded data for Account data of any size.
- `base64+zstd` compresses the Account data using [Zstandard](https://facebook.github.io/zstd/)
and base64-encodes the result.
- `jsonParsed` encoding attempts to use program-specific state parsers to return
more human-readable and explicit account state data.
- If `jsonParsed` is requested but a parser cannot be found, the field falls
back to `base64` encoding, detectable when the `data` field is type `string`.
</details>
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to an array of JSON objects, which will contain:
- `pubkey: <string>` - the account Pubkey as base-58 encoded string
- `account: <object>` - a JSON object, with the following sub fields:
- `lamports: <u64>` - number of lamports assigned to this account, as a u64
- `owner: <string>` - base-58 encoded Pubkey of the program this account has been assigned to
- `data: <object>` - Token state data associated with the account, either as encoded binary data or in JSON format `{<program>: <state>}`
- `executable: <bool>` - boolean indicating if the account contains a program (and is strictly read-only\)
- `rentEpoch: <u64>` - the epoch at which this account will next owe rent, as u64
- `size: <u64>` - the data size of the account
When the data is requested with the `jsonParsed` encoding a format similar to that of the
[Token Balances Structure](#token-balances-structure) can be expected inside the structure,
both for the `tokenAmount` and the `delegatedAmount` - with the latter being an optional object.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByDelegate",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"account": {
"data": {
"program": "spl-token",
"parsed": {
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4,
"space": 165
},
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp"
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,179 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTokenAccountsByOwner
Returns all SPL Token accounts by token owner.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account delegate to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
A JSON object with one of the following fields:
- `mint: <string>` - Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; or
- `programId: <string>` - Pubkey of the Token program that owns the accounts, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
<Field name="dataSlice" type="object" optional={true}>
Request a slice of the account&apos;s data.
- `length: <usize>` - number of bytes to return
- `offset: <usize>` - byte offset from which to start reading
:::info
Data slicing is only available for <code>base58</code>, <code>base64</code>, or <code>base64+zstd</code> encodings.
:::
</Field>
<Field name="encoding" type="string" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["base58", "base64", "base64+zstd", "jsonParsed"]} />
<details>
- `base58` is slow and limited to less than 129 bytes of Account data.
- `base64` will return base64 encoded data for Account data of any size.
- `base64+zstd` compresses the Account data using [Zstandard](https://facebook.github.io/zstd/)
and base64-encodes the result.
- `jsonParsed` encoding attempts to use program-specific state parsers to return
more human-readable and explicit account state data.
- If `jsonParsed` is requested but a parser cannot be found, the field falls
back to `base64` encoding, detectable when the `data` field is type `string`.
</details>
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to an array of JSON objects, which will contain:
- `pubkey: <string>` - the account Pubkey as base-58 encoded string
- `account: <object>` - a JSON object, with the following sub fields:
- `lamports: <u64>` - number of lamports assigned to this account, as a u64
- `owner: <string>` - base-58 encoded Pubkey of the program this account has been assigned to
- `data: <object>` - Token state data associated with the account, either as encoded binary data or in JSON format `{<program>: <state>}`
- `executable: <bool>` - boolean indicating if the account contains a program \(and is strictly read-only\)
- `rentEpoch: <u64>` - the epoch at which this account will next owe rent, as u64
- `size: <u64>` - the data size of the account
When the data is requested with the `jsonParsed` encoding a format similar to that of the [Token Balances Structure](/api/http#token-balances-structure) can be expected inside the structure, both for the `tokenAmount` and the `delegatedAmount` - with the latter being an optional object.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F",
{
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"
},
{
"encoding": "jsonParsed"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"account": {
"data": {
"program": "spl-token",
"parsed": {
"accountType": "account",
"info": {
"tokenAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"delegate": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"delegatedAmount": {
"amount": "1",
"decimals": 1,
"uiAmount": 0.1,
"uiAmountString": "0.1"
},
"state": "initialized",
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E",
"owner": "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F"
},
"type": "account"
},
"space": 165
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 4,
"space": 165
},
"pubkey": "C2gJg6tKpQs41PRS1nC8aw3ZKNZK3HQQZGVrDFDup5nx"
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,99 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTokenLargestAccounts
Returns the 20 largest accounts of a particular SPL Token type.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of the token Mint to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to an array of JSON objects containing:
- `address: <string>` - the address of the token account
- `amount: <string>` - the raw token account balance without decimals, a string representation of u64
- `decimals: <u8>` - number of base 10 digits to the right of the decimal place
- `uiAmount: <number|null>` - the token account balance, using mint-prescribed decimals **DEPRECATED**
- `uiAmountString: <string>` - the token account balance as a string, using mint-prescribed decimals
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getTokenLargestAccounts",
"params": [
"3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"address": "FYjHNoFtSQ5uijKrZFyYAxvEr87hsKXkXcxkcmkBAf4r",
"amount": "771",
"decimals": 2,
"uiAmount": 7.71,
"uiAmountString": "7.71"
},
{
"address": "BnsywxTcaYeNUtzrPxQUvzAWxfzZe3ZLUJ4wMMuLESnu",
"amount": "229",
"decimals": 2,
"uiAmount": 2.29,
"uiAmountString": "2.29"
}
]
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,88 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTokenSupply
Returns the total supply of an SPL Token type.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of the token Mint to query, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` equal to a JSON object containing:
- `amount: <string>` - the raw total token supply without decimals, a string representation of u64
- `decimals: <u8>` - number of base 10 digits to the right of the decimal place
- `uiAmount: <number|null>` - the total token supply, using mint-prescribed decimals **DEPRECATED**
- `uiAmountString: <string>` - the total token supply as a string, using mint-prescribed decimals
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getTokenSupply",
"params": [
"3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": {
"amount": "100000",
"decimals": 2,
"uiAmount": 1000,
"uiAmountString": "1000"
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,172 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTransaction
Returns transaction details for a confirmed transaction
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Transaction signature, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="maxSupportedTransactionVersion" type="number" optional={true}>
Set the max transaction version to return in responses. If the requested
transaction is a higher version, an error will be returned. If this parameter
is omitted, only legacy transactions will be returned, and any versioned
transaction will prompt the error.
</Field>
<Field name="encoding" type="string" defaultValue="json" optional={true} href="/api/http#parsed-responses">
Encoding for the returned Transaction
<Values values={["json", "jsonParsed", "base64", "base58"]} />
<details>
- `jsonParsed` encoding attempts to use program-specific state parsers to return
more human-readable and explicit data in the `transaction.message.instructions` list.
- If `jsonParsed` is requested but a parser cannot be found, the instruction
falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields).
</details>
</Field>
</Parameter>
### Result:
- `<null>` - if transaction is not found or not confirmed
- `<object>` - if transaction is confirmed, an object with the following fields:
- `slot: <u64>` - the slot this transaction was processed in
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
- `meta: <object|null>` - transaction status metadata object:
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/transaction/enum.TransactionError.html)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
- `innerInstructions: <array|null>` - List of [inner instructions](#inner-instructions-structure) or `null` if inner instruction recording was not enabled during this transaction
- `preTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `postTokenBalances: <array|undefined>` - List of [token balances](#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
- `logMessages: <array|null>` - array of string log messages or `null` if log message recording was not enabled during this transaction
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
- `rewards: <array|null>` - transaction-level rewards, populated if rewards are requested; an array of JSON objects containing:
- `pubkey: <string>` - The public key, as base-58 encoded string, of the account that received the reward
- `lamports: <i64>`- number of reward lamports credited or debited by the account, as a i64
- `postBalance: <u64>` - account balance in lamports after the reward was applied
- `rewardType: <string>` - type of reward: currently only "rent", other types may be added in the future
- `commission: <u8|undefined>` - vote account commission when the reward was credited, only present for voting and staking rewards
- `loadedAddresses: <object|undefined>` - Transaction addresses loaded from address lookup tables. Undefined if `maxSupportedTransactionVersion` is not set in request params, or if `jsonParsed` encoding is set in request params.
- `writable: <array[string]>` - Ordered list of base-58 encoded addresses for writable loaded accounts
- `readonly: <array[string]>` - Ordered list of base-58 encoded addresses for readonly loaded accounts
- `returnData: <object|undefined>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `programId: <string>` - the program that generated the return data, as base-58 encoded Pubkey
- `data: <[string, encoding]>` - the return data itself, as base-64 encoded binary data
- `computeUnitsConsumed: <u64|undefined>` - number of [compute units](developing/programming-model/runtime.md#compute-budget) consumed by the transaction
- `version: <"legacy"|number|undefined>` - Transaction version. Undefined if `maxSupportedTransactionVersion` is not set in request params.
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"json"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"rewards": [],
"status": {
"Ok": null
}
},
"slot": 430,
"transaction": {
"message": {
"accountKeys": [
"3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
"AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
"SysvarS1otHashes111111111111111111111111111",
"SysvarC1ock11111111111111111111111111111111",
"Vote111111111111111111111111111111111111111"
],
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 3,
"numRequiredSignatures": 1
},
"instructions": [
{
"accounts": [1, 2, 3, 0],
"data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
"programIdIndex": 4
}
],
"recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
},
"signatures": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
]
}
},
"blockTime": null,
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,63 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getTransactionCount
Returns the current Transaction count from the ledger
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
`<u64>` - the current Transaction count from the ledger
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 268, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,51 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getVersion
Returns the current Solana version running on the node
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
The result field will be a JSON object with the following fields:
- `solana-core` - software version of solana-core as a `string`
- `feature-set` - unique identifier of the current software's feature set as a `u32`
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getVersion"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": { "feature-set": 2891131721, "solana-core": "1.16.7" }, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,114 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## getVoteAccounts
Returns the account info and associated stake for all the voting accounts in the current bank.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="votePubkey" type="string" optional={true}>
Only return results for this validator vote address (base-58 encoded)
</Field>
<Field name="keepUnstakedDelinquents" type="bool" optional={true}>
Do not filter out delinquent validators with no stake
</Field>
<Field name="delinquentSlotDistance" type="u64" optional={true}>
Specify the number of slots behind the tip that a validator must fall to be
considered delinquent. **NOTE:** For the sake of consistency between ecosystem
products, _it is **not** recommended that this argument be specified._
</Field>
</Parameter>
### Result:
The result field will be a JSON object of `current` and `delinquent` accounts,
each containing an array of JSON objects with the following sub fields:
- `votePubkey: <string>` - Vote account address, as base-58 encoded string
- `nodePubkey: <string>` - Validator identity, as base-58 encoded string
- `activatedStake: <u64>` - the stake, in lamports, delegated to this vote account and active in this epoch
- `epochVoteAccount: <bool>` - bool, whether the vote account is staked for this epoch
- `commission: <number>` - percentage (0-100) of rewards payout owed to the vote account
- `lastVote: <u64>` - Most recent slot voted on by this vote account
- `epochCredits: <array>` - Latest history of earned credits for up to five epochs, as an array of arrays containing: `[epoch, credits, previousCredits]`.
- `rootSlot: <u64>` - Current root slot for this vote account
</CodeParams>
<CodeSnippets>
### Code sample:
Restrict results to a single validator vote account:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getVoteAccounts",
"params": [
{
"votePubkey": "3ZT31jkAGhUaw8jsy4bTknwBMP8i4Eueh52By4zXcsVw"
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"current": [
{
"commission": 0,
"epochVoteAccount": true,
"epochCredits": [
[1, 64, 0],
[2, 192, 64]
],
"nodePubkey": "B97CCUW3AEZFGy6uUg6zUdnNYvnVq5VG8PUtb2HayTDD",
"lastVote": 147,
"activatedStake": 42,
"votePubkey": "3ZT31jkAGhUaw8jsy4bTknwBMP8i4Eueh52By4zXcsVw"
}
],
"delinquent": []
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,89 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## isBlockhashValid
Returns whether a blockhash is still valid or not
:::caution
NEW: This method is only available in solana-core v1.9 or newer. Please use
[getFeeCalculatorForBlockhash](#getfeecalculatorforblockhash) for solana-core v1.8
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
the blockhash of the block to evauluate, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="minContextSlot" type="number" optional={true}>
The minimum slot that the request can be evaluated at
</Field>
</Parameter>
### Result:
`<bool>` - `true` if the blockhash is still valid
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"id":45,
"jsonrpc":"2.0",
"method":"isBlockhashValid",
"params":[
"J7rBdM6AecPDEZp8aPq5iPSNKVkU5Q76F3oAV4eW5wsW",
{"commitment":"processed"}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 2483
},
"value": false
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,52 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## minimumLedgerSlot
Returns the lowest slot that the node has information about in its ledger.
:::info
This value may increase over time if the node is configured to purge older ledger data
:::
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`u64` - Minimum ledger slot number
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"minimumLedgerSlot"}
'
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 1234, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,78 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## requestAirdrop
Requests an airdrop of lamports to a Pubkey
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of account to receive lamports, as a base-58 encoded string
</Parameter>
<Parameter type={"integer"} required={true}>
lamports to airdrop, as a "u64"
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
`<string>` - Transaction Signature of the airdrop, as a base-58 encoded string
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "requestAirdrop",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
1000000000
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,124 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## sendTransaction
Submits a signed transaction to the cluster for processing.
This method does not alter the transaction in any way; it relays the
transaction created by clients to the node as-is.
If the node's rpc service receives the transaction, this method immediately
succeeds, without waiting for any confirmations. A successful response from
this method does not guarantee the transaction is processed or confirmed by the
cluster.
While the rpc service will reasonably retry to submit it, the transaction
could be rejected if transaction's `recent_blockhash` expires before it lands.
Use [`getSignatureStatuses`](#getsignaturestatuses) to ensure a transaction is processed and confirmed.
Before submitting, the following preflight checks are performed:
1. The transaction signatures are verified
2. The transaction is simulated against the bank slot specified by the preflight
commitment. On failure an error will be returned. Preflight checks may be
disabled if desired. It is recommended to specify the same commitment and
preflight commitment to avoid confusing behavior.
The returned signature is the first signature in the transaction, which
is used to identify the transaction ([transaction id](../../terminology.md#transaction-id)).
This identifier can be easily extracted from the transaction data before
submission.
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Fully-signed Transaction, as encoded string.
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following optional fields:
<Field name="encoding" type="string" defaultValue="base58" href="/api/http#parsed-responses">
Encoding used for the transaction data.
Values: `base58` (_slow_, **DEPRECATED**), or `base64`.
</Field>
<Field name="skipPreflight" type="bool" defaultValue="false">
if "true", skip the preflight transaction checks
</Field>
<Field
name="preflightCommitment"
type="string"
href="/api/http#configuring-state-commitment"
defaultValue="finalized"
>
Commitment level to use for preflight.
</Field>
<Field name="maxRetries" type="usize">
Maximum number of times for the RPC node to retry sending the transaction to
the leader. If this parameter not provided, the RPC node will retry the
transaction until it is finalized or until the blockhash expires.
</Field>
<Field name="minContextSlot" type="number">
set the minimum slot at which to perform preflight transaction checks
</Field>
</Parameter>
### Result:
`<string>` - First Transaction Signature embedded in the transaction, as base-58 encoded string ([transaction id](../../terminology.md#transaction-id))
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "sendTransaction",
"params": [
"4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb",
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,174 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## simulateTransaction
Simulate sending a transaction
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Transaction, as an encoded string.
:::note
The transaction must have a valid blockhash, but is not required to be signed.
:::
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
defaultValue="finalized"
optional={true}
href="/api/http#configuring-state-commitment"
>
Commitment level to simulate the transaction at
</Field>
<Field name="sigVerify" type="bool" optional={true} defaultValue={false}>
if `true` the transaction signatures will be verified (conflicts with
`replaceRecentBlockhash`)
</Field>
<Field
name="replaceRecentBlockhash"
type="bool"
optional={true}
defaultValue={false}
>
if `true` the transaction recent blockhash will be replaced with the most
recent blockhash. (conflicts with `sigVerify`)
</Field>
<Field name="minContextSlot" type="number" optional={true}>
the minimum slot that the request can be evaluated at
</Field>
<Field name="encoding" type="string" defaultValue="base58" optional={true}>
Encoding used for the transaction data.
Values: `base58` (_slow_, **DEPRECATED**), or `base64`.
</Field>
<Field name="accounts" type={"object"} optional={true}>
Accounts configuration object containing the following fields:
<Field name="addresses" type="array">
An `array` of accounts to return, as base-58 encoded strings
</Field>
<Field name="encoding" type="string" defaultValue="base64">
encoding for returned Account data
<Values values={["base64", "base58", "base64+zstd", "jsonParsed"]} />
<details>
- `jsonParsed` encoding attempts to use program-specific state
parsers to return more human-readable and explicit account state data.
- If `jsonParsed` is requested but a [parser cannot be found](https://github.com/solana-labs/solana/blob/cfd0a00ae2ba85a6d76757df8b4fa38ed242d185/account-decoder/src/parse_account_data.rs#L98-L100), the field falls
back to `base64` encoding, detectable when the returned `accounts.data` field is type `string`.
</details>
</Field>
</Field>
</Parameter>
### Result:
The result will be an RpcResponse JSON object with `value` set to a JSON object with the following fields:
- `err: <object|string|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array|null>` - Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
- `accounts: <array|null>` - array of accounts with the same length as the `accounts.addresses` array in the request
- `<null>` - if the account doesn't exist or if `err` is not null
- `<object>` - otherwise, a JSON object containing:
- `lamports: <u64>` - number of lamports assigned to this account, as a u64
- `owner: <string>` - base-58 encoded Pubkey of the program this account has been assigned to
- `data: <[string, encoding]|object>` - data associated with the account, either as encoded binary data or JSON format `{<program>: <state>}` - depending on encoding parameter
- `executable: <bool>` - boolean indicating if the account contains a program \(and is strictly read-only\)
- `rentEpoch: <u64>` - the epoch at which this account will next owe rent, as u64
- `unitsConsumed: <u64|undefined>` - The number of compute budget units consumed during the processing of this transaction
- `returnData: <object|null>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `programId: <string>` - the program that generated the return data, as base-58 encoded Pubkey
- `data: <[string, encoding]>` - the return data itself, as base-64 encoded binary data
</CodeParams>
<CodeSnippets>
### Code sample:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "simulateTransaction",
"params": [
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=",
{
"encoding":"base64",
}
]
}
'
```
### Response:
```json
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 218
},
"value": {
"err": null,
"accounts": null,
"logs": [
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri invoke [1]",
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri consumed 2366 of 1400000 compute units",
"Program return: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri KgAAAAAAAAA=",
"Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
],
"returnData": {
"data": ["Kg==", "base64"],
"programId": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
},
"unitsConsumed": 2366
}
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,91 +0,0 @@
---
title: RPC Websocket API
displayed_sidebar: apiWebsocketMethodsSidebar
hide_table_of_contents: true
---
After connecting to the RPC PubSub websocket at `ws://<ADDRESS>/`:
- Submit subscription requests to the websocket using the methods below
- Multiple subscriptions may be active at once
- Many subscriptions take the optional [`commitment` parameter](/api/http#configuring-state-commitment), defining how finalized a change should be to trigger a notification. For subscriptions, if commitment is unspecified, the default value is `finalized`.
## RPC PubSub WebSocket Endpoint
**Default port:** 8900 e.g. ws://localhost:8900, [http://192.168.1.88:8900](http://192.168.1.88:8900)
## Methods
The following methods are supported in the RPC Websocket API:
import AccountSubscribe from "./websocket/\_accountSubscribe.mdx"
<AccountSubscribe />
import AccountUnsubscribe from "./websocket/\_accountUnsubscribe.mdx"
<AccountUnsubscribe />
import BlockSubscribe from "./websocket/\_blockSubscribe.mdx"
<BlockSubscribe />
import BlockUnsubscribe from "./websocket/\_blockUnsubscribe.mdx"
<BlockUnsubscribe />
import LogsSubscribe from "./websocket/\_logsSubscribe.mdx"
<LogsSubscribe />
import LogsUnsubscribe from "./websocket/\_logsUnsubscribe.mdx"
<LogsUnsubscribe />
import ProgramSubscribe from "./websocket/\_programSubscribe.mdx"
<ProgramSubscribe />
import ProgramUnsubscribe from "./websocket/\_programUnsubscribe.mdx"
<ProgramUnsubscribe />
import SignatureSubscribe from "./websocket/\_signatureSubscribe.mdx"
<SignatureSubscribe />
import SignatureUnsubscribe from "./websocket/\_signatureUnsubscribe.mdx"
<SignatureUnsubscribe />
import SlotSubscribe from "./websocket/\_slotSubscribe.mdx"
<SlotSubscribe />
import SlotUnsubscribe from "./websocket/\_slotUnsubscribe.mdx"
<SlotUnsubscribe />
import SlotsUpdatesSubscribe from "./websocket/\_slotsUpdatesSubscribe.mdx"
<SlotsUpdatesSubscribe />
import SlotsUpdatesUnsubscribe from "./websocket/\_slotsUpdatesUnsubscribe.mdx"
<SlotsUpdatesUnsubscribe />
import RootSubscribe from "./websocket/\_rootSubscribe.mdx"
<RootSubscribe />
import RootUnsubscribe from "./websocket/\_rootUnsubscribe.mdx"
<RootUnsubscribe />
import VoteSubscribe from "./websocket/\_voteSubscribe.mdx"
<VoteSubscribe />
import VoteUnsubscribe from "./websocket/\_voteUnsubscribe.mdx"
<VoteUnsubscribe />

View File

@ -1,160 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## accountSubscribe
Subscribe to an account to receive notifications when the lamports or data for a given account public key changes
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Account Pubkey, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="encoding" type="string" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["base58", "base64", "base64+zstd", "jsonParsed"]} />
<details>
- `base58` is slow.
- `jsonParsed` encoding attempts to use program-specific state parsers to return more
human-readable and explicit account state data
- If `jsonParsed` is requested but a parser cannot be found, the field falls back to
binary encoding, detectable when the `data`field is type`string`.
</details>
</Field>
</Parameter>
### Result:
`<number>` - Subscription id \(needed to unsubscribe\)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountSubscribe",
"params": [
"CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12",
{
"encoding": "jsonParsed",
"commitment": "finalized"
}
]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 23784, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification format is the same as seen in the [getAccountInfo](#getAccountInfo) RPC HTTP method.
Base58 encoding:
```json
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 5199307
},
"value": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHPXHRDEHrBesJhZyqnnq9qJeUuF7WHxiuLuL5twc38w2TXNLxnDbjmuR",
"base58"
],
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 635,
"space": 80
}
},
"subscription": 23784
}
}
```
Parsed-JSON encoding:
```json
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 5199307
},
"value": {
"data": {
"program": "nonce",
"parsed": {
"type": "initialized",
"info": {
"authority": "Bbqg1M4YVVfbhEzwA9SpC9FhsaG83YMTYoR4a8oTDLX",
"blockhash": "LUaQTmM7WbMRiATdMMHaRGakPtCkc2GHtH57STKXs6k",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
}
},
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 635,
"space": 80
}
},
"subscription": 23784
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## accountUnsubscribe
Unsubscribe from account change notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"number"} required={true}>
id of the account Subscription to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,378 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## blockSubscribe
Subscribe to receive notification anytime a new block is Confirmed or Finalized.
:::caution
This subscription is **unstable** and only available if the validator was started
with the `--rpc-pubsub-enable-block-subscription` flag.
**NOTE: The format of this subscription may change in the future**
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter name="filter" type={"string | object"} required={true}>
filter criteria for the logs to receive results by account type; currently supported:
<Field type="string" value="all">
<code>all</code> - include all transactions in block
</Field>
<Field type="object">
A JSON object with the following field:
- `mentionsAccountOrProgram: <string>` - return only transactions that mention the provided public key (as base-58 encoded string). If no mentions in a given block, then no notification will be sent.
</Field>
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
defaultValue={"finalized"}
href="/api/http#configuring-state-commitment"
>
<li>
the default is <code>finalized</code>
</li>
<li>
<code>processed</code> is not supported.
</li>
</Field>
<Field name="encoding" type="string" optional={true} defaultValue={"json"} href="/api/http#parsed-responses">
encoding format for each returned Transaction
<Values values={["json", "jsonParsed", "base58", "base64"]} />
<details>
- `jsonParsed` attempts to use program-specific instruction parsers to return
more human-readable and explicit data in the `transaction.message.instructions` list.
- If `jsonParsed` is requested but a parser cannot be found, the instruction
falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields).
</details>
</Field>
<Field name="transactionDetails" type="string" optional={true} defaultValue={"full"}>
level of transaction detail to return
<Values values={["full", "accounts", "signatures", "none"]} />
<details>
- If `accounts` are requested, transaction details only include signatures and
an annotated list of accounts in each transaction.
- Transaction metadata is limited to only: fee, err, pre_balances,
post_balances, pre_token_balances, and post_token_balances.
</details>
</Field>
<Field name="maxSupportedTransactionVersion" type="number" optional={true}>
the max transaction version to return in responses.
<details>
- If the requested block contains a transaction with a higher version, an
error will be returned.
- If this parameter is omitted, only legacy transactions will be returned, and
a block containing any versioned transaction will prompt the error.
</details>
</Field>
<Field name="showRewards" type="bool" optional={true}>
whether to populate the `rewards` array. If parameter not provided, the
default includes rewards.
</Field>
</Parameter>
### Result:
`integer` - subscription id \(needed to unsubscribe\)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": "1",
"method": "blockSubscribe",
"params": ["all"]
}
```
```json
{
"jsonrpc": "2.0",
"id": "1",
"method": "blockSubscribe",
"params": [
{
"mentionsAccountOrProgram": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op"
},
{
"commitment": "confirmed",
"encoding": "base64",
"showRewards": true,
"transactionDetails": "full"
}
]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification will be an object with the following fields:
- `slot: <u64>` - The corresponding slot.
- `err: <object|null>` - Error if something went wrong publishing the notification otherwise null.
- `block: <object|null>` - A block object as seen in the [getBlock](/api/http#getblock) RPC HTTP method.
```json
{
"jsonrpc": "2.0",
"method": "blockNotification",
"params": {
"result": {
"context": {
"slot": 112301554
},
"value": {
"slot": 112301554,
"block": {
"previousBlockhash": "GJp125YAN4ufCSUvZJVdCyWQJ7RPWMmwxoyUQySydZA",
"blockhash": "6ojMHjctdqfB55JDpEpqfHnP96fiaHEcvzEQ2NNcxzHP",
"parentSlot": 112301553,
"transactions": [
{
"transaction": [
"OpltwoUvWxYi1P2U8vbIdE/aPntjYo5Aa0VQ2JJyeJE2g9Vvxk8dDGgFMruYfDu8/IfUWb0REppTe7IpAuuLRgIBAAkWnj4KHRpEWWW7gvO1c0BHy06wZi2g7/DLqpEtkRsThAXIdBbhXCLvltw50ZnjDx2hzw74NVn49kmpYj2VZHQJoeJoYJqaKcvuxCi/2i4yywedcVNDWkM84Iuw+cEn9/ROCrXY4qBFI9dveEERQ1c4kdU46xjxj9Vi+QXkb2Kx45QFVkG4Y7HHsoS6WNUiw2m4ffnMNnOVdF9tJht7oeuEfDMuUEaO7l9JeUxppCvrGk3CP45saO51gkwVYEgKzhpKjCx3rgsYxNR81fY4hnUQXSbbc2Y55FkwgRBpVvQK7/+clR4Gjhd3L4y+OtPl7QF93Akg1LaU9wRMs5nvfDFlggqI9PqJl+IvVWrNRdBbPS8LIIhcwbRTkSbqlJQWxYg3Bo2CTVbw7rt1ZubuHWWp0mD/UJpLXGm2JprWTePNULzHu67sfqaWF99LwmwjTyYEkqkRt1T0Je5VzHgJs0N5jY4iIU9K3lMqvrKOIn/2zEMZ+ol2gdgjshx+sphIyhw65F3J/Dbzk04LLkK+CULmN571Y+hFlXF2ke0BIuUG6AUF+4214Cu7FXnqo3rkxEHDZAk0lRrAJ8X/Z+iwuwI5cgbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpDLAp8axcEkaQkLDKRoWxqp8XLNZSKial7Rk+ELAVVKWoWLRXRZ+OIggu0OzMExvVLE5VHqy71FNHq4gGitkiKYNFWSLIE4qGfdFLZXy/6hwS+wq9ewjikCpd//C9BcCL7Wl0iQdUslxNVCBZHnCoPYih9JXvGefOb9WWnjGy14sG9j70+RSVx6BlkFELWwFvIlWR/tHn3EhHAuL0inS2pwX7ZQTAU6gDVaoqbR2EiJ47cKoPycBNvHLoKxoY9AZaBjPl6q8SKQJSFyFd9n44opAgI6zMTjYF/8Ok4VpXEESp3QaoUyTI9sOJ6oFP6f4dwnvQelgXS+AEfAsHsKXxGAIUDQENAgMEBQAGBwgIDg8IBJCER3QXl1AVDBADCQoOAAQLERITDAjb7ugh3gOuTy==",
"base64"
],
"meta": {
"err": null,
"status": {
"Ok": null
},
"fee": 5000,
"preBalances": [
1758510880, 2067120, 1566000, 1461600, 2039280, 2039280,
1900080, 1865280, 0, 3680844220, 2039280
],
"postBalances": [
1758505880, 2067120, 1566000, 1461600, 2039280, 2039280,
1900080, 1865280, 0, 3680844220, 2039280
],
"innerInstructions": [
{
"index": 0,
"instructions": [
{
"programIdIndex": 13,
"accounts": [1, 15, 3, 4, 2, 14],
"data": "21TeLgZXNbtHXVBzCaiRmH"
},
{
"programIdIndex": 14,
"accounts": [3, 4, 1],
"data": "6qfC8ic7Aq99"
},
{
"programIdIndex": 13,
"accounts": [1, 15, 3, 5, 2, 14],
"data": "21TeLgZXNbsn4QEpaSEr3q"
},
{
"programIdIndex": 14,
"accounts": [3, 5, 1],
"data": "6LC7BYyxhFRh"
}
]
},
{
"index": 1,
"instructions": [
{
"programIdIndex": 14,
"accounts": [4, 3, 0],
"data": "7aUiLHFjSVdZ"
},
{
"programIdIndex": 19,
"accounts": [17, 18, 16, 9, 11, 12, 14],
"data": "8kvZyjATKQWYxaKR1qD53V"
},
{
"programIdIndex": 14,
"accounts": [9, 11, 18],
"data": "6qfC8ic7Aq99"
}
]
}
],
"logMessages": [
"Program QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB invoke [1]",
"Program QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV invoke [2]"
],
"preTokenBalances": [
{
"accountIndex": 4,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 5,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": 11513.0679,
"decimals": 6,
"amount": "11513067900",
"uiAmountString": "11513.0679"
},
"owner": "rXhAofQCT7NN9TUqigyEAUzV1uLL4boeD8CRkNBSkYk",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 10,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "CL9wkGFT3SZRRNa9dgaovuRV7jrVVigBUZ6DjcgySsCU",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"accountIndex": 11,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": 15138.514093,
"decimals": 6,
"amount": "15138514093",
"uiAmountString": "15138.514093"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
}
],
"postTokenBalances": [
{
"accountIndex": 4,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 5,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": 11513.103028,
"decimals": 6,
"amount": "11513103028",
"uiAmountString": "11513.103028"
},
"owner": "rXhAofQCT7NN9TUqigyEAUzV1uLL4boeD8CRkNBSkYk",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 10,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "CL9wkGFT3SZRRNa9dgaovuRV7jrVVigBUZ6DjcgySsCU",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"accountIndex": 11,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": 15489.767829,
"decimals": 6,
"amount": "15489767829",
"uiAmountString": "15489.767829"
},
"owner": "BeiHVPRE8XeX3Y2xVNrSsTpAScH94nYySBVQ4HqgN9at",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
}
],
"rewards": []
}
}
],
"blockTime": 1639926816,
"blockHeight": 101210751
},
"err": null
}
},
"subscription": 14
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## blockUnsubscribe
Unsubscribe from block notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"integer"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "blockUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,146 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## logsSubscribe
Subscribe to transaction logging
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter name="filter" type={"string | object"} required={true}>
filter criteria for the logs to receive results by account type. The following filters types are currently supported:
<Field type="string">
A string with one of the following values:
- `all` - subscribe to all transactions except for simple vote transactions
- `allWithVotes` - subscribe to all transactions, including simple vote
transactions
</Field>
<Field type="object">
An object with the following field:
- `mentions: [ <string> ]` - array containing a single Pubkey (as base-58
encoded string); if present, subscribe to only transactions mentioning this address
:::caution
Currently, the `mentions` field
[only supports one](https://github.com/solana-labs/solana/blob/master/rpc/src/rpc_pubsub.rs#L481)
Pubkey string per method call. Listing additional addresses will result in an
error.
:::
</Field>
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
</Parameter>
### Result:
`<integer>` - Subscription id \(needed to unsubscribe\)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "logsSubscribe",
"params": [
{
"mentions": [ "11111111111111111111111111111111" ]
},
{
"commitment": "finalized"
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "logsSubscribe",
"params": [ "all" ]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 24040, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification will be an RpcResponse JSON object with value equal to:
- `signature: <string>` - The transaction signature base58 encoded.
- `err: <object|null>` - Error if transaction failed, null if transaction
succeeded.
[TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array|null>` - Array of log messages the transaction instructions
output during execution, null if simulation failed before the transaction was
able to execute (for example due to an invalid blockhash or signature
verification failure)
Example:
```json
{
"jsonrpc": "2.0",
"method": "logsNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"err": null,
"logs": [
"SBF program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
]
}
},
"subscription": 24040
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## logsUnsubscribe
Unsubscribe from transaction logging
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"integer"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "logsUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,205 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## programSubscribe
Subscribe to a program to receive notifications when the lamports or data for an account owned by the given program changes
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
Pubkey of the `program_id`, as base-58 encoded string
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="filters" type="array" optional={true} href={"/api/http#filter-criteria"}>
filter results using various [filter objects](/api/http#filter-criteria)
:::info
The resultant account must meet **ALL** filter criteria to be included in the returned results
:::
</Field>
<Field name="encoding" type="string" optional={true} href="/api/http#parsed-responses">
Encoding format for Account data
<Values values={["base58", "base64", "base64+zstd", "jsonParsed"]} />
<details>
- `base58` is slow.
- [`jsonParsed`](/api/http#parsed-responses">) encoding attempts to use program-specific
state parsers to return more human-readable and explicit account state data.
- If `jsonParsed` is requested but a parser cannot be found, the field falls
back to `base64` encoding, detectable when the `data` field is type `string`.
</details>
</Field>
</Parameter>
### Result:
`<integer>` - Subscription id \(needed to unsubscribe\)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "programSubscribe",
"params": [
"11111111111111111111111111111111",
{
"encoding": "base64",
"commitment": "finalized"
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "programSubscribe",
"params": [
"11111111111111111111111111111111",
{
"encoding": "jsonParsed"
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "programSubscribe",
"params": [
"11111111111111111111111111111111",
{
"encoding": "base64",
"filters": [
{
"dataSize": 80
}
]
}
]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 24040, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification format
The notification format is a <b>single</b> program account object as seen in the [getProgramAccounts](/api/http#getprogramaccounts) RPC HTTP method.
Base58 encoding:
```json
{
"jsonrpc": "2.0",
"method": "programNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"pubkey": "H4vnBqifaSACnKa7acsxstsY1iV1bvJNxsCY7enrd1hq",
"account": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHPXHRDEHrBesJhZyqnnq9qJeUuF7WHxiuLuL5twc38w2TXNLxnDbjmuR",
"base58"
],
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 636,
"space": 80
}
}
},
"subscription": 24040
}
}
```
Parsed-JSON encoding:
```json
{
"jsonrpc": "2.0",
"method": "programNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"pubkey": "H4vnBqifaSACnKa7acsxstsY1iV1bvJNxsCY7enrd1hq",
"account": {
"data": {
"program": "nonce",
"parsed": {
"type": "initialized",
"info": {
"authority": "Bbqg1M4YVVfbhEzwA9SpC9FhsaG83YMTYoR4a8oTDLX",
"blockhash": "LUaQTmM7WbMRiATdMMHaRGakPtCkc2GHtH57STKXs6k",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
}
},
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 636,
"space": 80
}
}
},
"subscription": 24040
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## programUnsubscribe
Unsubscribe from program-owned account change notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"number"} required={true}>
id of account Subscription to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "programUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,62 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## rootSubscribe
Subscribe to receive notification anytime a new root is set by the validator.
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`integer` - subscription id \(needed to unsubscribe\)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{ "jsonrpc": "2.0", "id": 1, "method": "rootSubscribe" }
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The result is the latest root slot number.
```json
{
"jsonrpc": "2.0",
"method": "rootNotification",
"params": {
"result": 42,
"subscription": 0
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## rootUnsubscribe
Unsubscribe from root notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"number"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "rootUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,160 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## signatureSubscribe
Subscribe to receive a notification when the transaction with the given
signature reaches the specified commitment level.
:::caution
This is a subscription to a single notification. It is automatically cancelled
by the server once the notification, `signatureNotification`, is sent by the
RPC.
:::
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"string"} required={true}>
transaction signature, as base-58 encoded string
:::info
The transaction signature must be the first signature from the transaction (see
[transaction id](/terminology#transaction-id) for more details).
:::
</Parameter>
<Parameter type={"object"} optional={true}>
Configuration object containing the following fields:
<Field
name="commitment"
type="string"
optional={true}
href="/api/http#configuring-state-commitment"
></Field>
<Field name="enableReceivedNotification" type="bool" optional={true}>
Whether or not to subscribe for notifications when signatures are received by
the RPC, in addition to when they are processed.
</Field>
</Parameter>
### Result:
`<integer>` - subscription id (needed to unsubscribe)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "signatureSubscribe",
"params": [
"2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b",
{
"commitment": "finalized",
"enableReceivedNotification": false
}
]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification will be an RpcResponse JSON object with value containing an
object with:
- `slot: <u64>` - The corresponding slot.
- `value: <object|string>` - a notification value of
[`RpcSignatureResult`](https://github.com/solana-labs/solana/blob/6d28fd455b07e3557fc6c0c3ddf3ba03e3fe8482/rpc-client-api/src/response.rs#L265-L268),
resulting in either:
- when `enableReceivedNotification` is `true` and the signature is received: the
literal string
[`"receivedSignature"`](https://github.com/solana-labs/solana/blob/6d28fd455b07e3557fc6c0c3ddf3ba03e3fe8482/rpc-client-api/src/response.rs#L286-L288),
or
- when the signature is processed: `err: <object|null>`:
- `null` if the transaction succeeded in being processed at the specified
commitment level, or
- a
[`TransactionError`](https://github.com/solana-labs/solana/blob/6d28fd455b07e3557fc6c0c3ddf3ba03e3fe8482/sdk/src/transaction/error.rs#L15-L164),
if the transaction failed
#### Example responses:
The following is an example response of a notification from a successfully
**processed** transactions:
```json
{
"jsonrpc": "2.0",
"method": "signatureNotification",
"params": {
"result": {
"context": {
"slot": 5207624
},
"value": {
"err": null
}
},
"subscription": 24006
}
}
```
The following is an example response of a notification from a successfully
**recieved** transaction signature:
```json
{
"jsonrpc": "2.0",
"method": "signatureNotification",
"params": {
"result": {
"context": {
"slot": 5207624
},
"value": "receivedSignature"
},
"subscription": 24006
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## signatureUnsubscribe
Unsubscribe from signature confirmation notification
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"number"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "signatureUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,72 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## slotSubscribe
Subscribe to receive notification anytime a slot is processed by the validator
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`<integer>` - Subscription id \(needed to unsubscribe\)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{ "jsonrpc": "2.0", "id": 1, "method": "slotSubscribe" }
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification will be an object with the following fields:
- `parent: <u64>` - The parent slot
- `root: <u64>` - The current root slot
- `slot: <u64>` - The newly set slot value
Example:
```json
{
"jsonrpc": "2.0",
"method": "slotNotification",
"params": {
"result": {
"parent": 75,
"root": 44,
"slot": 76
},
"subscription": 0
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## slotUnsubscribe
Unsubscribe from slot notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"integer"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "slotUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,92 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## slotsUpdatesSubscribe
Subscribe to receive a notification from the validator on a variety of updates
on every slot
:::caution
This subscription is unstable
**NOTE: the format of this subscription may change in the future and it may not always be supported**
:::
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`<integer>` - Subscription id (needed to unsubscribe)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{ "jsonrpc": "2.0", "id": 1, "method": "slotsUpdatesSubscribe" }
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification will be an object with the following fields:
- `err: <string|undefined>` - The error message. Only present if the update is of type "dead".
- `parent: <u64|undefined>` - The parent slot. Only present if the update is of type "createdBank".
- `slot: <u64>` - The newly updated slot
- `stats: <object|undefined>` - The error message. Only present if the update is of type "frozen". An object with the following fields:
- `maxTransactionsPerEntry: <u64>`,
- `numFailedTransactions: <u64>`,
- `numSuccessfulTransactions: <u64>`,
- `numTransactionEntries: <u64>`,
- `timestamp: <i64>` - The Unix timestamp of the update
- `type: <string>` - The update type, one of:
- "firstShredReceived"
- "completed"
- "createdBank"
- "frozen"
- "dead"
- "optimisticConfirmation"
- "root"
```bash
{
"jsonrpc": "2.0",
"method": "slotsUpdatesNotification",
"params": {
"result": {
"parent": 75,
"slot": 76,
"timestamp": 1625081266243,
"type": "optimisticConfirmation"
},
"subscription": 0
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## slotsUpdatesUnsubscribe
Unsubscribe from slot-update notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"number"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "slotsUpdatesUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

View File

@ -1,80 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## voteSubscribe
Subscribe to receive notification anytime a new vote is observed in gossip.
These votes are pre-consensus therefore there is no guarantee these votes will
enter the ledger.
:::caution
This subscription is unstable and only available if the validator was started
with the `--rpc-pubsub-enable-vote-subscription` flag. The format of this
subscription may change in the future
:::
<DocSideBySide>
<CodeParams>
### Parameters:
**None**
### Result:
`<integer>` - subscription id (needed to unsubscribe)
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{ "jsonrpc": "2.0", "id": 1, "method": "voteSubscribe" }
```
### Response:
```json
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
#### Notification Format:
The notification will be an object with the following fields:
- `hash: <string>` - The vote hash
- `slots: <array>` - The slots covered by the vote, as an array of u64 integers
- `timestamp: <i64|null>` - The timestamp of the vote
- `signature: <string>` - The signature of the transaction that contained this vote
- `votePubkey: <string>` - The public key of the vote account, as base-58 encoded string
```json
{
"jsonrpc": "2.0",
"method": "voteNotification",
"params": {
"result": {
"hash": "8Rshv2oMkPu5E4opXTRyuyBeZBqQ4S477VG26wUTFxUM",
"slots": [1, 2],
"timestamp": null
},
"subscription": 0
}
}
```
</DocBlock>

View File

@ -1,53 +0,0 @@
import {
DocBlock,
DocSideBySide,
CodeParams,
Parameter,
Field,
Values,
CodeSnippets,
} from "../../../components/CodeDocBlock";
<DocBlock>
## voteUnsubscribe
Unsubscribe from vote notifications
<DocSideBySide>
<CodeParams>
### Parameters:
<Parameter type={"integer"} required={true}>
subscription id to cancel
</Parameter>
### Result:
`<bool>` - unsubscribe success message
</CodeParams>
<CodeSnippets>
### Code sample:
```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "voteUnsubscribe",
"params": [0]
}
```
### Response:
```json
{ "jsonrpc": "2.0", "result": true, "id": 1 }
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>

7
docs/src/architecture.md Normal file
View File

@ -0,0 +1,7 @@
---
title: Architecture
sidebar_label: Overview
sidebar_position: 0
---
In this section, we will describe the architecture.

View File

@ -1,5 +1,7 @@
---
title: CLI Usage Reference
title: Solana CLI Reference and Usage
sidebar_label: Reference & Usage
sidebar_position: 3
---
The [solana-cli crate](https://crates.io/crates/solana-cli) provides a command-line interface tool for Solana

View File

@ -0,0 +1,7 @@
{
"position": 4.5,
"label": "Command Examples",
"collapsible": true,
"collapsed": false,
"link": null
}

View File

@ -2,7 +2,7 @@
title: Connecting to a Cluster
---
See [Solana Clusters](../clusters.md) for general information about the
See [Solana Clusters](../../clusters/available.md) for general information about the
available clusters.
## Configure the command-line tool

View File

@ -1,24 +1,26 @@
---
title: Staking
---
For an overview of staking, read first the
[Staking and Inflation FAQ](https://solana.com/staking).
------
---
After you have [received SOL](transfer-tokens.md), you might consider putting
it to use by delegating _stake_ to a validator. Stake is what we call tokens
in a _stake account_. Solana weights validator votes by the amount of stake
delegated to them, which gives those validators more influence in determining
then next valid block of transactions in the blockchain. Solana then generates
new SOL periodically to reward stakers and validators. You earn more rewards
the more stake you delegate.
After you have [received SOL](./transfer-tokens.md), you might consider putting it
to use by delegating _stake_ to a validator. Stake is what we call tokens in a
_stake account_. Solana weights validator votes by the amount of stake delegated
to them, which gives those validators more influence in determining then next
valid block of transactions in the blockchain. Solana then generates new SOL
periodically to reward stakers and validators. You earn more rewards the more
stake you delegate.
## Create a Stake Account
To delegate stake, you will need to transfer some tokens into a stake account.
To create an account, you will need a keypair. Its public key will be used as
the [stake account address](../staking/stake-accounts.md#account-address).
the
[stake account address](https://solana.com/docs/economics/staking/stake-accounts#account-address).
No need for a password or encryption here; this keypair will be discarded right
after creating the stake account.
@ -67,11 +69,10 @@ Withdraw Authority: EXU95vqs93yPeCeAU7mPPu6HbRUmTFPEiGug9oCdvQ5F
### Set Stake and Withdraw Authorities
[Stake and withdraw authorities](../staking/stake-accounts.md#understanding-account-authorities)
can be set when creating an account via the
`--stake-authority` and `--withdraw-authority` options, or afterward with the
`solana stake-authorize` command. For example, to set a new stake authority,
run:
[Stake and withdraw authorities](https://solana.com/docs/economics/staking/stake-accounts#understanding-account-authorities)
can be set when creating an account via the `--stake-authority` and
`--withdraw-authority` options, or afterward with the `solana stake-authorize`
command. For example, to set a new stake authority, run:
```bash
solana stake-authorize <STAKE_ACCOUNT_ADDRESS> \
@ -95,11 +96,12 @@ solana create-stake-account --from <KEYPAIR> <STAKE_ACCOUNT_KEYPAIR> --seed <STR
--stake-authority <PUBKEY> --withdraw-authority <PUBKEY> --fee-payer <KEYPAIR>
```
`<STRING>` is an arbitrary string up to 32 bytes, but will typically be a
number corresponding to which derived account this is. The first account might
be "0", then "1", and so on. The public key of `<STAKE_ACCOUNT_KEYPAIR>` acts
as the base address. The command derives a new address from the base address
and seed string. To see what stake address the command will derive, use `solana create-address-with-seed`:
`<STRING>` is an arbitrary string up to 32 bytes, but will typically be a number
corresponding to which derived account this is. The first account might be "0",
then "1", and so on. The public key of `<STAKE_ACCOUNT_KEYPAIR>` acts as the
base address. The command derives a new address from the base address and seed
string. To see what stake address the command will derive, use
`solana create-address-with-seed`:
```bash
solana create-address-with-seed --from <PUBKEY> <SEED_STRING> STAKE
@ -121,9 +123,9 @@ accounts with the `solana validators` command:
solana validators
```
The first column of each row contains the validator's identity and the second
is the vote account address. Choose a validator and use its vote account
address in `solana delegate-stake`:
The first column of each row contains the validator's identity and the second is
the vote account address. Choose a validator and use its vote account address in
`solana delegate-stake`:
```bash
solana delegate-stake --stake-authority <KEYPAIR> <STAKE_ACCOUNT_ADDRESS> <VOTE_ACCOUNT_ADDRESS> \
@ -134,8 +136,8 @@ The stake authority `<KEYPAIR>` authorizes the operation on the account with
address `<STAKE_ACCOUNT_ADDRESS>`. The stake is delegated to the vote account
with address `<VOTE_ACCOUNT_ADDRESS>`.
After delegating stake, use `solana stake-account` to observe the changes
to the stake account:
After delegating stake, use `solana stake-account` to observe the changes to the
stake account:
```bash
solana stake-account <STAKE_ACCOUNT_ADDRESS>
@ -164,8 +166,8 @@ solana deactivate-stake --stake-authority <KEYPAIR> <STAKE_ACCOUNT_ADDRESS> \
--fee-payer <KEYPAIR>
```
The stake authority `<KEYPAIR>` authorizes the operation on the account
with address `<STAKE_ACCOUNT_ADDRESS>`.
The stake authority `<KEYPAIR>` authorizes the operation on the account with
address `<STAKE_ACCOUNT_ADDRESS>`.
Note that stake takes several epochs to "cool down". Attempts to delegate stake
in the cool down period will fail.
@ -180,8 +182,8 @@ solana withdraw-stake --withdraw-authority <KEYPAIR> <STAKE_ACCOUNT_ADDRESS> <RE
```
`<STAKE_ACCOUNT_ADDRESS>` is the existing stake account, the stake authority
`<KEYPAIR>` is the withdraw authority, and `<AMOUNT>` is the number of tokens
to transfer to `<RECIPIENT_ADDRESS>`.
`<KEYPAIR>` is the withdraw authority, and `<AMOUNT>` is the number of tokens to
transfer to `<RECIPIENT_ADDRESS>`.
## Split Stake
@ -196,11 +198,11 @@ solana split-stake --stake-authority <KEYPAIR> <STAKE_ACCOUNT_ADDRESS> <NEW_STAK
```
`<STAKE_ACCOUNT_ADDRESS>` is the existing stake account, the stake authority
`<KEYPAIR>` is the stake authority, `<NEW_STAKE_ACCOUNT_KEYPAIR>` is the
keypair for the new account, and `<AMOUNT>` is the number of tokens to transfer
to the new account.
`<KEYPAIR>` is the stake authority, `<NEW_STAKE_ACCOUNT_KEYPAIR>` is the keypair
for the new account, and `<AMOUNT>` is the number of tokens to transfer to the
new account.
To split a stake account into a derived account address, use the `--seed`
option. See
[Derive Stake Account Addresses](#advanced-derive-stake-account-addresses)
for details.
[Derive Stake Account Addresses](#advanced-derive-stake-account-addresses) for
details.

View File

@ -2,18 +2,21 @@
title: Deploy a Program
---
Developers can deploy on-chain [programs](terminology.md#program) (often called
smart contracts elsewhere) with the Solana tools.
Developers can deploy on-chain
[programs](https://solana.com/docs/terminology#program) (often called smart
contracts elsewhere) with the Solana tools.
To learn about developing and executing programs on Solana, start with the
[intro to Solana programs](developing/intro/programs.md) and then dig into the
details of [on-chain programs](developing/on-chain-programs/overview.md).
[intro to Solana programs](https://solana.com/docs/core/programs) and then dig
into the details of
[developing on-chain programs](https://solana.com/docs/programs).
To deploy a program, use the Solana tools to interact with the on-chain loader
to:
- Initialize a program account
- Upload the program's shared object (the program binary `.so`) to the program account's data buffer
- Upload the program's shared object (the program binary `.so`) to the program
account's data buffer
- (optional) Verify the uploaded program
- Finalize the program by marking the program account executable.
@ -89,8 +92,8 @@ Data Length: 5216 (0x1460) bytes
### Redeploy a program
A program can be redeployed to the same address to facilitate rapid development,
bug fixes, or upgrades. If a program id is not provided, the program will be
deployed to the default address at `<PROGRAM_NAME>-keypair.json`. This default
bug fixes, or upgrades. If a program id is not provided, the program will be
deployed to the default address at `<PROGRAM_NAME>-keypair.json`. This default
keypair is generated during the first program compilation.
The command looks the same as the deployment command:
@ -101,10 +104,10 @@ solana program deploy <PROGRAM_FILEPATH>
By default, programs are deployed to accounts that are twice the size of the
original deployment. Doing so leaves room for program growth in future
redeployments. But, if the initially deployed program is very small and then
later grows substantially, the redeployment may fail. To avoid this, specify
a `max_len` that is at least the size (in bytes) that the program is expected
to become (plus some wiggle room).
redeployments. But, if the initially deployed program is very small and then
later grows substantially, the redeployment may fail. To avoid this, specify a
`max_len` that is at least the size (in bytes) that the program is expected to
become (plus some wiggle room).
```bash
solana program deploy --max-len 200000 <PROGRAM_FILEPATH>
@ -113,9 +116,9 @@ solana program deploy --max-len 200000 <PROGRAM_FILEPATH>
### Resuming a failed deploy
If program deployment fails, there will be a hanging intermediate buffer account
that contains a non-zero balance. In order to recoup that balance you may
resume a failed deployment by providing the same intermediate buffer to a new
call to `deploy`.
that contains a non-zero balance. In order to recoup that balance you may resume
a failed deployment by providing the same intermediate buffer to a new call to
`deploy`.
Deployment failures will print an error message specifying the seed phrase
needed to recover the generated intermediate buffer's keypair:
@ -154,8 +157,8 @@ Both program and buffer accounts can be closed and their lamport balances
transferred to a recipient's account.
If deployment fails there will be a left-over buffer account that holds
lamports. The buffer account can either be used to [resume a
deploy](#resuming-a-failed-deploy) or closed.
lamports. The buffer account can either be used to
[resume a deploy](#resuming-a-failed-deploy) or closed.
The program or buffer account's authority must be present to close an account,
to list all the open program or buffer accounts that match the default
@ -228,10 +231,11 @@ Or after deployment and specifying the current authority:
solana program set-upgrade-authority <PROGRAM_ADDRESS> --upgrade-authority <UPGRADE_AUTHORITY_SIGNER> --new-upgrade-authority <NEW_UPGRADE_AUTHORITY>
```
By default, `set-upgrade-authority` requires a signature from the new authority. This behavior prevents a
developer from giving upgrade authority to a key that they do not have access to. The
`--skip-new-upgrade-authority-signer-check` option relaxes the signer check. This can be useful for situations
where the new upgrade authority is an offline signer or a multisig.
By default, `set-upgrade-authority` requires a signature from the new authority.
This behavior prevents a developer from giving upgrade authority to a key that
they do not have access to. The `--skip-new-upgrade-authority-signer-check`
option relaxes the signer check. This can be useful for situations where the new
upgrade authority is an offline signer or a multisig.
### Immutable programs
@ -257,12 +261,12 @@ solana program dump <ACCOUNT_ADDRESS> <OUTPUT_FILEPATH>
```
The dumped file will be in the same as what was deployed, so in the case of a
shared object (the program binary `.so`), the dumped file will be a fully functional shared object. Note
that the `dump` command dumps the entire data space, which means the output file
will have trailing zeros after the shared object's data up to `max_len`.
Sometimes it is useful to dump and compare a program to ensure it matches a
known program binary. The dumped file can be zero-truncated, hashed,
and compared to the hash of the original program file.
shared object (the program binary `.so`), the dumped file will be a fully
functional shared object. Note that the `dump` command dumps the entire data
space, which means the output file will have trailing zeros after the shared
object's data up to `max_len`. Sometimes it is useful to dump and compare a
program to ensure it matches a known program binary. The dumped file can be
zero-truncated, hashed, and compared to the hash of the original program file.
```bash
$ solana dump <ACCOUNT_ADDRESS> dump.so
@ -274,9 +278,10 @@ $ sha256sum extended.so dump.so
### Using an intermediary Buffer account
Instead of deploying directly to the program account, the program can be written
to an intermediary buffer account. Intermediary accounts can be useful for things
like multi-entity governed programs where the governing members fist verify the
intermediary buffer contents and then vote to allow an upgrade using it.
to an intermediary buffer account. Intermediary accounts can be useful for
things like multi-entity governed programs where the governing members fist
verify the intermediary buffer contents and then vote to allow an upgrade using
it.
```bash
solana program write-buffer <PROGRAM_FILEPATH>
@ -308,8 +313,9 @@ the program:
solana program deploy --program-id <PROGRAM_ADDRESS> --buffer <BUFFER_ADDRESS>
```
Note, the buffer's authority must match the program's upgrade authority.
During deployment, the buffer account's contents are copied into the program-data account and
the buffer account is set to zero. The lamports from the buffer account are refunded to a spill account.
Note, the buffer's authority must match the program's upgrade authority. During
deployment, the buffer account's contents are copied into the program-data
account and the buffer account is set to zero. The lamports from the buffer
account are refunded to a spill account.
Buffers also support `show` and `dump` just like programs do.

Some files were not shown because too many files have changed in this diff Show More