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

[docs]: add configuration reference #397

Open
wants to merge 83 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
15d9ea4
[misc]: update deps
0x009922 Aug 30, 2023
6b17267
[style]: remove brand colors and `SButton`; revert prettier
0x009922 Aug 30, 2023
d13775b
[refactor]: use headless dialog; revert plugin-pwa
0x009922 Sep 1, 2023
793959a
[chore]: disable `vue/no-v-html` in Mermaid
0x009922 Sep 1, 2023
122f05f
[refactor]: remove sora components from MermaidRender
0x009922 Sep 1, 2023
c472637
[chore]: format
0x009922 Sep 1, 2023
6bd761d
[chore]: remove `@soramitsu-ui/*` packages
0x009922 Sep 1, 2023
15f8e10
[refactor]: remove `vite-plugin-pwa`
0x009922 Sep 1, 2023
6d39164
[docs]: introduce "Reference" section
0x009922 Sep 8, 2023
6a9e6dd
[chore]: remove logo temporarily
0x009922 Sep 8, 2023
1d091a7
Merge branch 'service-update' into 392-draft-config-reference
0x009922 Sep 8, 2023
29736bd
[chore]: fix ffi link
0x009922 Sep 8, 2023
c88c48e
[chore]: update deps
0x009922 Sep 11, 2023
17fc897
[refactor]: simplify logging, remove `log-update`
0x009922 Sep 11, 2023
e123ac0
Merge branch 'service-update' into 392-draft-config-reference
0x009922 Sep 11, 2023
f6bb470
[docs]: change headings
0x009922 Sep 11, 2023
e2ecaa7
[docs]: format chores
0x009922 Sep 11, 2023
6786935
Merge remote-tracking branch 'hyperledger/main' into service-update
0x009922 Sep 15, 2023
ce9bf11
[chore]: update pnpm
0x009922 Sep 15, 2023
5828496
[fix]: remove `SSpinner` import
0x009922 Sep 15, 2023
134a275
[chore]: bump vitepress
0x009922 Sep 15, 2023
de585ca
[fix]: fix version of unocss
0x009922 Sep 15, 2023
4bafdab
[chore]: fix format
0x009922 Sep 15, 2023
cd0cede
[chore]: bump vitepress to `rc.14`
0x009922 Sep 18, 2023
1fe2a67
Merge branch 'service-update' into 392-draft-config-reference
0x009922 Sep 18, 2023
cbe8885
[docs]: use tex math syntax across
0x009922 Sep 18, 2023
13fe5ce
[docs]: move `/reference/` to `/api/`; split config reference
0x009922 Sep 18, 2023
5e2265a
[docs]: describe duration type
0x009922 Sep 18, 2023
eff21b2
[docs]: describe byte size type
0x009922 Sep 18, 2023
18b614b
[docs]: remove `*.actor-channel-capacity`
0x009922 Sep 18, 2023
32008ad
[fix]: dead links
0x009922 Sep 18, 2023
2adbbf9
[docs]: restore `snake_case`
0x009922 Sep 20, 2023
cfabb36
[docs]: update config reference
0x009922 Sep 21, 2023
6d88337
Merge branch 'main' into 392-draft-config-reference
0x009922 Sep 21, 2023
c9e4fcf
[chore]: remove dead code
0x009922 Sep 21, 2023
07fd463
Apply suggestions from code review
0x009922 Sep 22, 2023
60edf4e
Apply suggestions from code review
yamkovoy Sep 26, 2023
a0bc81f
[docs]: use TODO marks
0x009922 Sep 27, 2023
b1c7ef8
[docs]: add Snapshot section
0x009922 Sep 27, 2023
12a026d
Merge remote-tracking branch '0x009922/392-draft-config-reference' in…
0x009922 Sep 27, 2023
2db62aa
[chore]: fix format
0x009922 Sep 27, 2023
08532e0
[docs]: change TODO notation
0x009922 Sep 27, 2023
bb938ef
Merge branch 'main' into 392-draft-config-reference
0x009922 Sep 27, 2023
35a0974
Apply suggestions from code review
0x009922 Sep 29, 2023
5b3dd60
Merge branch 'main' into 392-draft-config-reference
0x009922 Sep 29, 2023
0efcf1c
[docs]: put TODOs
0x009922 Sep 29, 2023
ea286e6
Merge remote-tracking branch '0x009922/392-draft-config-reference' in…
0x009922 Sep 29, 2023
9dd1a49
[chore]: remove dead sidebar link
0x009922 Sep 29, 2023
76b850c
[docs]: expand logger params
0x009922 Sep 29, 2023
38dd466
[docs]: expand sections, update naming, rethink structure
0x009922 Sep 29, 2023
6688e80
Apply suggestions from code review
0x009922 Oct 2, 2023
d5d1156
[docs]: refactor the reference
0x009922 Oct 4, 2023
e9aa302
[chore]: fix typo and format
0x009922 Oct 4, 2023
fc9bd81
[docs]: combine sumeragi and block_sync
0x009922 Oct 4, 2023
2750023
Merge branch 'main' into 392-draft-config-reference
0x009922 Oct 10, 2023
df7415b
[docs]: torii bindings
0x009922 Oct 10, 2023
bde027d
Apply suggestions from code review
0x009922 Oct 20, 2023
b86a04c
Update src/api/config/sumeragi-params.md
0x009922 Oct 23, 2023
5e5582a
bunch of updates
0x009922 Nov 3, 2023
b9177e7
Merge remote-tracking branch 'hyperledger/main' into 392-draft-config…
0x009922 Nov 3, 2023
0d949c6
Merge remote-tracking branch '0x009922/392-draft-config-reference' in…
0x009922 Nov 3, 2023
f74845e
[docs]: fix broken link
0x009922 Nov 3, 2023
99698dd
[docs]: a bunch of edits of config
0x009922 Nov 22, 2023
7d9c926
[docs]: update configuration guides (wip)
0x009922 Nov 22, 2023
128e675
Merge branch 'main' into 392-draft-config-reference
0x009922 Nov 22, 2023
2be984d
Merge branch 'main' into 392-draft-config-reference
0x009922 Feb 12, 2024
4c78fe2
[chore]: update deps
0x009922 Feb 12, 2024
8841a0b
[chore]: `type: module`, fixing warning from Vitest
0x009922 Feb 12, 2024
3d26c72
[revert]: project is not ready for ESM
0x009922 Feb 12, 2024
c704b6f
Merge branch 'housekeeping' into 392-draft-config-reference
0x009922 Feb 12, 2024
a96fa91
[docs]: update reference section
0x009922 Feb 21, 2024
b21c68e
[docs]: migration guide; edits
0x009922 Mar 25, 2024
cfe5ae4
[revert]: remove `Specs` component
0x009922 Mar 25, 2024
dfd5498
[feat]: add sidebar link
0x009922 Mar 25, 2024
ca2f813
[chore]: fix format
0x009922 Mar 25, 2024
eb231f3
misc: update dependencies
Nov 7, 2024
aae25ba
Merge branch 'housekeeping' into 392-draft-config-reference
Nov 7, 2024
9fe82b7
docs: revamp config reference
Nov 8, 2024
1e3b453
Merge branch 'main' into 392-draft-config-reference
0x009922 Nov 8, 2024
39cfe97
docs: fix links
0x009922 Nov 8, 2024
790686a
docs: complete structure of config reference & related docs
0x009922 Nov 13, 2024
1f1c868
docs: chores
0x009922 Nov 13, 2024
a44d9b4
chore: fix format
0x009922 Nov 13, 2024
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
122 changes: 104 additions & 18 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="vite/client" />

import { defineConfig, DefaultTheme } from 'vitepress'
import { DefaultTheme, defineConfig } from 'vitepress'
import footnote from 'markdown-it-footnote'
import { resolve } from 'path'
import ViteSvgLoader from 'vite-svg-loader'
Expand Down Expand Up @@ -265,23 +265,6 @@ function getGuideSidebar(): DefaultTheme.SidebarItem[] {
},
],
},
{
text: 'API',
items: [
{
text: 'Torii Endpoints',
link: '/api/torii-endpoints.md',
},
{
text: 'Foreign Function Interfaces',
link: '/api/ffi',
},
{
text: 'Data Model Schema',
link: '/api/data-model-schema',
},
],
},
{
text: 'Documenting Iroha',
items: [
Expand Down Expand Up @@ -381,9 +364,112 @@ export default defineConfig({

sidebar: {
'/guide/': getGuideSidebar(),
'/api/': [
{
text: 'Overview',
link: '/api/',
},
{
text: 'Configuration',
link: '/api/configuration',
},
{
text: 'Command Line Interface (CLI)',
link: '/api/cli',
},
{
text: 'Torii Endpoints',
link: '/api/torii-endpoints',
},
{
text: 'Foreign Function Interfaces (FFI)',
link: '/api/ffi',
},
{
text: 'Configuration',
items: [
{
text: 'Overview',
link: '/api/config/',
},
{
text: 'Parameters',
items: [
// TODO: consider re-ordering sections to a more intuitive format?
{
text: 'Base',
link: '/api/config/base-params',
},
{
text: 'Genesis',
link: '/api/config/genesis-params',
},
{
text: 'Sumeragi',
link: '/api/config/sumeragi-params',
},
{
text: 'Torii',
link: '/api/config/torii-params',
},
{
text: 'Queue',
link: '/api/config/queue-params',
},
{
text: 'Kura',
link: '/api/config/kura-params',
},
{
text: 'Logger',
link: '/api/config/logger-params',
},
{
text: 'WSV',
link: '/api/config/wsv-params',
},
{
text: 'Telemetry',
link: '/api/config/telemetry-params',
},
{
text: 'Snapshot',
link: '/api/config/snapshot-params',
},
],
},

{
text: 'Glossary',
link: '/api/config/glossary',
},
{
text: 'Deprecation and Migration',
link: '/api/config/deprecation-and-migration',
},
],
},
{
text: 'Data Model Schema',
link: '/api/data-model-schema',
},
],
'/': getGuideSidebar(),
},

nav: [
{
text: 'Guide',
link: '/',
activeMatch: '^/$|^/guide/',
},
{
text: 'API',
link: '/api/',
activeMatch: '^/api/',
},
],

search: {
provider: 'local',
},
Expand Down
19 changes: 19 additions & 0 deletions src/api/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Command Line Interface (CLI)

TODO

## `--config`

Alias: `-c`

Env: `IROHA_CONFIG`

TODO

## `--trace-config`

TODO

## `--submit-genesis`

TODO
35 changes: 35 additions & 0 deletions src/api/config/base-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Base Parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any requirements for the key?

  • Could I introduce a new peer with random keys (given a proper algorithm that generates them and that they have a proper format)?
  • Could I randomly change keys for a peer at some moment, restart it and expect it to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Well, each peer might have any keys you want it to use. I lack understanding of the bigger picture and how keys should be approached in real-world scenarios.
  2. Not sure, don't think so.


## `public_key`

- **Type:** String, [Multi-hash](glossary#type-multi-hash)
- **Required**

Public key of this peer
0x009922 marked this conversation as resolved.
Show resolved Hide resolved

```toml
public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9"
```

## `private_key`

- **Type:** Table, [Private Key](glossary#type-private-key)
- **Required**

Private key of this peer
0x009922 marked this conversation as resolved.
Show resolved Hide resolved

```toml
private_key = { digest = "ed25519", payload = "82886B5A2BB3785F3CA8F8A78F60EA9DB62F939937B1CFA8407316EF07909A8D236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B" }
```


## `address`

- **Type:** String, [Socket-Address](glossary#type-socket-address)
- **Required**

Address for p2p communication for consensus (sumeragi) and block synchronization (block_sync) purposes.

```toml
address = "localhost:1337"
```
3 changes: 3 additions & 0 deletions src/api/config/deprecation-and-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Deprecation and Migration Policy

TODO
45 changes: 45 additions & 0 deletions src/api/config/genesis-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Genesis Parameters

TODO Explain the purpose of this block. Maybe explain both keys in a single section?
0x009922 marked this conversation as resolved.
Show resolved Hide resolved

## `genesis.public_key`

- **Type:** [Multi-hash](glossary#type-multi-hash)
- **Required**

The public key of the genesis account, should be supplied to all peers.

```toml
[genesis]
public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9"
```

## `genesis.private_key`

- **Type:** Table, [Private Key](glossary#type-private-key)
- **Required** if the configured peer submits the genesis block,
**optional** otherwise

The private key of the genesis account, only needed for the peer that
submits the genesis block.

```toml
[genesis]
private_key = { digest = "ed25519", payload = "82886B5A2BB3785F3CA8F8A78F60EA9DB62F939937B1CFA8407316EF07909A8D236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B" }
```

::: info

This parameter is required if the peer being configured submits the
genesis, i.e. if it is run with the [`--submit-genesis`](../cli#submit-genesis)
CLI argument.

:::

::: warning

The warning will be printed if the
0x009922 marked this conversation as resolved.
Show resolved Hide resolved
[`genesis.private_key`](#genesis-private-key) and
[`--submit-genesis`](../cli#submit-genesis) are used without each other.
0x009922 marked this conversation as resolved.
Show resolved Hide resolved

:::
133 changes: 133 additions & 0 deletions src/api/config/glossary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Glossary

This page contains the definitions and brief explanations of data types and topics shared across
multiple configuration parameters.

## Numeric Types

TODO Explain the limitations of different numeric types, like `u8` and `u64`.

## Type: Duration

Duration might be specified in two ways:

- As a Number, which will be considered an amount in milliseconds
- As a String, which will be parsed as a human-readable string

Numeric setting is straightforward:

```toml
value = 1000 # 1000 milliseconds
```

String setting might be more readable:

```toml
value1 = "1sec"
value2 = "1hour 12min 5s"
value3 = "2years 2min 12us"
```

The duration string is a concatenation of time spans. Each time span is an
integer number and a suffix. Supported suffixes:

- `nsec`, `ns` &mdash; nanoseconds
- `usec`, `us` &mdash; microseconds
- `msec`, `ms` &mdash; milliseconds
- `seconds`, `second`, `sec`, `s`
- `minutes`, `minute`, `min`, `m`
- `hours`, `hour`, `hr`, `h`
- `days`, `day`, `d`
- `weeks`, `week`, `w`
- `months`, `month`, `M` &mdash; defined as $30.44$ days
- `years`, `year`, `y` &mdash; defined as $365.25$ days

TODO: put link to
[`humantime` crate](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html)?
It is an implementation detail.

## Type: Multi-hash

TODO Describe what the hell this is

## Type: Byte Size

Byte size values might be set in two ways:

- As a Number, which will be considered an amount in bytes
- As a String, which will be parsed as a human-readable string

Byte size as a number:

```toml
value = 512 # 512 bytes
```

Byte size as a string:

```toml
# 42 bytes
value1 = "42"
value2 = "42b"
value3 = "42bytes"

# 1 kilobyte = 1000 bytes
value4 = "1KB"

# 1 kilobyte (binary format) = 1024 bytes
value5 = "1KiB"

# Combination of multiple
value412 = "1GB 5MB"
```

Iroha can parse sizes in bytes, kilobytes, megabytes, gigabytes, terabytes,
and petabytes.

The format of suffixes:

- **`{size}iB`:** Binary size
- **`{size}B`:** Decimal size

TODO: haven't found a rust lib for that. There is a Python one
([`humanfriendly`](https://humanfriendly.readthedocs.io/en/latest/api.html?highlight=parse_size#humanfriendly.parse_size))
I used for reference.

TODO: [article explains kb, kB, KiB difference](https://web.archive.org/web/20150324153922/https://pacoup.com/2009/05/26/kb-kb-kib-whats-up-with-that/).
Consider it for the format.

## Type: Private Key

TODO explain private key

```toml
private_key = { digest = "ed25519", payload = "" }
```

## Type: Socket Address

TODO explain socket addresses

```
<host>:<port>
```

```
localhost:8080
127.0.0.1:1337
sample.com:9090
```

In TOML it should be specified as a string:

```toml
address = "localhost:8000"
```

## Type: Metadata Limits

TODO

### Default Metadata Limits

TODO Display the value here
Loading
Loading