Skip to content

Commit

Permalink
docs: revamp config reference
Browse files Browse the repository at this point in the history
Signed-off-by: qua <[email protected]>
  • Loading branch information
qua committed Nov 8, 2024
1 parent aae25ba commit b239758
Show file tree
Hide file tree
Showing 16 changed files with 768 additions and 682 deletions.
53 changes: 34 additions & 19 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
text: 'JavaScript',
link: '/guide/tutorials/javascript',
},
{
text: 'Compatibility Matrix',
link: '/reference/compatibility-matrix',
},
],
},
{
Expand Down Expand Up @@ -303,10 +307,10 @@ function sidebarChain(): DefaultTheme.SidebarItem[] {
]
}

function sidebarAPI(): DefaultTheme.SidebarItem[] {
function sidebarReference(): DefaultTheme.SidebarItem[] {
return [
{
text: 'About',
text: 'Reference',
items: [
{
text: 'Glossary',
Expand All @@ -316,23 +320,6 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
text: 'Naming Conventions',
link: '/reference/naming.md',
},
{
text: 'Compatibility Matrix',
link: '/reference/compatibility-matrix',
},
{
text: 'Foreign Function Interfaces',
link: '/reference/ffi',
},
],
},
{
text: 'Reference',
items: [
{
text: 'Torii Endpoints',
link: '/reference/torii-endpoints.md',
},
{
text: 'Data Model Schema',
link: '/reference/data-model-schema',
Expand All @@ -349,6 +336,34 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
text: 'Permissions',
link: '/reference/permissions.md',
},
{
text: 'CLI',
},
{
text: 'Torii HTTP API',
link: '/reference/torii-endpoints.md',
},
{
text: 'Foreign Function Interfaces',
link: '/reference/ffi',
},
],
},
{
text: 'Configuration',
items: [
{ text: 'Overview' },
{
text: 'Peer Configuration',
link: '/reference/config/index.md',
items: [
{ text: 'Parameters', link: '/reference/config/params.md' },
// Consider removal
{ text: 'Migration from pre-rc.20', link: '/reference/config/migration.md' },
],
},
{ text: 'Genesis Block' },
{ text: 'On-Chain Configuration' },
],
},
]
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import './style/index.scss'
import { defineAsyncComponent } from 'vue'

export default {
...ThemeDefault,
extends: ThemeDefault,
Layout: LayoutCustom,
enhanceApp({ app }: EnhanceAppContext) {
app.component('MermaidRenderWrap', MermaidRenderWrap)
Expand Down
52 changes: 0 additions & 52 deletions src/reference/config/base-params.md

This file was deleted.

5 changes: 0 additions & 5 deletions src/reference/config/chain-wide-params.md

This file was deleted.

48 changes: 0 additions & 48 deletions src/reference/config/genesis-params.md

This file was deleted.

84 changes: 6 additions & 78 deletions src/reference/config/index.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,8 @@
# Configuring Iroha

Iroha is configured via a [TOML](https://toml.io/) file and/or Environment
Variables.

The path to the configuration file should be passed through the
[`--config` CLI argument](/reference/cli#arg-config):

```shell
iroha --config iroha_config.toml
```

If the peer submits the genesis:

```shell
# `iroha_config.toml` should contain `genesis.file` and `genesis.private_key`
iroha --config iroha_config.toml --submit-genesis
```

## Structure

- List links to all modules, giving high-level overview of them
- List required parameters

| Module Name | Description | Required fields |
| ------------------------------- | ---------------------------- | ------------------------------------------------------------------------- |
| [Base](base-params) | Basic, root-level parameters | `chain_id`, `public_key`, `private_key` |
| [Genesis](genesis-params) | Genesis block configuration | `genesis.public_key`, and possibly `genesis.file` & `genesis.private_key` |
| [Network](network-params) | ? | `network.address` |
| [Torii](torii-params) | ? | `torii.address` |
| [Sumeragi](sumeragi-params) | ? | `sumeragi.trusted_peers` if doesn't submit the genesis |
| [Kura](kura-params) | ? | |
| [Queue](queue-params) | ? | |
| [Snapshot](snapshot-params) | ? | |
| [Logger](logger-params) | ? | |
| [Telemetry](telemetry-params) | ? | |
| [Chain Wide](chain-wide-params) | ? | |

## Example Configuration

- Show minimal TOML
- Show same minimal ENVs
- Refer to `peer.template.toml` in the repo, or show it here under the
spoiler.

## Extends feature

- You can compose configuration files together using the `extends`
root-level field

---

## Required Parameters

- [`public_key`](base-params#param-public-key): _explain the option_
- [`private_key`](base-params#param-private-key): _explain the option_
- [`network.address`](network-params#param-address): _explain the option_
- [`genesis.public_key`](genesis-params#param-public-key): _explain the
option_
- [`genesis.private_key`](genesis-params#param-private-key) if the peer
is the one who submits the genesis. _explain the option_
- [`sumeragi.trusted_peers`](sumeragi-params#param-trusted-peers):
_explain the option_. It is not _strictly_ required, but you might need
to set it in most cases.
- [`torii.address`](torii-params#param-address): _explain the option_

## Modules Overview

TODO: list each section (sumeragi, torii, kura etc) with links and short
explanations of their responsibility.

- **[Base Options](base-params):** _explain_
- **[Genesis](genesis-params):** _explain_
- **[Sumeragi](sumeragi-params):** _explain_
- **[Torii](torii-params):** _explain_
- **[Queue](queue-params):** _explain_
- **[Kura](kura-params):** _explain_
- **[Logger](logger-params):** _explain_
- **[Telemetry](telemetry-params):** _explain_
- **[Snapshot](./snapshot-params)**
- Use `--config` CLI or relevant ENV parameter (?)
- Use `--trace-config` to debug
- Config consists of parameters set via TOML file (some via ENV too)
- There is also chain-wide config, which is different
- Here is the template file
- Here is how to use `extends`
40 changes: 0 additions & 40 deletions src/reference/config/kura-params.md

This file was deleted.

39 changes: 0 additions & 39 deletions src/reference/config/logger-params.md

This file was deleted.

1 change: 0 additions & 1 deletion src/reference/config/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ were removed.
| ----------------------------------: | ---------------------------------------------------------------------------------------------------------------- |
| `IROHA2_CONFIG_PATH` | removed, use [`--config`](../cli#arg-config) instead |
| `IROHA2_GENESIS_PATH` | [`GENESIS_FILE`](genesis-params#param-file) |
| `IROHA2_GENESIS_PATH` | [`GENESIS_FILE`](genesis-params#param-file) |
| `IROHA_PUBLIC_KEY` | [`PUBLIC_KEY`](base-params#param-public-key) |
| `IROHA_PRIVATE_KEY` | split into [`PRIVATE_KEY_ALGORITHM` and `PRIVATE_KEY_PAYLOAD`](base-params#param-private-key) |
| `TORII_P2P_ADDR` | [`P2P_ADDRESS`](network-params#param-address) |
Expand Down
Loading

0 comments on commit b239758

Please sign in to comment.