From ae0aa681280fe0c8bdec51b0b6630ee3e9d2e137 Mon Sep 17 00:00:00 2001 From: vexr Date: Fri, 11 Oct 2024 20:12:31 -0700 Subject: [PATCH 1/5] Tips & Tricks refresh --- .../farming/advanced-cli/cli-tips.mdx | 463 +++++++++++++----- .../advanced-cli/cli-troubleshooting.mdx | 45 -- docs/farming-&-staking/farming/intro.mdx | 10 +- docusaurus.config.js | 3 +- src/theme/DocButton/index.js | 46 ++ src/theme/MDXComponents.js | 9 + 6 files changed, 391 insertions(+), 185 deletions(-) delete mode 100644 docs/farming-&-staking/farming/advanced-cli/cli-troubleshooting.mdx create mode 100644 src/theme/DocButton/index.js create mode 100644 src/theme/MDXComponents.js diff --git a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx index 01081b6eb6e..b41edee6c49 100644 --- a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx +++ b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx @@ -11,243 +11,438 @@ keywords: - Docker --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import Link from '@docusaurus/Link'; +import MDXComponents from '@theme-original/MDXComponents'; +import Button from '@site/src/theme/DocButton'; -## Additional Tips +Whether you are an experienced farmer or new to the Autonomys Network, this section offers valuable insights to improve your experience and efficiency. We explore practical advice and hidden techniques that will help you optimize your farming setup and tackle common challenges effortlessly. -Welcome to the Additional Tips section! Whether you're a seasoned farmer or just starting out with the Autonomys Network, these tips and tricks are designed to enhance your experience and efficiency. Here, we delve into practical advice and lesser-known techniques to help you fine-tune your farming setup and navigate common challenges with ease. From configuring your environment to managing background processes, these insights are tailored to ensure your Farmer operates smoothly and effectively. Let's dive in and explore how you can get the most out of your Autonomys Network Farmer. +These tips are specifically designed to ensure your farm runs smoothly and effectively. Let’s get started! -### Telemetry & Astral Block Explorer +## Telemetry & Explorers -Explore the Autonomys Network in depth with our variety of telemetry tools and block explorers. Whether you're monitoring network activity or exploring blockchain data, these resources provide comprehensive insights into the network's performance and transactions. +Explore the Autonomys Network in detail with our telemetry tool and various block explorers. Whether you're monitoring network activity or analyzing blockchain data, these resources provide valuable insights into the network's performance and transactions. -- **[Telemetry Server](https://telemetry.subspace.network)**: Get real-time insights into network activity and performance metrics. Ideal for monitoring the overall health and status of the Autonomys Network. +
+Monitor the Autonomys Network using telemetry and block explorers. -- **[Astral Block Explorer](https://astral.autonomys.xyz)**: Our primary tool for viewing blocks, transactions, and network activity on the Autonomys Network. This explorer offers an intuitive interface and detailed information. +
+
+
+

+ Get real-time insights into network activity and performance metrics. Ideal for monitoring the overall health and status of the Autonomys Network. +

+
-- **[Subscan Block Explorer](https://subspace.subscan.io)**: An alternative block explorer providing detailed views of blocks, transactions, and network events. Subscan is known for its user-friendly interface and additional data analytics features. +--- -- **[Polkadot.js Block Explorer](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-0.gemini-3h.subspace.network%2Fws#/explorer)**: For users familiar with the Polkadot ecosystem, this explorer offers a seamless experience for exploring the Autonomys Network using the Polkadot.js interface. +
+
+
+

+ Our primary tool for viewing blocks, transactions, and network activity on the Autonomys Network. This explorer offers an intuitive interface and detailed information. +

+
+ +
+
+
+

+ An alternative block explorer providing detailed views of blocks, transactions, and network events. Subscan is known for its user-friendly interface and additional data analytics features. +

+
+ +
+
+
+

+ For users familiar with the Polkadot ecosystem, this explorer offers a seamless experience for exploring the Autonomys Network using the Polkadot.js interface. +

+
+ +
+ +## Useful Parameters + +:::tip Available Parameters + +A complete list of parameters and their functions can be obtained using the `--help` option with both `subspace-node` and `subspace-farmer`. +::: + -### Snap Sync -As of the June 11, 2024 version, a new option called Snap Sync is available for fast syncing. It only works for the initial sync, but allow your node to be fully synced within hours instead of days. The parameter is `--sync snap`. Currently, Snap Sync only works with a farming node, not an operator node. + -Snap Sync works by jumping to near the end of the chain, allowing you to sync to the current block more quickly. Once the initial jump is complete, it behaves like a full sync. In fact, if you haven't synced for more than a few days, it might be quicker to remove the node database and use Snap Sync to quickly sync to the most current block. +
+DSN Syncing -There are cases where you might not want to use Snap Sync. To perform a full sync you can either omit the sync parameter, or use `--sync full`. This is useful if you want to run an RPC node for public use or indexing. In that case, you would need to run an archival node, not just a pruned node. An archival node requires a full sync. +:::caution[Adjusting DSN Sync Parameters] +It may be tempting to modify certain parameters that appear to be related to DSN syncing, but caution is advised. Some options may not improve syncing performance and should be left at their default settings. -### Plotting concurrency +::: -Starting with the February 19th release, plotting performance was improved by increasing internal concurrency. -During plotting, there are both parallel and sequential parts of the table generation. By generating several tables simultaneously, we can overlap the sequential parts with parallel parts, thus improving CPU utilization. While generating tables for all records requires significant RAM, producing tables for only a few records at a time offers an optimal balance between CPU and RAM usage. -We added the `--record-encoding-concurrency` option to override the default behavior, which allocates one record for every two cores but does not exceed eight in parallel. According to our internal testing with P-cores, E-cores, and combinations of P+E cores, this setting appears to achieve peak performance. -If you prefer to use the previous behavior, or if your RAM usage becomes too high, you can set `--record-encoding-concurrency` to `1`. You may also experiment with setting it to `2`, `3`, etc., which may yield better results depending on your specific CPU/RAM configuration. +:::tip[Understanding the DSN] -### Create Missing Farms +The DSN can be a complex topic. To gain a better understanding of our Decentralized Storage Network, please refer to this [guide](https://academy.autonomys.xyz/subspace-protocol/network-architecture/distributed-storage-network) from our Academy. -A farmer has the option to specify whether the system should automatically create missing farms upon startup. If you provide a path to a plot that isn't found, the system will generate a new one. However, this may not be desirable if a drive fails to mount properly. -By default, this option is set to `true`, but you can override it by adding `--create false`. Setting this flag to `false` after establishing your plots can prevent unintentional file writes to the wrong drive. +::: + +The default parameters are configured with common consumer modem and router capabilities in mind. Adjusting certain parameters can enhance DSN sync performance by increasing parallelism. However, if you choose to significantly increase these values, ensure that your modem or router can handle the additional traffic. + +```bash +--dsn-out-connections +--dsn-pending-out-connections +``` -### Record Chunks Reading Mode +
-Upon startup, each farm will [benchmark](#benchmarking-your-farmer) the performance of every plot to identify the most efficient proving method, yielding either `ConcurrentChunks` or `WholeSector` results. If you already know the optimal method for your setup, you can specify it as an argument for each farm to save time benchmarking. -For example, you can include record-chunks-mode= after defining the path and size, assigning the desired value, e.g., `path=/mnt/subspace1,size=100G,record-chunks-mode=ConcurrentChunks`. If you do not provide this parameter, the system will benchmark each disk on startup to identify the most efficient method. +
+Snap Sync -### Benchmarking Your Farmer -Benchmarking helps you test the plotting speed of your farmer against different versions of the Autonomys Network. +A full sync is required for situations where you need an archival node, such as running an operator or when running an RPC node for public use or indexing. Archival nodes store the entire blockchain, unlike pruned nodes that only store recent data. To perform a full sync and disable Snap Sync, use the following command: +```bash +--sync full ``` -./subspace-farmer benchmark audit /path/to/your/plot + +
+ +
+Wipe + +If you switch to a new network, you will need to wipe your existing data to be compatible with the new network. + +To wipe your node, use the following command, replacing `subspace-node` with the name of the node file you downloaded from [releases](https://github.com/autonomys/subspace/releases): + +```bash +./subspace-node wipe /path/to/node ``` -Replace /path/to/your/plot with the actual path to your plot. This will provide you with metrics and insights regarding plotting performance. +
+ +
-At the moment, Autonomys Node supports `rayon` implementation mechanism, that opens files as many times as there are farming threads and, for each thread, uses a dedicated file handle. -To interpret the results: typically, you assess throughput to determine the maximum auditable size across any number of disks. Both CPU and disk performance influence this metric. + -To read more about audit benchmarking, [read this forum post](https://forum.autonomys.xyz/t/audit-benchmark-result-explanation-please/2149). +
+Benchmarking -There is a second command available, which helps you determine how much time your farmer has after auditing to provide proof. +Benchmarking helps you test the plotting speed of your farmer. To perform a benchmark audit, use the following command: +```bash +./subspace-farmer benchmark audit /path/to/plot ``` -./subspace-farmer benchmark prove /path/to/your/plot + +Replace `/path/to/plot` with the actual path to your plot. This command will provide metrics and insights regarding your plotting performance. + +To interpret the results, assess throughput to determine the maximum auditable size across any number of disks, as both CPU and disk performance influence this metric. + +

***To read more about prove audit benchmarking, refer to this [forum post](https://forum.autonomys.xyz/t/2149).***

+ +There is also a second command available to determine how much time your farmer has after auditing to provide proof: + +```bash +./subspace-farmer benchmark prove /path/to/plot ``` -Each farmer has ~4 seconds to audit and prove, so depending on how fast auditing is, the remaining time will be used for proving. -Proving performance doesn’t depend on the plot size. +Each farmer has approximately four seconds to audit and prove, so depending on the speed of auditing, the remaining time will be allocated for proving. Note that proving performance does not depend on plot size. + +If there isn’t enough time for the proving step, the farmer logs a message like this: + +``` +Proving for solution skipped due to farming time limit slot= sector_index= +``` -If an environment does not have enough time for the proving step, a message such as this is logged by the farmer: +

***To read more about prove benchmarking, refer to this [forum post](https://forum.autonomys.xyz/t/2150).***

-`Proving for solution skipped due to farming time limit slot=6723846 sector_index=46` +
-To read more about prove benchmarking, [read this forum post](https://forum.autonomys.xyz/t/audit-benchmark-result-explanation-please/2150). +
+Create Missing Farms -### Scrubbing Your Farmer -In certain situations, especially when the farmer terminates unexpectedly or encounters an error, it might fail to restart correctly. The scrub command assists in resolving such issues by cleaning or resetting the specified plot. +A farmer can choose whether the system should automatically create missing farms at startup. If you specify a path to a plot that doesn't exist, the system will generate a new one. However, this may lead to issues if a drive fails to mount correctly. By default, this option is enabled, but you can disable it using the following flag: +```bash +--create false ``` -./subspace-farmer scrub /path/to/your/plot + +Setting this option to false after your plots are initially created helps prevent accidental file writes to an incorrect drive. + +
+ +
+Record Chunks Mode + +Upon startup, each farm benchmarks the performance of every plot to identify the most efficient proving method, yielding either `ConcurrentChunks` or `WholeSector` results. If you already know the optimal method for your setup, you can specify it as an argument for each farm to save time during benchmarking. + +For example, you can set `record-chunks-mode` after defining the path and size, assigning the desired value: + +```bash +path=/mnt/plots/drive1,size=4TB,record-chunks-mode=ConcurrentChunks ``` -Ensure to replace /path/to/your/plot with your actual plot path. Use this command cautiously as it modifies the plot state to recover from errors. +If you do not provide this parameter, the system will benchmark each disk at startup to determine the most efficient method. + +
-### Specify Exact CPU Cores for Plotting/Replotting -This option will override any custom logic that the **subspace farmer** might otherwise use. -You can specify the plotting CPU cores by adding `--plotting-cpu-cores`, followed by the desired cores parameters. Cores should be listed as comma-separated values, with whitespace used to separate different thread pools or encoding instances. -For example, `--plotting-cpu-cores 0,1 2,3` will result in two sectors being encoded simultaneously, each using a pair of CPU cores. +
+DSN Syncing -Similarly, you can customize the replotting CPU cores using `--replotting-cpu-cores`, followed by arguments similar to those used in the `--plotting-cpu-cores` example above. +:::caution[Adjusting DSN Sync Parameters] -Note that setting `--plotting-cpu-cores` requires `--replotting-cpu-cores` to be configured with the same number of CPU core groups. If the `--replotting-cpu-cores` setting is omitted, the node will default to using the same thread pool as for plotting. +It may be tempting to modify certain parameters that appear to be related to DSN syncing, but caution is advised. Some options may not improve syncing performance and should be left at their default settings. + +::: +:::tip[Understanding the DSN] -### Switching to a new snapshot from older/different versions of Autonomys +The DSN can be a complex topic. To gain a better understanding of our Decentralized Storage Network, please refer to this [guide](https://academy.autonomys.xyz/subspace-protocol/network-architecture/distributed-storage-network) from our Academy. -:::info -Unless specifically mentioned by the Development team you should **NOT** have to wipe your configuration on new releases. ::: -In general you should be able to download the latest release, and re-start the Node & Farmer with the same commands as you started to prior version with no errors. +The default parameters are configured with common consumer modem and router capabilities in mind. Adjusting certain parameters can enhance DSN sync performance by increasing parallelism. However, if you choose to significantly increase these values, ensure that your modem or router can handle the additional traffic. -There are some cases where version updates will cause issue with your Node & Farmer and you may have to wipe your node, typically when errors occur. If you have any issues you can always check our [Forums](https://forum.autonomys.xyz) and hop in our [Discord](https://autonomys.xyz/discord) Server to ask for help. +Increasing the values of the farmer parameters may enhance plotting speed by accelerating piece cache download speeds. + +```bash +--out-connections +--pending-out-connections +``` -### Wipe +
+ +
+Record Encoding Concurrency + +Plotting performance has been improved with increased internal concurrency. During plotting, table generation involves both parallel and sequential phases. By generating multiple tables at once, we overlap sequential tasks with parallel ones, improving CPU utilization. Although generating tables for all records demands significant RAM, processing fewer records at a time helps balance CPU and RAM usage. + +The `--record-encoding-concurrency` option allows you to fine-tune this balance. By default, it allocates one record for every two cores, up to eight in parallel. If RAM usage becomes too high or you prefer the previous method, you can adjust this setting. + +Example usage: -If you were running a node previously, and want to switch to a new network, please perform these steps and then follow the guide again: ```bash -# Replace `FARMER_FILE_NAME` with the name of the farmer file you downloaded from releases -./FARMER_FILE_NAME wipe PATH_TO_FARM -# Replace `NODE_FILE_NAME` with the name of the node file you downloaded from releases -./NODE_FILE_NAME wipe NODE_DATA_PATH +--record-encoding-concurrency 4 ``` -Now follow the installation guide from the beginning. +You can experiment to optimize performance based on your system's CPU and RAM. -### Docker Wipe +
-In case of Docker setup run `docker compose down -v` (and manually delete custom directories if you have specified them). +
+Scrub -Now follow the installation guide. +In certain situations, when the farmer terminates unexpectedly or encounters an error, it may fail to restart correctly. The scrub command helps resolve these issues by cleaning or resetting the specified plot. + +```bash +./subspace-farmer scrub /path/to/plot +``` -If you are having issues with running a node or farmer for Autonomys, feel free to join our Discord or even better you can take a look at our forums and review existing questions or post a new one if needed! +Ensure you replace `/path/to/plot` with the actual path to your plot. Use this command with caution, as it modifies the plot state to recover from errors. -- [Forum](https://forum.autonomys.xyz) -- [Discord](https://autonomys.xyz/discord) +
-### Help +
+Specify CPU Cores -There are extra commands and parameters you can use on farmer or node, use the `--help` after any other command to display additional options. +This option allows you to override any custom logic that subspace-farmer uses for CPU core allocation. You can specify the plotting CPU cores by adding `--plotting-cpu-cores`, followed by the desired core parameters. Cores should be listed as comma-separated values, using whitespace to separate different thread pools or encoding instances. + +For example, the command: ```bash -# Replace `FARMER_FILE_NAME` with the name of the node file you downloaded from releases -./FARMER_FILE_NAME farm --help +--plotting-cpu-cores 0,1 2,3 ``` ---- -### Timekeepers +will result in two sectors being encoded simultaneously, with each sector using a pair of CPU cores. -Gemini-3g introduces Proof-of-Time and a new, optional role has been added to the node. Timekeepers help run PoT to ensure the security of the network. Timekeeping requires a high-performance core CPU but can be undertaken by any node runner. You can enable timekeeping with the following commands. -- `--timekeeper`: To enable timekeeping on the node -- `--timekeeper-cpu-cores`: To specify which cores the Timekeeper will run on. +You can similarly customize the replotting CPU cores with the `--replotting-cpu-cores` option, using arguments that follow the same format as `--plotting-cpu-cores`. -Read more about [Timekeepers](/farming/timekeeper) +It is important to note that if you set `--plotting-cpu-cores`, you must configure `--replotting-cpu-cores` with the same number of CPU core groups. If you omit the `--replotting-cpu-cores` setting, the node will default to using the same thread pool as for plotting. -### Node & Farmer Commands Guide +
-Both the node and the farmer have a variety of flags and parameters. To see a full list, append the `--help` flag to either the node or the farmer command. +
+Utilizing Multiple Drives -### Common Command Examples +You can farm to multiple drives with a single instance of the farmer. This allows for greater storage capacity and increased rewards. -:::note Farming Changes -Please note that as of `Gemini-3g` farming no longer occurs while plotting. This is to ensure the plotting process occurs in the most efficient manner. You can change this by adding the `--farm-during-initial-plotting` flag to the farmer. -::: +This example specifies the paths and sizes of multiple plots across different drives: + +```bash +./subspace-farmer farm --reward-address \ + path=/mnt/plots/drive1,size=900GiB \ + path=/mnt/plots/drive2,size=8T \ + path=/mnt/plots/drive3,size=8T +``` -For both the node and the farmer, here are some frequently used commands: +
-- Display farm information: `./FARMER_FILE_NAME info PATH_TO_FARM` -- Scrub the farm for errors: `./FARMER_FILE_NAME scrub PATH_TO_FARM` -- Erase all farmer-related data: `./FARMER_FILE_NAME wipe PATH_TO_FARM` -- Erase all node-related data: `./NODE_FILE_NAME wipe NODE_DATA_PATH` +
+Wipe -### Utilizing Multiple Disks +If you switch to a new network, you will need to wipe your existing data to be compatible with the new network. -To maximize storage capabilities, you can engage multiple disks directly. This is often more efficient than relying on RAID configurations: +To wipe your farm, use the following command, replacing `subspace-farmer` with the name of the farmer file you downloaded from [releases](https://github.com/autonomys/subspace/releases): -Example: -```shell-session -./FARMER_FILE_NAME farm --reward-address WALLET_ADDRESS \ - path=/media/ssd1,size=100GiB \ - path=/media/ssd2,size=10T \ - path=/media/ssd3,size=10T +```bash +./subspace-farmer wipe /path/to/farm ``` -### Optimizing DSN Syncing +
-:::note +
- The DSN can be a nuanced topic, to better understand our Decentralized Storage Network, please refer to [this guide](https://academy.autonomys.xyz/subspace-protocol/network-architecture/distributed-storage-network) from our Academy. -::: + -:::warning Parameters to Use with Caution -While it might be tempting to adjust certain parameters that seem related to DSN Syncing, it's advised to be cautious. Some options will not enhance syncing and are best left at their default values: +
+Wipe +If you switch to a new network, you will need to wipe your existing data to ensure compatibility with the new network. + +In the case of a Docker setup, run the following command to stop and remove the containers, along with the associated volumes: + +```bash +docker compose down -v ``` ---out-peers ---in-peers ---dsn-target-connections ---dsn-pending-in-connections ---dsn-in-connections -``` -::: -#### Recommended Parameters +Make sure to manually delete any custom directories if you specified them. + +
+ + +
+ +
+ +--- + +## Advanced Error Logging -The default parameters are set with the capabilities of common consumer modem/routers in mind. Adjusting certain parameters could enhance DSN sync performance by increasing parallelism. However, if you decide to increase them significantly, ensure that your modem/router is performant enough to handle the increased traffic. -**Node:** +
+Enable Rust Backtrace + +When operating the Subspace Farmer and Node, you may come across an error message prompting you to enable a Rust backtrace for issue diagnosis: + +```bash +Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. ``` ---dsn-out-connections ---dsn-pending-out-connections + +This message indicates that Rust, the programming language utilized by the Subspace Farmer and Node, has encountered a problem. By default, the backtrace is not shown. To activate the `RUST_BACKTRACE` environment variable and access detailed error information, use the following commands according to your operating system: + + + + + +To enable the Rust backtrace in the Ubuntu terminal, type the following command and then rerun the application: + +```bash +export RUST_BACKTRACE=1 ``` -**Farmer:** -Increasing the values of the farmer parameters could increase the plotting speed. + + + + + +To enable the Rust backtrace in PowerShell, enter the following command and then rerun the application: + +```powershell +$Env:RUST_BACKTRACE=1 ``` ---out-connections ---pending-out-connections + + + + + +To enable the Rust backtrace in the macOS terminal, type the following command and then rerun the application: + +```bash +export RUST_BACKTRACE=1 ``` + -### NUMA Support + -:::note -NUMA support will benefit farmers with large, powerful CPUs and lots of RAM available. The required RAM amount depends on the processor and the number of threads. -::: +For services, use the following commands to enable the Rust backtrace: + +1. Edit the service file for the node or farmer: + + ```bash + sudo systemctl edit subspace-node + ``` + + or + + ```bash + sudo systemctl edit subspace-farmer + ``` + +2. Add the `[Service]` section and include the line `Environment=RUST_BACKTRACE=1` between the warning comments. + +3. Reload the systemd manager configuration: + + ```bash + sudo systemctl daemon-reload + ``` -Previously plotting/replotting thread pools were created for each farm separately even though only a configured number of them can be used at a time (by default just one). -With the introduction of NUMA support, the farmer application has a thread pool manager that will create a necessary number of thread pools that will be allocated to currently plotting/replotting farms. -When a thread pool is created, it is assigned to a set of CPU cores and will only be able to use those cores. Pinning doesn’t pin threads to cores 1:1, instead, the OS is free to move threads between cores, but only within CPU cores allocated for the thread pool. This will ensure plotting for a particular sector only happens on a particular CPU/NUMA node. +4. Restart the services: -#### Enabling NUMA on Windows/Linux machines + ```bash + sudo systemctl restart subspace-{node,farmer} + ``` + + + + + +Enabling `RUST_BACKTRACE` provides additional diagnostic information that can assist in resolving any errors encountered during operation. This information can be shared with the development or support team for further analysis. + +
+ +## Operating System Changes + + +
+Changing the Open Files Limit on Linux + +Adjusting the open files limit on Linux is sometimes necessary to optimize both system and application performance. Applications that manage file sharing or distribution, such as peer-to-peer systems, may need to open many connections to different peers simultaneously. Increasing the open files limit enables these applications to maintain more connections, thereby enhancing data transfer rates and overall system efficiency. + +This adjustment can also help prevent the `Too Many Open Files` error. + +To temporarily change the limit for open files, you can use the `ulimit` command. For example, to set the limit to 2048, you would run: + +```bash +ulimit -n 2048 +``` -On Linux and Windows, the farmer will detect NUMA systems and create a number of thread pools that correspond to the number of NUMA nodes. This means the default behavior will change for large CPUs and consume more memory as a result, but that can be changed to the previous behavior with CLI options if desired. -To use NUMA, you need to enable it via the BIOS of your motherboard for the farmer to know it exists. This option is present in motherboards for **Threadripper/Epyc processors** but might exist in others too. If you don’t enable it, both OS and farmer will think you have a single UMA processor and will not be able to apply optimizations. +Keep in mind that this change will revert after logging out or rebooting. -To read more about NUMA support and the benefits it provides for large CPUs read [this forum post](https://forum.autonomys.xyz/t/numa-support-is-coming/2299?u=nazar-pc). +For a permanent adjustment, you have two options: +1. Modify the kernel parameter `fs.file-max` using the `sysctl` command: -#### Changing number of open files limit (Linux) + ```bash + sysctl -w fs.file-max=500000 + ``` -Changing the number of open files limit on Linux is sometimes necessary for both system and application performance tuning. Applications that manage file sharing or distribution, including peer-to-peer systems, may require opening numerous connections to different peers simultaneously. A higher open files limit allows these applications to maintain more connections, improving data transfer rates and system efficiency. +2. Set limits for individual users by editing the `/etc/security/limits.conf` file. You can specify hard and soft limits for the number of open files. For instance: -This can also help to mitigate the `Too Many Open Files` error. + ```bash + username soft nofile 10000 + username hard nofile 30000 + ``` -You can use the `ulimit` command to change the limit for open files temporarily. For example, setting `ulimit -n 2048` will set the limit to 2048. This change is reverted after logging out or a reboot. +By applying these changes, you can effectively manage the open files limit to optimize your system’s performance. -For a permanent change, you have two approaches: -- To modify the kernel parameter `fs.file-max`. You can do this using the `sysctl` command `sysctl -w fs.file-max=500000`. -- To set limits for individual users, you need to edit the `/etc/security/limits.conf` file. You can specify hard and soft limits for the number of open files `username soft nofile 10000` for the soft limit and `username hard nofile 30000` for the hard limit. \ No newline at end of file +
\ No newline at end of file diff --git a/docs/farming-&-staking/farming/advanced-cli/cli-troubleshooting.mdx b/docs/farming-&-staking/farming/advanced-cli/cli-troubleshooting.mdx deleted file mode 100644 index 344f79dbe2f..00000000000 --- a/docs/farming-&-staking/farming/advanced-cli/cli-troubleshooting.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Troubleshooting -sidebar_position: 5 -description: How to run an Autonomys Network Farmer with the Substrate CLI -slug: /farming/advanced-cli/troubleshooting -keywords: - - Farmer - - Farming - - CLI - - Binaries - - Docker ---- - -## Troubleshooting - -If you are facing issues with your node/farmer you can try a few of the following things below, if you are unable to get your issue resolved please check our [Forum](https://forum.autonomys.xyz/c/support/5) to see if your issue may have been solved, if its a new one feel free to post it! You can also join our [Discord](https://autonomys.xyz/discord) and use one of the dedicated channels #farmer-support and #farmer-chat for additional Peer to Peer help. - -:::info -We have included a few tutorials below that may help you in your support journey, this is not an all inclusive list and we welcome contributions -::: - - -### Enable Rust Backtrace - -When running the Autonomys Network Farmer & Node, you might encounter an error message indicating the need for a Rust backtrace to diagnose issues: - -```text -Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. -``` - -This message suggests that Rust, the programming language used in the Autonomys Network Farmer & Node, has encountered a problem. By default, the backtrace is not displayed. To enable the `RUST_BACKTRACE` environment variable and view detailed error information, use the following commands based on your operating system: - -- **🖼️ Windows** (PowerShell): Enter `$Env:RUST_BACKTRACE=1` in PowerShell and rerun the application. -- **🍎 macOS**: Type `export RUST_BACKTRACE=1` in the terminal and rerun the application. -- **🐧 Ubuntu**: Enter `export RUST_BACKTRACE=1` in the terminal and rerun the application. -- **⚙ Service (Linux)**: For services, use `sudo systemctl edit subspace-node` or `sudo systemctl edit subspace-farmer`, add `[Service]` and `Environment=RUST_BACKTRACE=1` between the warning comments, reload with `sudo systemctl daemon-reload`, and restart services using `sudo systemctl restart subspace-{node,farmer}`. - -By enabling `RUST_BACKTRACE`, you can obtain additional diagnostic information to help resolve any errors encountered during operation. - -### Common Problems - -Looking for solutions to other common issues? - -Check out our Common Problems page. This resource covers a range of frequently encountered challenges, offering practical solutions to help you overcome them. Please note that while this page addresses many common issues, it is not an all-inclusive list. For issues not covered, you can visit our forums or Discord for additional support. - diff --git a/docs/farming-&-staking/farming/intro.mdx b/docs/farming-&-staking/farming/intro.mdx index d787399ce5d..baee7597642 100644 --- a/docs/farming-&-staking/farming/intro.mdx +++ b/docs/farming-&-staking/farming/intro.mdx @@ -84,7 +84,7 @@ SSD storage is required. High end models are not necessary and a mid range SSD f :::caution File Descriptor Limit -Linux systems may have a default file descriptor limit, which can vary based on distribuition. Exceeding this limit could cause errors. For detailed information, visit our [Tips & Tricks](/farming/advanced-cli/tips#changing-number-of-open-files-limit-linux) guide. +Linux systems may have a default file descriptor limit, which can vary based on distribuition. Exceeding this limit could cause errors. For detailed information, visit our [Tips & Tricks](/farming/advanced-cli/tips#open-files-limit) guide. ::: @@ -149,8 +149,10 @@ For detailed information on network configurations, including port forwarding re ## Dependencies -:::caution No Output and Missing Error Codes - -If you encounter a situation in Windows where the node produces no output and does not display any error code, it is likely that you simply need to install the latest version of the [Visual C++ Redistributable package](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist). +:::caution Windows No Output Bug +If you face an error where the node outputs nothing and no error code is given it is likely you just need to install the latest Visual C++ Redistributable package [here](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) +::: +:::caution Linux `libcomp.so.1` error. +If you encounter an error related to `libgomp.so.1`, install the `libgomp1` library with `sudo apt-get install libgomp1`. ::: \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index 0f2b3c74cde..6ddc43b03a7 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -70,8 +70,7 @@ const config = { { to: '/farming/space-acres/translate', from: ['/docs/farming-&-staking/farming/space-acres/translate_space_acres'] }, { to: '/farming/advanced-cli/install', from: ['/docs/farming-&-staking/farming/advanced-cli/cli-install', '/docs/protocol/cli/', '/docs/protocol/substrate-cli/', '/docs/Farming%20&%20Staking/Farming/Advanced-Cli/cli-install', '/docs/category/advanced-cli-recommended', '/docs/category/advanced-cli', '/docs/farming-&-staking/farming/advanced-cli/cli-install'] }, { to: '/farming/advanced-cli/cluster', from: ['/docs/farming-&-staking/farming/advanced-cli/cli-farming-cluster'] }, - { to: '/farming/advanced-cli/tips', from: ['/docs/farming-&-staking/farming/advanced-cli/cli-tips'] }, - { to: '/farming/advanced-cli/troubleshooting', from: ['/docs/farming-&-staking/farming/advanced-cli/cli-troubleshooting'] }, + { to: '/farming/advanced-cli/tips', from: ['/docs/farming-&-staking/farming/advanced-cli/cli-tips', '/docs/farming-&-staking/farming/advanced-cli/cli-troubleshooting'] }, { to: '/farming/common-problems', from: ['/docs/farming-&-staking/farming/common_problems'] }, { to: '/farming/guides/gpu-plotter', from: ['/docs/farming-&-staking/farming/additional-guides/gpu-plotter'] }, { to: '/farming/guides/port-config', from: ['/docs/farming-&-staking/farming/additional-guides/port-config'] }, diff --git a/src/theme/DocButton/index.js b/src/theme/DocButton/index.js new file mode 100644 index 00000000000..828b5a0a037 --- /dev/null +++ b/src/theme/DocButton/index.js @@ -0,0 +1,46 @@ +import React, { CSSProperties } from 'react'; +import clsx from 'clsx'; +import Link from '@docusaurus/Link'; + +// Build the Button component with the specified props +const Button = ({ + size = null, // The size of the button (e.g., 'sm', 'lg', or null) + outline = false, // Whether the button should be an outline button + variant = 'primary', // The color variant of the button + block = false, // Whether the button should be a block-level button + disabled = false, // Whether the button should be disabled + className, // Custom classes for the button + style, // Custom styles for the button + link, // The URL the button should link to + label // The text of the button +}) => { + const sizeMap = { + sm: 'sm', + small: 'sm', + lg: 'lg', + large: 'lg', + medium: null, + }; + const buttonSize = size ? sizeMap[size] : ''; + const sizeClass = buttonSize ? `button--${buttonSize}` : ''; + const outlineClass = outline ? 'button--outline' : ''; + const variantClass = variant ? `button--${variant}` : ''; + const blockClass = block ? 'button--block' : ''; + const disabledClass = disabled ? 'disabled' : ''; + // If the button is disabled, set the destination to null. + const destination = disabled ? null : link; + return ( + + + + ); +}; + +export default Button; \ No newline at end of file diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js new file mode 100644 index 00000000000..2b25ae0c373 --- /dev/null +++ b/src/theme/MDXComponents.js @@ -0,0 +1,9 @@ +import React from 'react'; +// Importing the original mapper + our components according to the Docusaurus doc +import MDXComponents from '@theme-original/MDXComponents'; +import Button from '@site/src/theme/DocButton'; +export default { + // Reusing the default mapping + ...MDXComponents, + Button, +}; \ No newline at end of file From e8698434b2ca493541abb792f4871b875b50e459 Mon Sep 17 00:00:00 2001 From: vexr Date: Fri, 11 Oct 2024 20:36:14 -0700 Subject: [PATCH 2/5] Update to new cpu paramaters --- .../farming/advanced-cli/cli-tips.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx index b41edee6c49..84dcd7b14c9 100644 --- a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx +++ b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx @@ -226,12 +226,12 @@ Increasing the values of the farmer parameters may enhance plotting speed by acc Plotting performance has been improved with increased internal concurrency. During plotting, table generation involves both parallel and sequential phases. By generating multiple tables at once, we overlap sequential tasks with parallel ones, improving CPU utilization. Although generating tables for all records demands significant RAM, processing fewer records at a time helps balance CPU and RAM usage. -The `--record-encoding-concurrency` option allows you to fine-tune this balance. By default, it allocates one record for every two cores, up to eight in parallel. If RAM usage becomes too high or you prefer the previous method, you can adjust this setting. +The `--cpu-record-encoding-concurrency` option allows you to fine-tune this balance. By default, it allocates one record for every two cores, up to eight in parallel. If RAM usage becomes too high or you prefer the previous method, you can adjust this setting. Example usage: ```bash ---record-encoding-concurrency 4 +--cpu-record-encoding-concurrency 4 ``` You can experiment to optimize performance based on your system's CPU and RAM. @@ -254,19 +254,19 @@ Ensure you replace `/path/to/plot` with the actual path to your plot. Use this c
Specify CPU Cores -This option allows you to override any custom logic that subspace-farmer uses for CPU core allocation. You can specify the plotting CPU cores by adding `--plotting-cpu-cores`, followed by the desired core parameters. Cores should be listed as comma-separated values, using whitespace to separate different thread pools or encoding instances. +This option allows you to override any custom logic that subspace-farmer uses for CPU core allocation. You can specify the plotting CPU cores by adding `--cpu-plotting-cores`, followed by the desired core parameters. Cores should be listed as comma-separated values, using whitespace to separate different thread pools or encoding instances. For example, the command: ```bash ---plotting-cpu-cores 0,1 2,3 +--cpu-plotting-cores 0,1 2,3 ``` will result in two sectors being encoded simultaneously, with each sector using a pair of CPU cores. -You can similarly customize the replotting CPU cores with the `--replotting-cpu-cores` option, using arguments that follow the same format as `--plotting-cpu-cores`. +You can similarly customize the replotting CPU cores with the `--cpu-replotting-cores` option, using arguments that follow the same format as `--cpu-plotting-cores`. -It is important to note that if you set `--plotting-cpu-cores`, you must configure `--replotting-cpu-cores` with the same number of CPU core groups. If you omit the `--replotting-cpu-cores` setting, the node will default to using the same thread pool as for plotting. +It is important to note that if you set `--cpu-plotting-cores`, you must configure `--cpu-replotting-cores` with the same number of CPU core groups. If you omit the `--cpu-replotting-cores` setting, the node will default to using the same thread pool as for plotting.
From 884952fe1725ddd1e9434004c4a214e2c974541c Mon Sep 17 00:00:00 2001 From: vexr Date: Fri, 11 Oct 2024 21:34:01 -0700 Subject: [PATCH 3/5] Minor button styling --- docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx index 84dcd7b14c9..25c901f375f 100644 --- a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx +++ b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx @@ -30,7 +30,7 @@ Explore the Autonomys Network in detail with our telemetry tool and various bloc
-

Get real-time insights into network activity and performance metrics. Ideal for monitoring the overall health and status of the Autonomys Network. @@ -41,7 +41,7 @@ Explore the Autonomys Network in detail with our telemetry tool and various bloc

-

Our primary tool for viewing blocks, transactions, and network activity on the Autonomys Network. This explorer offers an intuitive interface and detailed information. @@ -50,7 +50,7 @@ Explore the Autonomys Network in detail with our telemetry tool and various bloc

-

An alternative block explorer providing detailed views of blocks, transactions, and network events. Subscan is known for its user-friendly interface and additional data analytics features. @@ -59,7 +59,7 @@ Explore the Autonomys Network in detail with our telemetry tool and various bloc

-

For users familiar with the Polkadot ecosystem, this explorer offers a seamless experience for exploring the Autonomys Network using the Polkadot.js interface. From 3e30715c3eb51ea6fb23f01326fefe13a3eb658e Mon Sep 17 00:00:00 2001 From: vexr Date: Sun, 13 Oct 2024 00:22:08 -0700 Subject: [PATCH 4/5] Move button component to src/components --- docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx | 2 +- src/{theme/DocButton => components/Button}/index.js | 0 src/theme/MDXComponents.js | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{theme/DocButton => components/Button}/index.js (100%) diff --git a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx index 25c901f375f..436fed95325 100644 --- a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx +++ b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx @@ -15,7 +15,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import Link from '@docusaurus/Link'; import MDXComponents from '@theme-original/MDXComponents'; -import Button from '@site/src/theme/DocButton'; +import Button from '@site/src/components/Button'; Whether you are an experienced farmer or new to the Autonomys Network, this section offers valuable insights to improve your experience and efficiency. We explore practical advice and hidden techniques that will help you optimize your farming setup and tackle common challenges effortlessly. diff --git a/src/theme/DocButton/index.js b/src/components/Button/index.js similarity index 100% rename from src/theme/DocButton/index.js rename to src/components/Button/index.js diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js index 2b25ae0c373..21a0a70ba1a 100644 --- a/src/theme/MDXComponents.js +++ b/src/theme/MDXComponents.js @@ -1,7 +1,7 @@ import React from 'react'; // Importing the original mapper + our components according to the Docusaurus doc import MDXComponents from '@theme-original/MDXComponents'; -import Button from '@site/src/theme/DocButton'; +import Button from '@site/src/components/Button'; export default { // Reusing the default mapping ...MDXComponents, From 5b36a5b209541ab619e6f6328cac47ca3b2bea66 Mon Sep 17 00:00:00 2001 From: vexr Date: Thu, 17 Oct 2024 14:21:14 -0700 Subject: [PATCH 5/5] Update Snap Sync description --- docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx index 436fed95325..70b2dbb6297 100644 --- a/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx +++ b/docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx @@ -108,6 +108,8 @@ The default parameters are configured with common consumer modem and router capa

Snap Sync +Snap Sync works by jumping to near the end of the chain, allowing you to sync with the current block more quickly. Once the initial jump is complete, it functions like a full sync. In fact, if you haven't synced for more than a few days, it might be faster to remove the node database and let Snap Sync quickly sync to the most recent block. + A full sync is required for situations where you need an archival node, such as running an operator or when running an RPC node for public use or indexing. Archival nodes store the entire blockchain, unlike pruned nodes that only store recent data. To perform a full sync and disable Snap Sync, use the following command: ```bash