Skip to content

Commit

Permalink
prettier (#37)
Browse files Browse the repository at this point in the history
* prettier

* fix prettier

* fix prettier/

* change vale to suggestion

* add spellcheck

* add spellcheck yml

* fixes

* fixes

* fix

* change spell check

* add other ci as well

* spell fixes

* prettier
  • Loading branch information
apoorvsadana authored Oct 7, 2024
1 parent 725de72 commit 88f8f31
Show file tree
Hide file tree
Showing 56 changed files with 3,004 additions and 1,140 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: actions/checkout@v3
- name: Run prettier
run: |-
npx prettier --check .
npx prettier --check .
6 changes: 5 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ jobs:

vale:
name: Run vale
uses: ./.github/workflows/vale.yml
uses: ./.github/workflows/vale.yml

spellcheck:
name: Run spellcheck
uses: ./.github/workflows/spellcheck.yml
16 changes: 16 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Spell Check

on:
workflow_dispatch:
workflow_call:

jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install cspell
run: npm install -g cspell
- name: Run spell check
run: cspell "**/*.mdx"
2 changes: 1 addition & 1 deletion .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: errata-ai/vale-action@reviewdog
- uses: errata-ai/vale-action@reviewdog
19 changes: 19 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
StylesPath = vale/writing-styles
MinAlertLevel = suggestion

[formats]
mdx = md

# Ignore code on basis of certain HTML tags.
IgnoredClasses= whitesapce-pre, prose-code
SkippedScopes = script, style, pre, figure, code, tt, tr, td, span

# Settings applied to md/mdx format.
[*.md]

# List of styles to load
BasedOnStyles = madara-docs

# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs and so on.
BlockIgnores = (?s) <Terminal(\s|\n)[^/>]*?property
TokenIgnores = (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[), .github, .gitlab, vscode-, Signing & Capabilities, eas.json, eas-json, .yarn+, yarn: "# yarn", eas+, eas-cli, npx+, Build & deploy, OAuth & Permissions, Languages & Frameworks, typescript, Privacy & Security, Certificates, IDs & Profiles, application/javascript, Motion & Orientation Access, Show devices and ask me again, my-app, Still having trouble?, "my app runs well locally by crashes immediately when I run a build", my-app, MY_CUSTOM_API_KEY, withMyApiKey, My App, com.my., myFunction, my app, my-plugin, my-module, 'Hello from my TypeScript function!', my-scheme, my-root, Change my environment variables, my custom plugin, my, cocoapods, javascript, Ink & Switch,
29 changes: 14 additions & 15 deletions components/LightorDarkImage.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import Image from 'next/image'
import { useTheme } from 'next-themes'
import Image from "next/image";
import { useTheme } from "next-themes";

const LightorDarkImage = ({ lightModeSrc, darkModeSrc, alt, width = 800, height = 600 }) => {
const { theme } = useTheme()
const LightorDarkImage = ({
lightModeSrc,
darkModeSrc,
alt,
width = 800,
height = 600,
}) => {
const { theme } = useTheme();

const imageSrc = theme === 'dark' ? darkModeSrc : lightModeSrc
const imageSrc = theme === "dark" ? darkModeSrc : lightModeSrc;

return (
<Image
src={imageSrc}
alt={alt}
width={width}
height={height}
/>
)
}
return <Image src={imageSrc} alt={alt} width={width} height={height} />;
};

export default LightorDarkImage
export default LightorDarkImage;
20 changes: 20 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "0.2",
"language": "en",
"words": [],
"flagWords": [],
"ignorePaths": [],
"dictionaryDefinitions": [
{
"name": "starknet",
"path": "./dictionary/starknet.txt",
"addWords": true
},
{
"name": "technical",
"path": "./dictionary/technical.txt",
"addWords": true
}
],
"dictionaries": ["starknet", "technical"]
}
15 changes: 15 additions & 0 deletions dictionary/starknet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
starknet
madara
scarb
keccak
devnet
pedersen
deoxys
starkware
chainstack
appchains
snos
bootstrapper
kakarot
merkle
starknodes
10 changes: 10 additions & 0 deletions dictionary/technical.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
nextra
rustc
moralis
pkill
predeployed
nextra
lsync
SLES
sonoma
rustup
2 changes: 1 addition & 1 deletion middleware.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { locales as middleware } from 'nextra/locales'
export { locales as middleware } from "nextra/locales";
18 changes: 9 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
})
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});

module.exports = withNextra({
i18n: {
locales: ['en', 'zh-CN'],
defaultLocale: 'en'
}
})
i18n: {
locales: ["en", "zh-CN"],
defaultLocale: "en",
},
});
2 changes: 1 addition & 1 deletion pages/_meta.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"tutorials-devnet": {
"title": "Devnet"
},

"+++ ABOUT": {
"title": "",
"type": "separator"
Expand Down
17 changes: 14 additions & 3 deletions pages/chain-configuration/overview.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ lang: en-US
description: Learn how to install and configure your Madara client as a node operator.
---

import { Cards, Card } from 'nextra/components'
import { Server, Settings, Network, Plug, Wrench, Rocket, MonitorCog, HardDrive, FlaskConical, Globe, Activity } from 'lucide-react';
import { Cards, Card } from "nextra/components";
import {
Server,
Settings,
Network,
Plug,
Wrench,
Rocket,
MonitorCog,
HardDrive,
FlaskConical,
Globe,
Activity,
} from "lucide-react";
import { Callout } from "nextra-theme-docs";

# Chain Operator Configurations

91 changes: 36 additions & 55 deletions pages/chain-configuration/parameters.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can define these parameters via a chain configuration file, which can be spe

**Note**: In Full Mode, the `--network` flag defines the associated preset by default.

For exemple here we are using Starknet mainnet chain configuration and overriding the Sequencer address:
For example here we are using Starknet mainnet chain configuration and overriding the Sequencer address:

```bash
cargo run --release -- \
Expand All @@ -55,29 +55,24 @@ Below are the chain configuration parameters organized by namespace. Click on ea
<summary className="nd-details-heading">&nbsp;**Chain**</summary>
<p>

<br />
- **`chain_name`**: Human-readable name of the chain for display purposes.
- *Example*: `"Starknet Mainnet"`
<br />- **`chain_name`**: Human-readable name of the chain for display purposes.
- *Example*: `"Starknet Mainnet"`

<br />
- **`chain_id`**: Identifier of the chain.
- *Example*: `"SN_MAIN"`
<br />- **`chain_id`**: Identifier of the chain. - *Example*: `"SN_MAIN"`

<br />
- **`native_fee_token_address`**: The address of the native fee token contract on Starknet.
- *Example*: `"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"`
<br />- **`native_fee_token_address`**: The address of the native fee token
contract on Starknet. - *Example*:
`"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"`

<br />
- **`parent_fee_token_address`**: The address of the parent chain's fee token contract on Starknet.
- *Example*: `"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"`
<br />- **`parent_fee_token_address`**: The address of the parent chain's fee
token contract on Starknet. - *Example*:
`"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"`

<br />
- **`latest_protocol_version`**: The most recent Starknet protocol version supported.
- *Example*: `"0.13.2"`
<br />- **`latest_protocol_version`**: The most recent Starknet protocol version
supported. - *Example*: `"0.13.2"`

<br />
- **`eth_core_contract_address`**: The Starknet core contract address for the L1 watcher.
- *Example*: `"0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"`
<br />- **`eth_core_contract_address`**: The Starknet core contract address for
the L1 watcher. - *Example*: `"0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"`

</p>
</details>
Expand All @@ -86,20 +81,15 @@ Below are the chain configuration parameters organized by namespace. Click on ea
<summary className="nd-details-heading">&nbsp;**Block Production**</summary>
<p>

<br />
- **`block_time`**: Target time interval between blocks.
- *Example*: `"30s"`
- *Note*: Only used for block production.
<br />- **`block_time`**: Target time interval between blocks. - *Example*:
`"30s"` - *Note*: Only used for block production.

<br />
- **`pending_block_update_time`**: Duration after which the pending block is updated.
- *Example*: `"2s"`
- *Note*: Only used for block production.
<br />- **`pending_block_update_time`**: Duration after which the pending block
is updated. - *Example*: `"2s"` - *Note*: Only used for block production.

<br />
- **`execution_batch_size`**: Number of transactions popped from the mempool per batch.
- *Example*: `16`
- *Note*: Useful for optimistic parallelization. A value too high may impact performance.
<br />- **`execution_batch_size`**: Number of transactions popped from the
mempool per batch. - *Example*: `16` - *Note*: Useful for optimistic
parallelization. A value too high may impact performance.

</p>
</details>
Expand All @@ -108,20 +98,14 @@ Below are the chain configuration parameters organized by namespace. Click on ea
<summary className="nd-details-heading">&nbsp;**Bouncer Configuration**</summary>
<p>

<br />
- **`bouncer_config`**: Configuration to limit block sizes.
- **`block_max_capacity`**: Maximum capacities per block.
- **`builtin_count`**: Maximum counts for built-in functions.
- **`add_mod`**: `18446744073709551615`
- **`bitwise`**: `18446744073709551615`
- **`ecdsa`**: `18446744073709551615`
- **`ec_op`**: `18446744073709551615`
- **`keccak`**: `18446744073709551615`
- **`mul_mod`**: `18446744073709551615`
- **`pedersen`**: `18446744073709551615`
- **`poseidon`**: `18446744073709551615`
- **`range_check`**: `18446744073709551615`
- **`range_check96`**: `18446744073709551615`
<br />- **`bouncer_config`**: Configuration to limit block sizes. -
**`block_max_capacity`**: Maximum capacities per block. - **`builtin_count`**:
Maximum counts for built-in functions. - **`add_mod`**: `18446744073709551615` -
**`bitwise`**: `18446744073709551615` - **`ecdsa`**: `18446744073709551615` -
**`ec_op`**: `18446744073709551615` - **`keccak`**: `18446744073709551615` -
**`mul_mod`**: `18446744073709551615` - **`pedersen`**: `18446744073709551615` -
**`poseidon`**: `18446744073709551615` - **`range_check`**:
`18446744073709551615` - **`range_check96`**: `18446744073709551615`

- **`gas`**: Maximum gas limit per block.
- *Example*: `5000000`
Expand All @@ -145,15 +129,12 @@ Below are the chain configuration parameters organized by namespace. Click on ea
<summary className="nd-details-heading">&nbsp;**Sequencer Settings**</summary>
<p>

<br />
- **`sequencer_address`**: Address of the sequencer (`0x0` for a full node).
- *Example*: `"0x0"`
- *Note*: Only used for block production.
<br />- **`sequencer_address`**: Address of the sequencer (`0x0` for a full
node). - *Example*: `"0x0"` - *Note*: Only used for block production.

<br />
- **`max_nonce_for_validation_skip`**: Maximum nonce for which the validation step can be skipped when deploying an account and invoking a contract at the same time.
- *Example*: `2`
- *Note*: Only used for block production.
<br />- **`max_nonce_for_validation_skip`**: Maximum nonce for which the
validation step can be skipped when deploying an account and invoking a contract
at the same time. - *Example*: `2` - *Note*: Only used for block production.

</p>
</details>
Expand All @@ -171,7 +152,7 @@ The default presets are:

### Predefined Presets

Here are some preset exemple, which are defined in [Madara Config Presets](https://github.com/madara-alliance/madara/tree/main/configs/presets) folder:
Here are some preset example, which are defined in [Madara Config Presets](https://github.com/madara-alliance/madara/tree/main/configs/presets) folder:

{/* prettier-ignore */}
<Tabs items={['Mainnet', 'Sepolia', 'Devnet', 'Integration',]}>
Expand Down Expand Up @@ -341,4 +322,4 @@ This is particularly useful when you want to make quick adjustments without modi

---

Now that you understand how to use these parameters, you can effectively customize your node to suit your specific network requirements.
Now that you understand how to use these parameters, you can effectively customize your node to suit your specific network requirements.
Loading

0 comments on commit 88f8f31

Please sign in to comment.