Skip to content

Commit b239758

Browse files
committed
docs: revamp config reference
Signed-off-by: qua <quacumque@fastmail.jp>
1 parent aae25ba commit b239758

16 files changed

+768
-682
lines changed

.vitepress/config.mts

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
8989
text: 'JavaScript',
9090
link: '/guide/tutorials/javascript',
9191
},
92+
{
93+
text: 'Compatibility Matrix',
94+
link: '/reference/compatibility-matrix',
95+
},
9296
],
9397
},
9498
{
@@ -303,10 +307,10 @@ function sidebarChain(): DefaultTheme.SidebarItem[] {
303307
]
304308
}
305309

306-
function sidebarAPI(): DefaultTheme.SidebarItem[] {
310+
function sidebarReference(): DefaultTheme.SidebarItem[] {
307311
return [
308312
{
309-
text: 'About',
313+
text: 'Reference',
310314
items: [
311315
{
312316
text: 'Glossary',
@@ -316,23 +320,6 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
316320
text: 'Naming Conventions',
317321
link: '/reference/naming.md',
318322
},
319-
{
320-
text: 'Compatibility Matrix',
321-
link: '/reference/compatibility-matrix',
322-
},
323-
{
324-
text: 'Foreign Function Interfaces',
325-
link: '/reference/ffi',
326-
},
327-
],
328-
},
329-
{
330-
text: 'Reference',
331-
items: [
332-
{
333-
text: 'Torii Endpoints',
334-
link: '/reference/torii-endpoints.md',
335-
},
336323
{
337324
text: 'Data Model Schema',
338325
link: '/reference/data-model-schema',
@@ -349,6 +336,34 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
349336
text: 'Permissions',
350337
link: '/reference/permissions.md',
351338
},
339+
{
340+
text: 'CLI',
341+
},
342+
{
343+
text: 'Torii HTTP API',
344+
link: '/reference/torii-endpoints.md',
345+
},
346+
{
347+
text: 'Foreign Function Interfaces',
348+
link: '/reference/ffi',
349+
},
350+
],
351+
},
352+
{
353+
text: 'Configuration',
354+
items: [
355+
{ text: 'Overview' },
356+
{
357+
text: 'Peer Configuration',
358+
link: '/reference/config/index.md',
359+
items: [
360+
{ text: 'Parameters', link: '/reference/config/params.md' },
361+
// Consider removal
362+
{ text: 'Migration from pre-rc.20', link: '/reference/config/migration.md' },
363+
],
364+
},
365+
{ text: 'Genesis Block' },
366+
{ text: 'On-Chain Configuration' },
352367
],
353368
},
354369
]

.vitepress/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './style/index.scss'
1010
import { defineAsyncComponent } from 'vue'
1111

1212
export default {
13-
...ThemeDefault,
13+
extends: ThemeDefault,
1414
Layout: LayoutCustom,
1515
enhanceApp({ app }: EnhanceAppContext) {
1616
app.component('MermaidRenderWrap', MermaidRenderWrap)

src/reference/config/base-params.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/reference/config/chain-wide-params.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/reference/config/genesis-params.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/reference/config/index.md

Lines changed: 6 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,8 @@
11
# Configuring Iroha
22

3-
Iroha is configured via a [TOML](https://toml.io/) file and/or Environment
4-
Variables.
5-
6-
The path to the configuration file should be passed through the
7-
[`--config` CLI argument](/reference/cli#arg-config):
8-
9-
```shell
10-
iroha --config iroha_config.toml
11-
```
12-
13-
If the peer submits the genesis:
14-
15-
```shell
16-
# `iroha_config.toml` should contain `genesis.file` and `genesis.private_key`
17-
iroha --config iroha_config.toml --submit-genesis
18-
```
19-
20-
## Structure
21-
22-
- List links to all modules, giving high-level overview of them
23-
- List required parameters
24-
25-
| Module Name | Description | Required fields |
26-
| ------------------------------- | ---------------------------- | ------------------------------------------------------------------------- |
27-
| [Base](base-params) | Basic, root-level parameters | `chain_id`, `public_key`, `private_key` |
28-
| [Genesis](genesis-params) | Genesis block configuration | `genesis.public_key`, and possibly `genesis.file` & `genesis.private_key` |
29-
| [Network](network-params) | ? | `network.address` |
30-
| [Torii](torii-params) | ? | `torii.address` |
31-
| [Sumeragi](sumeragi-params) | ? | `sumeragi.trusted_peers` if doesn't submit the genesis |
32-
| [Kura](kura-params) | ? | |
33-
| [Queue](queue-params) | ? | |
34-
| [Snapshot](snapshot-params) | ? | |
35-
| [Logger](logger-params) | ? | |
36-
| [Telemetry](telemetry-params) | ? | |
37-
| [Chain Wide](chain-wide-params) | ? | |
38-
39-
## Example Configuration
40-
41-
- Show minimal TOML
42-
- Show same minimal ENVs
43-
- Refer to `peer.template.toml` in the repo, or show it here under the
44-
spoiler.
45-
46-
## Extends feature
47-
48-
- You can compose configuration files together using the `extends`
49-
root-level field
50-
51-
---
52-
53-
## Required Parameters
54-
55-
- [`public_key`](base-params#param-public-key): _explain the option_
56-
- [`private_key`](base-params#param-private-key): _explain the option_
57-
- [`network.address`](network-params#param-address): _explain the option_
58-
- [`genesis.public_key`](genesis-params#param-public-key): _explain the
59-
option_
60-
- [`genesis.private_key`](genesis-params#param-private-key) if the peer
61-
is the one who submits the genesis. _explain the option_
62-
- [`sumeragi.trusted_peers`](sumeragi-params#param-trusted-peers):
63-
_explain the option_. It is not _strictly_ required, but you might need
64-
to set it in most cases.
65-
- [`torii.address`](torii-params#param-address): _explain the option_
66-
67-
## Modules Overview
68-
69-
TODO: list each section (sumeragi, torii, kura etc) with links and short
70-
explanations of their responsibility.
71-
72-
- **[Base Options](base-params):** _explain_
73-
- **[Genesis](genesis-params):** _explain_
74-
- **[Sumeragi](sumeragi-params):** _explain_
75-
- **[Torii](torii-params):** _explain_
76-
- **[Queue](queue-params):** _explain_
77-
- **[Kura](kura-params):** _explain_
78-
- **[Logger](logger-params):** _explain_
79-
- **[Telemetry](telemetry-params):** _explain_
80-
- **[Snapshot](./snapshot-params)**
3+
- Use `--config` CLI or relevant ENV parameter (?)
4+
- Use `--trace-config` to debug
5+
- Config consists of parameters set via TOML file (some via ENV too)
6+
- There is also chain-wide config, which is different
7+
- Here is the template file
8+
- Here is how to use `extends`

src/reference/config/kura-params.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/reference/config/logger-params.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/reference/config/migration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ were removed.
2828
| ----------------------------------: | ---------------------------------------------------------------------------------------------------------------- |
2929
| `IROHA2_CONFIG_PATH` | removed, use [`--config`](../cli#arg-config) instead |
3030
| `IROHA2_GENESIS_PATH` | [`GENESIS_FILE`](genesis-params#param-file) |
31-
| `IROHA2_GENESIS_PATH` | [`GENESIS_FILE`](genesis-params#param-file) |
3231
| `IROHA_PUBLIC_KEY` | [`PUBLIC_KEY`](base-params#param-public-key) |
3332
| `IROHA_PRIVATE_KEY` | split into [`PRIVATE_KEY_ALGORITHM` and `PRIVATE_KEY_PAYLOAD`](base-params#param-private-key) |
3433
| `TORII_P2P_ADDR` | [`P2P_ADDRESS`](network-params#param-address) |

0 commit comments

Comments
 (0)