From 62e4ff18d0a6d42f2d93653886c1353a84965244 Mon Sep 17 00:00:00 2001 From: Dera Okeke Date: Wed, 15 Apr 2026 14:14:09 +0100 Subject: [PATCH 1/3] modified script/docs --- docs/subtensor-api/constants.md | 9 +++++++-- docs/subtensor-api/errors.md | 9 +++++++-- docs/subtensor-api/events.md | 9 +++++++-- docs/subtensor-api/extrinsics.md | 9 +++++++-- docs/subtensor-api/rpc.md | 9 +++++++-- docs/subtensor-api/runtime.md | 9 +++++++-- docs/subtensor-api/storage.md | 9 +++++++-- src/subtensor-docs-gen/src/generators/constants.ts | 2 +- src/subtensor-docs-gen/src/generators/errors.ts | 2 +- src/subtensor-docs-gen/src/generators/events.ts | 2 +- src/subtensor-docs-gen/src/generators/extrinsics.ts | 4 ++-- src/subtensor-docs-gen/src/generators/rpc.ts | 2 +- src/subtensor-docs-gen/src/generators/runtime.ts | 2 +- src/subtensor-docs-gen/src/generators/storage.ts | 2 +- src/subtensor-docs-gen/src/utils.ts | 10 +++++++++- 15 files changed, 66 insertions(+), 23 deletions(-) diff --git a/docs/subtensor-api/constants.md b/docs/subtensor-api/constants.md index 616b917d..13bc358e 100644 --- a/docs/subtensor-api/constants.md +++ b/docs/subtensor-api/constants.md @@ -1,9 +1,14 @@ +--- +title: Constants +description: "This page contains compile-time runtime constants for the Subtensor runtime and their respective values." +--- + # Constants -This page contains compile-time runtime constants for the Bittensor (Subtensor) runtime. Accessible via `api.consts..`. Values read live from node. +This page contains compile-time runtime constants for the Subtensor runtime and their respective values. Accessible via `api.consts..`. Values read live from node. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[aura](#aura)** diff --git a/docs/subtensor-api/errors.md b/docs/subtensor-api/errors.md index 209b4227..47079d79 100644 --- a/docs/subtensor-api/errors.md +++ b/docs/subtensor-api/errors.md @@ -1,9 +1,14 @@ +--- +title: Errors +description: "This page contains error variants returned by the Subtensor runtime." +--- + # Errors -This page contains error variants returned by the Bittensor (Subtensor) runtime. Accessible via `api.errors..`. +This page contains error variants returned by the Subtensor runtime. Accessible via `api.errors..`. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[adminUtils](#adminutils)** diff --git a/docs/subtensor-api/events.md b/docs/subtensor-api/events.md index 62e5750c..df40a31b 100644 --- a/docs/subtensor-api/events.md +++ b/docs/subtensor-api/events.md @@ -1,9 +1,14 @@ +--- +title: Events +description: "The following page contains runtime events emitted by the Subtensor runtime." +--- + # Events -The following page contains runtime events emitted by the Bittensor (Subtensor) runtime. Accessible via `api.events..`. +The following page contains runtime events emitted by the Subtensor runtime. Accessible via `api.events..`. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[adminUtils](#adminutils)** diff --git a/docs/subtensor-api/extrinsics.md b/docs/subtensor-api/extrinsics.md index a061bcd9..a3ccfcd3 100644 --- a/docs/subtensor-api/extrinsics.md +++ b/docs/subtensor-api/extrinsics.md @@ -1,9 +1,14 @@ +--- +title: Extrinsics +description: "The following sections contain Extrinsic methods that are part of the Subtensor runtime." +--- + # Extrinsics -The following sections contain Extrinsic methods that are part of the Bittensor (Subtensor) runtime. On the API, these are exposed via `api.tx..`. +The following sections contain Extrinsic methods that are part of the Subtensor runtime. On the API, these are exposed via `api.tx..`. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[adminUtils](#adminutils)** diff --git a/docs/subtensor-api/rpc.md b/docs/subtensor-api/rpc.md index 6f084854..72176d70 100644 --- a/docs/subtensor-api/rpc.md +++ b/docs/subtensor-api/rpc.md @@ -1,9 +1,14 @@ +--- +title: RPC +description: "This page shows JSON-RPC methods available on the Subtensor node." +--- + # RPC -This page shows JSON-RPC methods available on a Bittensor (Subtensor) node. Accessible via `api.rpc..`. +This page shows JSON-RPC methods available on the Subtensor node. Accessible via `api.rpc..`. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[author](#author)** diff --git a/docs/subtensor-api/runtime.md b/docs/subtensor-api/runtime.md index 93446848..7b585ff4 100644 --- a/docs/subtensor-api/runtime.md +++ b/docs/subtensor-api/runtime.md @@ -1,9 +1,14 @@ +--- +title: Runtime Calls +description: "This page includes runtime API calls exposed by the Subtensor runtime." +--- + # Runtime Calls -This page includes runtime API calls exposed by the Bittensor (Subtensor) runtime. Accessible via `api.call..`. +This page includes runtime API calls exposed by the Subtensor runtime. Accessible via `api.call..`. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[accountNonceApi](#accountnonceapi)** diff --git a/docs/subtensor-api/storage.md b/docs/subtensor-api/storage.md index a919914a..1ec4c45d 100644 --- a/docs/subtensor-api/storage.md +++ b/docs/subtensor-api/storage.md @@ -1,9 +1,14 @@ +--- +title: Storage +description: "This page contains storage query definitions for the Subtensor runtime." +--- + # Storage -This page contains storage query definitions for the Bittensor (Subtensor) runtime. Accessible via `api.query..`. +This page contains storage query definitions for the Subtensor runtime. Accessible via `api.query..`. :::info -Generated from a live snapshot of the Subtensor runtime on **2026-04-13**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` +Generated from a live snapshot of the Subtensor runtime on **2026-04-15**. Connected to: `wss://entrypoint-finney.opentensor.ai:443` ::: - **[adminUtils](#adminutils)** diff --git a/src/subtensor-docs-gen/src/generators/constants.ts b/src/subtensor-docs-gen/src/generators/constants.ts index 529c678d..f39e9b08 100644 --- a/src/subtensor-docs-gen/src/generators/constants.ts +++ b/src/subtensor-docs-gen/src/generators/constants.ts @@ -15,7 +15,7 @@ export function generateConstants(api: ApiPromise, outputDir: string): void { lines.push( fileHeader( "Constants", - "This page contains compile-time runtime constants for the Bittensor (Subtensor) runtime. " + + "This page contains compile-time runtime constants for the Subtensor runtime and their respective values. " + "Accessible via `api.consts..`. Values read live from node.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), diff --git a/src/subtensor-docs-gen/src/generators/errors.ts b/src/subtensor-docs-gen/src/generators/errors.ts index 90c8b425..718097ae 100644 --- a/src/subtensor-docs-gen/src/generators/errors.ts +++ b/src/subtensor-docs-gen/src/generators/errors.ts @@ -14,7 +14,7 @@ export function generateErrors(api: ApiPromise, outputDir: string): void { lines.push( fileHeader( "Errors", - "This page contains error variants returned by the Bittensor (Subtensor) runtime. " + + "This page contains error variants returned by the Subtensor runtime. " + "Accessible via `api.errors..`.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), diff --git a/src/subtensor-docs-gen/src/generators/events.ts b/src/subtensor-docs-gen/src/generators/events.ts index 318ff8a4..75bdfa5f 100644 --- a/src/subtensor-docs-gen/src/generators/events.ts +++ b/src/subtensor-docs-gen/src/generators/events.ts @@ -15,7 +15,7 @@ export function generateEvents(api: ApiPromise, outputDir: string): void { lines.push( fileHeader( "Events", - "The following page contains runtime events emitted by the Bittensor (Subtensor) runtime. " + + "The following page contains runtime events emitted by the Subtensor runtime. " + "Accessible via `api.events..`.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), diff --git a/src/subtensor-docs-gen/src/generators/extrinsics.ts b/src/subtensor-docs-gen/src/generators/extrinsics.ts index 718d32ab..d4e67e65 100644 --- a/src/subtensor-docs-gen/src/generators/extrinsics.ts +++ b/src/subtensor-docs-gen/src/generators/extrinsics.ts @@ -19,8 +19,8 @@ export function generateExtrinsics(api: ApiPromise, outputDir: string): void { lines.push( fileHeader( "Extrinsics", - "The following sections contain Extrinsic methods that are part of the Bittensor " + - "(Subtensor) runtime. On the API, these are exposed via `api.tx..`.", + "The following sections contain Extrinsic methods that are part of the Subtensor " + + "runtime. On the API, these are exposed via `api.tx..`.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), ); diff --git a/src/subtensor-docs-gen/src/generators/rpc.ts b/src/subtensor-docs-gen/src/generators/rpc.ts index 6e433523..b7f067ff 100644 --- a/src/subtensor-docs-gen/src/generators/rpc.ts +++ b/src/subtensor-docs-gen/src/generators/rpc.ts @@ -70,7 +70,7 @@ export async function generateRpc( lines.push( fileHeader( "RPC", - "This page shows JSON-RPC methods available on a Bittensor (Subtensor) node. " + + "This page shows JSON-RPC methods available on the Subtensor node. " + "Accessible via `api.rpc..`.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), diff --git a/src/subtensor-docs-gen/src/generators/runtime.ts b/src/subtensor-docs-gen/src/generators/runtime.ts index 88872e9f..e7557a60 100644 --- a/src/subtensor-docs-gen/src/generators/runtime.ts +++ b/src/subtensor-docs-gen/src/generators/runtime.ts @@ -20,7 +20,7 @@ export function generateRuntimeCalls(api: ApiPromise, outputDir: string): void { lines.push( fileHeader( "Runtime Calls", - "This page includes runtime API calls exposed by the Bittensor (Subtensor) runtime. " + + "This page includes runtime API calls exposed by the Subtensor runtime. " + "Accessible via `api.call..`.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), diff --git a/src/subtensor-docs-gen/src/generators/storage.ts b/src/subtensor-docs-gen/src/generators/storage.ts index 863b27f6..5877edc3 100644 --- a/src/subtensor-docs-gen/src/generators/storage.ts +++ b/src/subtensor-docs-gen/src/generators/storage.ts @@ -207,7 +207,7 @@ export function generateStorage(api: ApiPromise, outputDir: string): void { lines.push( fileHeader( "Storage", - "This page contains storage query definitions for the Bittensor (Subtensor) runtime. " + + "This page contains storage query definitions for the Subtensor runtime. " + "Accessible via `api.query..`.", (api as any)._options?.provider?.endpoint ?? "subtensor node", ), diff --git a/src/subtensor-docs-gen/src/utils.ts b/src/subtensor-docs-gen/src/utils.ts index 35449bf7..8c5f89ef 100644 --- a/src/subtensor-docs-gen/src/utils.ts +++ b/src/subtensor-docs-gen/src/utils.ts @@ -431,7 +431,15 @@ export function today(): string { } export function fileHeader(title: string, description: string, endpoint: string): string { - return `# ${title} + // Use only the first sentence, stripped of Markdown backticks, for frontmatter + const fmDescription = description.split(/\.\s/)[0].replace(/`/g, '') + '.'; + + return `--- +title: ${title} +description: "${fmDescription}" +--- + +# ${title} ${description} From 04ccabcc57bd6fb8bd806e14c25bb81aff362deb Mon Sep 17 00:00:00 2001 From: Dera Okeke Date: Thu, 16 Apr 2026 22:21:35 +0100 Subject: [PATCH 2/3] updated subtensor-node docs --- docs/learn/chain-rate-limits.md | 11 ++--- docs/subtensor-nodes/index.md | 40 +++++++++---------- docs/subtensor-nodes/run/index.md | 8 ++++ .../subtensor-nodes/{ => run}/using-docker.md | 4 +- .../subtensor-nodes/{ => run}/using-source.md | 35 +++++++++++----- docusaurus.config.js | 12 ++++-- llms.txt | 4 +- sidebars.js | 13 +++++- 8 files changed, 76 insertions(+), 51 deletions(-) create mode 100644 docs/subtensor-nodes/run/index.md rename docs/subtensor-nodes/{ => run}/using-docker.md (99%) rename docs/subtensor-nodes/{ => run}/using-source.md (88%) diff --git a/docs/learn/chain-rate-limits.md b/docs/learn/chain-rate-limits.md index b3674a83..e64f107c 100644 --- a/docs/learn/chain-rate-limits.md +++ b/docs/learn/chain-rate-limits.md @@ -36,15 +36,14 @@ This rate limit prevents frequent changes to delegate take percentages. - Chain State Variable: `TxDelegateTakeRateLimit` - Error message: [`DelegateTxRateLimitExceeded`](../errors/subtensor.md#delegatetxratelimitexceeded) - ### Hotkey swap rate limit This rate limit prevents a user from swapping a hotkey too frequently. Hotkey swaps are subject to **two separate rate limits** that must both be satisfied: -- Rate Limit: +- Rate Limit: - General transaction: 1 block (12 seconds) - Per-subnet: 36,000 blocks (~5 days) -- Chain State Variables: +- Chain State Variables: - `TxRateLimit` (general transaction rate limit) - `HotkeySwapOnSubnetInterval` (global interval constant, not queryable from chain state) - Source Code: [swap_hotkey.rs](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/swap/swap_hotkey.rs#L52-56) @@ -74,7 +73,6 @@ This rate limit controls how frequently subnet owners can modify hyperparameters - Chain State Variable: `OwnerHyperparamRateLimit` - Error message: [`TxRateLimitExceeded`](../errors/subtensor.md#txratelimitexceeded) - ### Weights version key rate limit This rate limit controls the frequency of weights version key updates. @@ -117,7 +115,6 @@ This rate limit controls how frequently a user can perform staking operations (a - Chain State Variable: `StakingOperationRateLimiter` (Bool, since limit is 1 operation) - Error message: [`StakingOperationRateLimitExceeded`](../errors/subtensor.md#stakingoperationratelimitexceeded) - ### Child hotkey operations rate limit This rate limit controls how frequently a parent hotkey can set or revoke child hotkeys on a specific subnet. Note that revoking children is implemented by calling `set_children` with an empty list, so both operations share the same rate limit. @@ -146,7 +143,6 @@ This rate limit controls how frequently neurons can update their serving informa - Chain State Variable: `ServingRateLimit` - Error message: [`ServingRateLimitExceeded`](../errors/subtensor.md#servingratelimitexceeded) - ### Weights setting rate limit This rate limit controls how frequently a subnet validator can set weights to the network. Appears as `weights_rate_limit` in the subnet's hyperparameters. For more information, see [subnet hyperparameters](../subnets/subnet-hyperparameters.md#weightsratelimit--commitmentratelimit). @@ -183,5 +179,4 @@ When querying OTF-provided lite nodes, the following rate limits apply. We stron - Any OTF-provided lite node will rate limit the requests to one request per second, per IP address. Note that this rate limit may change dynamically based on the network or application requirements. - A request can be either WS/WSS or HTTP/HTTPS. - If you exceed the rate limit, you will receive the error code 429. You will then have to wait until the rate limit window has expired. -- You can avoid OTF-lite node rate limits by running your own local lite node. You can run a lite node either [Using Docker](../subtensor-nodes/using-docker.md#using-lite-nodes) or [Using Source](../subtensor-nodes/using-source#lite-node-on-mainchain). - +- You can avoid OTF-lite node rate limits by running your own local lite node. You can run a lite node either [Using Docker](../subtensor-nodes/run/using-docker.md#using-lite-nodes) or [Using Source](../subtensor-nodes/run/using-docker#lite-node-on-mainchain). diff --git a/docs/subtensor-nodes/index.md b/docs/subtensor-nodes/index.md index c39ff251..c4b73f46 100644 --- a/docs/subtensor-nodes/index.md +++ b/docs/subtensor-nodes/index.md @@ -4,7 +4,7 @@ title: "Subtensor Node Basics" import ThemedImage from '@theme/ThemedImage'; import useBaseUrl from '@docusaurus/useBaseUrl'; -import { SdkVersion } from "../sdk/_sdk-version.mdx"; +import { SdkVersion } from "../sdk/\_sdk-version.mdx"; # Subtensor Node Basics @@ -30,49 +30,47 @@ style={{width: 550}} ## Lite node vs archive node -A public subtensor node refers to an internet-connected computer that is synchronized with the Bittensor blockchain database. A **lite node** or an **archive node** is a type of public subtensor node. +A public subtensor node refers to an internet-connected computer that is synchronized with the Bittensor blockchain database. A **lite node** or an **archive node** is a type of public subtensor node. :::tip a subtensor node is not a neuron -A subtensor node is different from a Bittensor neuron. A Bittensor neuron is either a subnet validator node or a subnet miner node—it exists in a subnet, and it does not contain blockchain database. +A subtensor node is different from a Bittensor neuron. A Bittensor neuron is either a subnet validator node or a subnet miner node—it exists in a subnet, and it does not contain blockchain database. ::: Normally, a node in Bittensor blockchain must always be synchronized to the latest blockchain ledger state. Such a blockchain node accomplishes this by holding a copy of the entire Bittensor blockchain database, from the genesis block all the way to the current block. However, holding an entire copy of blockchain ledger state, which is continuously increasing in size, can be expensive. Hence, two types of nodes, a lite node and an archive node, are defined for subtensor, as below: ### Lite node -A **lite node** is configured to perform warp synchronization, which primarily syncs with the blocks that have been finalized, and not the entire blockchain. +A **lite node** is configured to perform warp synchronization, which primarily syncs with the blocks that have been finalized, and not the entire blockchain. :::tip flags for lite node -Use `--sync=warp` when starting a subtensor node. See [Using Source Code](./using-source.md#run-the-subtensor-node). +Use `--sync=warp` when starting a subtensor node. See [Using Source Code](./run/using-source.md#run-the-subtensor-node). ::: -The lite node warps (jumps) directly to the latest finalized block, downloading the complete blockchain state at that point. The purpose of a lite node is to get up and running quickly and serve, with minimal storage requirements, as a local entry point into the Bittensor mainchain or testchain. +The lite node warps (jumps) directly to the latest finalized block, downloading the complete blockchain state at that point. The purpose of a lite node is to get up and running quickly and serve, with minimal storage requirements, as a local entry point into the Bittensor mainchain or testchain. - **Verification of chain history**: To ensure blockchain validity, a lite node downloads and verifies finality proofs all the way back to the genesis block (the first block). These proofs confirm the legitimacy of the chain's history without processing every single block. +**Verification of chain history**: To ensure blockchain validity, a lite node downloads and verifies finality proofs all the way back to the genesis block (the first block). These proofs confirm the legitimacy of the chain's history without processing every single block. - **Background fill**: The lite node, while actively participating in the network, still downloads and processes historical blocks in the background to build the complete blockchain database. This download happens when the node is less busy. - - :::tip lite node for a subnet miner - A subnet miner should use a local lite node to communicate with the Bittensor blockchain. - ::: +**Background fill**: The lite node, while actively participating in the network, still downloads and processes historical blocks in the background to build the complete blockchain database. This download happens when the node is less busy. + +:::tip lite node for a subnet miner +A subnet miner should use a local lite node to communicate with the Bittensor blockchain. +::: ### Archive node -On the other hand, an **archive node** downloads and validates all the Bittensor blockchain blocks from genesis up to the most recent block. +On the other hand, an **archive node** downloads and validates all the Bittensor blockchain blocks from genesis up to the most recent block. :::tip flags for archive node -Use `--sync=full` and `--pruning archive` when starting a subtensor node. See [Using Source Code](./using-source.md#run-the-subtensor-node). +Use `--sync=full` and `--pruning archive` when starting a subtensor node. See [Using Source Code](./run/using-source.md#run-the-subtensor-node). ::: The full synchronization performed by an archive node can be significantly slower than warp sync (done by a lite node) as it involves processing every block. Also, archive nodes require substantially more storage space due to the complete historical data. - :::tip archive node for a blockchain explorer - Applications such as Bittensor blockchain explorer, for example, [TAO.app](https://tao.app) that require access to historical blockchain data use an archive node. - ::: - - +:::tip archive node for a blockchain explorer +Applications such as Bittensor blockchain explorer, for example, [TAO.app](https://tao.app) that require access to historical blockchain data use an archive node. +::: -## Query archived data +## Query archived data @@ -89,5 +87,3 @@ print(meta) :::tip See also Also see the [`metagraph` API reference](https://docs.bittensor.com/python-api/html/autoapi/bittensor/metagraph/index.html#bittensor.metagraph.metagraph.sync). ::: - - diff --git a/docs/subtensor-nodes/run/index.md b/docs/subtensor-nodes/run/index.md new file mode 100644 index 00000000..d74ad03a --- /dev/null +++ b/docs/subtensor-nodes/run/index.md @@ -0,0 +1,8 @@ +--- +title: "Running a Subtensor node" +--- + +# Running a Subtensor node + +- lite vs archive (choose) +- list of flags etc diff --git a/docs/subtensor-nodes/using-docker.md b/docs/subtensor-nodes/run/using-docker.md similarity index 99% rename from docs/subtensor-nodes/using-docker.md rename to docs/subtensor-nodes/run/using-docker.md index 21f8a49d..8a46baa2 100644 --- a/docs/subtensor-nodes/using-docker.md +++ b/docs/subtensor-nodes/run/using-docker.md @@ -1,5 +1,5 @@ --- -title: "Using Docker" +title: "Run with Docker" --- import ThemedImage from '@theme/ThemedImage'; @@ -7,7 +7,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Using Docker +# Run with Docker To run a subtensor node with Docker, follow the below steps. diff --git a/docs/subtensor-nodes/using-source.md b/docs/subtensor-nodes/run/using-source.md similarity index 88% rename from docs/subtensor-nodes/using-source.md rename to docs/subtensor-nodes/run/using-source.md index 11385ef9..6b6304ba 100644 --- a/docs/subtensor-nodes/using-source.md +++ b/docs/subtensor-nodes/run/using-source.md @@ -1,11 +1,13 @@ --- -title: "Using Source Code" +title: "Run with Source Code" --- import ThemedImage from '@theme/ThemedImage'; import useBaseUrl from '@docusaurus/useBaseUrl'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -# Using Source Code +# Run with Source Code To install and run a subtensor node by compiling the source code, follow the below steps. @@ -85,34 +87,45 @@ cargo build -p node-subtensor --profile=production --features=metadata-hash You can now run the public subtensor node either as a lite node or as an archive node. See below: -### Lite node on mainchain +### Using lite node + + To run a lite node connected to the mainchain, execute the below command (note the `--sync=warp` flag which runs the subtensor node in lite mode): ```bash ./target/production/node-subtensor --chain ./chainspecs/raw_spec_finney.json --base-path /var/lib/subtensor --sync=warp --port 30333 --max-runtime-instances 32 --database paritydb --db-cache 4096 --trie-cache-size 2048 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.finney.chain.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC --no-mdns --rpc-external ``` -### Archive node on mainchain - -To run an archive node connected to the mainchain, execute the below command (note the `--sync=full` which syncs the node to the full chain and `--pruning archive` flags, which disables the node's automatic pruning of older historical data): + + +To run a lite node connected to the testchain, execute the below command: ```bash -./target/production/node-subtensor --chain ./chainspecs/raw_spec_finney.json --base-path /var/lib/subtensor --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.finney.chain.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC --no-mdns --prometheus-external --rpc-external +./target/production/node-subtensor --chain ./chainspecs/raw_spec_testfinney.json --base-path /var/lib/subtensor --sync=warp --port 30333 --max-runtime-instances 32 --database paritydb --db-cache 4096 --trie-cache-size 2048 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --rpc-external ``` -### Lite node on testchain + + -To run a lite node connected to the testchain, execute the below command: +### Using archive node + + + +To run an archive node connected to the mainchain, execute the below command (note the `--sync=full` which syncs the node to the full chain and `--pruning archive` flags, which disables the node's automatic pruning of older historical data): ```bash -./target/production/node-subtensor --chain ./chainspecs/raw_spec_testfinney.json --base-path /var/lib/subtensor --sync=warp --port 30333 --max-runtime-instances 32 --database paritydb --db-cache 4096 --trie-cache-size 2048 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --rpc-external +./target/production/node-subtensor --chain ./chainspecs/raw_spec_finney.json --base-path /var/lib/subtensor --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.finney.chain.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC --no-mdns --prometheus-external --rpc-external ``` -### Archive node on testchain + + To run an archive node connected to the testchain, execute the below command: ```bash ./target/production/node-subtensor --chain ./chainspecs/raw_spec_testfinney.json --base-path /var/lib/subtensor --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/ws/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --prometheus-external --rpc-external ``` + + + diff --git a/docusaurus.config.js b/docusaurus.config.js index 6644ad4c..f29ab6ee 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -205,10 +205,6 @@ const config = { from: "/utilities", to: "/resources/utilities", }, - { - from: "/governance", - to: "/governance", - }, { from: "/senate", to: "/governance/senate", @@ -221,6 +217,14 @@ const config = { from: "/media-assets", to: "/resources/media-assets", }, + { + from: "/subtensor-nodes/using-docker", + to: "/subtensor-nodes/run/using-docker", + }, + { + from: "/subtensor-nodes/using-source", + to: "/subtensor-nodes/run/using-source", + }, ], }, ], diff --git a/llms.txt b/llms.txt index 76139237..2362247c 100644 --- a/llms.txt +++ b/llms.txt @@ -101,8 +101,8 @@ The primary command-line tool for Bittensor operations. ### Subtensor Nodes - **Node Basics**: https://docs.bittensor.com/subtensor-nodes/ - **Node Requirements**: https://docs.bittensor.com/subtensor-nodes/subtensor-node-requirements -- **Source Installation**: https://docs.bittensor.com/subtensor-nodes/using-source -- **Docker Installation**: https://docs.bittensor.com/subtensor-nodes/using-docker +- **Source Installation**: https://docs.bittensor.com/subtensor-nodes/run/using-docker +- **Docker Installation**: https://docs.bittensor.com/subtensor-nodes/run/using-docker - **Rate Limits**: https://docs.bittensor.com/subtensor-nodes/subtensor-rate-limits - **Storage Queries**: https://docs.bittensor.com/subtensor-nodes/subtensor-storage-query-examples - **Error Messages**: https://docs.bittensor.com/subtensor-nodes/subtensor-error-messages diff --git a/sidebars.js b/sidebars.js index 9f381804..d0ced05b 100644 --- a/sidebars.js +++ b/sidebars.js @@ -262,8 +262,17 @@ const sidebars = { collapsed: true, items: [ "subtensor-nodes/subtensor-node-requirements", - "subtensor-nodes/using-source", - "subtensor-nodes/using-docker", + { + type: "category", + label: "Running a subtensor node", + link: { type: "doc", id: "subtensor-nodes/run/index" }, + collapsible: true, + collapsed: true, + items: [ + "subtensor-nodes/run/using-source", + "subtensor-nodes/run/using-docker", + ], + }, "subtensor-nodes/subtensor-storage-query-examples", ], }, From e5a2680fe5b88fbf9aaf7d67c439ecde5ff9405d Mon Sep 17 00:00:00 2001 From: Dera Okeke Date: Mon, 20 Apr 2026 23:37:55 +0100 Subject: [PATCH 3/3] subtensor node doc updates --- docs/subtensor-nodes/index.md | 8 +++++-- docs/subtensor-nodes/run/index.md | 22 +++++++++++++++++-- docs/subtensor-nodes/run/using-docker.md | 4 ++++ .../subtensor-node-requirements.md | 11 +++++----- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/docs/subtensor-nodes/index.md b/docs/subtensor-nodes/index.md index c4b73f46..7f4ae270 100644 --- a/docs/subtensor-nodes/index.md +++ b/docs/subtensor-nodes/index.md @@ -40,7 +40,9 @@ Normally, a node in Bittensor blockchain must always be synchronized to the late ### Lite node -A **lite node** is configured to perform warp synchronization, which primarily syncs with the blocks that have been finalized, and not the entire blockchain. +A **lite node** is configured to perform warp synchronization, which primarily syncs with the blocks that have been finalized, and not the entire blockchain. They retain only recent data, offer limited historical access, and use significantly less storage. + +A lite node is suitable for miners, most neurons, block validators, and subnet validators. :::tip flags for lite node Use `--sync=warp` when starting a subtensor node. See [Using Source Code](./run/using-source.md#run-the-subtensor-node). @@ -58,7 +60,9 @@ A subnet miner should use a local lite node to communicate with the Bittensor bl ### Archive node -On the other hand, an **archive node** downloads and validates all the Bittensor blockchain blocks from genesis up to the most recent block. +On the other hand, an **archive node** downloads and validates all the Bittensor blockchain blocks from genesis up to the most recent block. Archive nodes store the entire blockchain history, providing full state access for tasks requiring historical data, such as analytics and audits. + +Archive nodes are suitable for block explorers, indexers, analytics, and querying data older blocks. :::tip flags for archive node Use `--sync=full` and `--pruning archive` when starting a subtensor node. See [Using Source Code](./run/using-source.md#run-the-subtensor-node). diff --git a/docs/subtensor-nodes/run/index.md b/docs/subtensor-nodes/run/index.md index d74ad03a..acfba6b7 100644 --- a/docs/subtensor-nodes/run/index.md +++ b/docs/subtensor-nodes/run/index.md @@ -4,5 +4,23 @@ title: "Running a Subtensor node" # Running a Subtensor node -- lite vs archive (choose) -- list of flags etc +This page covers what you need to know before setting up a Subtensor node. + +--- + +A Subtensor node is an internet-connected machine that holds a synchronized copy of the Bittensor blockchain and exposes interfaces for querying state or participating in network operations such as block validation, subnet validation, and mining. + +Running your own node gives you a private, low-latency endpoint instead of depending on a public one, which is recommended for any serious validator, miner, or indexer workload. + +:::info Before you begin +Before you start running a subtensor node, you need to decide on what type of node you want to run. The node type you choose should depend on your available storage capacity and whether your use case requires access to historical chain data. For more information, see [Lite node vs Archive node](../../subtensor-nodes#lite-node-vs-archive-node). +::: + +## Choosing an approach + +There are two supported ways to run a Subtensor node: + +- **Run with Docker**: Runs the node inside a preconfigured container. This provides a faster setup and a consistent, isolated environment for running the Subtensor node. +- **Run with Source Code**: Builds and runs the node directly from the Subtensor repository. Use this approach if you need full control over the build, plan to modify or inspect the runtime, or are debugging or contributing to Subtensor. + +Both approaches result in the same node behavior. The difference is in setup, control, and operational complexity. diff --git a/docs/subtensor-nodes/run/using-docker.md b/docs/subtensor-nodes/run/using-docker.md index 8a46baa2..80218c44 100644 --- a/docs/subtensor-nodes/run/using-docker.md +++ b/docs/subtensor-nodes/run/using-docker.md @@ -62,6 +62,10 @@ Adding a user to the `docker` group is only necessary on Linux, where `sudo` pri Now you can run the subtensor nodes for either mainchain or testchain using any of available options. +:::info Start your docker engine +Before running the command to run the Subtensor node on Docker, ensure that you have a Docker engine running on your device. +::: + ### Using lite nodes A lite node which primarily syncs with the only blocks that have been finalized, and not the entire blockchain. Run a lite node using the command corresponding to your target chain: diff --git a/docs/subtensor-nodes/subtensor-node-requirements.md b/docs/subtensor-nodes/subtensor-node-requirements.md index 22f9e5b0..472e4a74 100644 --- a/docs/subtensor-nodes/subtensor-node-requirements.md +++ b/docs/subtensor-nodes/subtensor-node-requirements.md @@ -1,14 +1,15 @@ --- title: "Subtensor Node Requirements" --- + import ThemedImage from '@theme/ThemedImage'; import useBaseUrl from '@docusaurus/useBaseUrl'; # Subtensor Node Requirements -To run a public subtensor, make sure that your computer satisfies the following system requirements: +To run a public subtensor node, make sure that your computer satisfies the following system requirements: -- Currently only x86_64 Linux architecture and macOS arm64 (Apple Silicon) are supported. +- Currently only x86_64 Linux architecture and macOS arm64 (Apple Silicon) are supported. - Subtensor requires 4 CPU cores and 16GB RAM to run. More resources may be required based on utilization. ## Linux x86_64 @@ -29,10 +30,9 @@ Requirements: - **Lite node**: 128 GB is sufficient. - **Archive node**: Minimum 2 TB for the current size of the chain, as of block # 5029000 on 28 Feb 2025. - ## Network requirements and port settings -After you install the subtensor as per the below instructions, make sure that you open network ports on your subtensor node. This will allow other peer subtensor nodes to connect to your subtensor node. +After you install the subtensor as per the below instructions, make sure that you open network ports on your subtensor node. This will allow other peer subtensor nodes to connect to your subtensor node. - Your subtensor node must have access to the public internet. - Your subtensor node runs in an IPv4 network. @@ -41,8 +41,7 @@ After you install the subtensor as per the below instructions, make sure that yo Make sure that your subtensor node listens on the following ports: -- `9944` - Websocket. This port is used by Bittensor. This port only accepts connections from ``localhost``. Make sure this port is firewalled **off** from the public internet domain. +- `9944` - Websocket. This port is used by Bittensor. This port only accepts connections from `localhost`. Make sure this port is firewalled **off** from the public internet domain. - `9933` - RPC. This port should be opened but it is not used. - `30333` - p2p socket. This port should accept connections from other subtensor nodes on the internet. Make sure your firewall **allows** incoming traffic to this port. - We assume that your default outgoing traffic policy is `ACCEPT`. If not, make sure that outbound traffic on port 30333 is allowed. -