Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tips & Tricks refresh #685

Merged
merged 6 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
462 changes: 330 additions & 132 deletions docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx

Large diffs are not rendered by default.

This file was deleted.

10 changes: 6 additions & 4 deletions docs/farming-&-staking/farming/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,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.

:::

Expand Down Expand Up @@ -167,8 +167,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`.
:::
3 changes: 1 addition & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'] },
Expand Down
46 changes: 46 additions & 0 deletions src/components/Button/index.js
Original file line number Diff line number Diff line change
@@ -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 (
<Link to={destination}>
<button
className={clsx('button', sizeClass, outlineClass, variantClass, blockClass, disabledClass, className)}
style={style}
role="button"
aria-disabled={disabled}
>
{label}
</button>
</Link>
);
};

export default Button;
9 changes: 9 additions & 0 deletions src/theme/MDXComponents.js
Original file line number Diff line number Diff line change
@@ -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/components/Button';
export default {
// Reusing the default mapping
...MDXComponents,
Button,
};
Loading