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 all 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
68 changes: 33 additions & 35 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 @@ -28,7 +28,7 @@ function nav(): DefaultTheme.NavItem[] {
{
text: 'Reference',
link: '/reference/torii-endpoints',
activeMatch: '/reference/',
activeMatch: '^/reference/',
},
{
text: 'Help',
Expand Down Expand Up @@ -89,6 +89,10 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
text: 'JavaScript',
link: '/guide/tutorials/javascript',
},
{
text: 'Compatibility Matrix',
link: '/reference/compatibility-matrix',
},
],
},
{
Expand All @@ -99,18 +103,6 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
text: 'Configure Iroha',
collapsed: true,
items: [
{
text: 'Configuration Types',
link: '/guide/configure/configuration-types',
},
{
text: 'Samples',
link: '/guide/configure/sample-configuration',
},
{
text: 'Peer Configuration',
link: '/guide/configure/peer-configuration',
},
{
text: 'Client Configuration',
link: '/guide/configure/client-configuration',
Expand Down Expand Up @@ -303,10 +295,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 +308,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 +324,30 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
text: 'Permissions',
link: '/reference/permissions.md',
},
{
text: 'irohad CLI',
link: '/reference/irohad-cli.md',
},
{
text: 'Torii HTTP API',
link: '/reference/torii-endpoints.md',
},
{
text: 'Foreign Function Interfaces',
link: '/reference/ffi',
},
{
text: 'Peer Configuration',
link: '/reference/peer-config/index.md',
items: [
{ text: 'Parameters', link: '/reference/peer-config/params.md' },
{ text: 'Migration from pre-rc.20', link: '/reference/peer-config/migration.md' },
],
},
{
text: 'Genesis Block',
link: '/reference/genesis.md',
},
],
},
]
Expand Down Expand Up @@ -465,13 +464,12 @@ export default defineConfig({
},

nav: nav(),
outline: [2, 3],

sidebar: {
'/get-started/': sidebarStart(),
'/guide/': sidebarGuide(),
'/blockchain/': sidebarChain(),
'/reference/': sidebarAPI(),
'/reference/': sidebarReference(),
'/help/': sidebarHelp(),
},

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
4 changes: 2 additions & 2 deletions etc/meta.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* hyperledger-iroha/iroha#iroha2-dev
* `main` as of 2024/11/13
*/
export const IROHA_REV_DEV = 'e7a605c1a926c319d214ef3825524ee6c2e9f076'
export const IROHA_REV_DEV = '2a30fc97087d48f0aa95ef0382038c4a06288828'

/**
* hyperledger-iroha/iroha-javascript#iroha2 (rc13)
Expand Down
12 changes: 6 additions & 6 deletions etc/snippet-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@ export default [
src: './src/example_code/lorem.rs',
},
{
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/configs/client.template.toml`,
filename: 'client-cli-config-template.toml',
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/docs/source/references/client.template.toml`,
// filename: 'client-cli-config-template.toml',
},
{
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/configs/peer.template.toml`,
filename: 'peer-config-template.toml',
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/docs/source/references/peer.template.toml`,
// filename: 'peer-config-template.toml',
},
{
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/configs/swarm/genesis.json`,
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/defaults/genesis.json`,
},
{
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/client/examples/tutorial.rs`,
src: `https://raw.githubusercontent.com/hyperledger-iroha/iroha/${IROHA_REV_DEV}/crates/iroha/examples/tutorial.rs`,
filename: 'tutorial-snippets.rs',
},

Expand Down
6 changes: 3 additions & 3 deletions src/blockchain/wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ non-portable architecture and OS-specific static manner, but WASM is a
portable format. Since C ABI is the _lingua franca_ of the programming
world and there is no other stable Rust ABI (yet), Iroha relies on the
C-linkage to generate WASM bindings. Thankfully, `iroha_wasm` takes care of
everything related to [foreign function interfaces](/reference/ffi.md) (FFI), so
you don't have to worry about things like `unsafe`, `repr(C)`, padding,
alignment, and others.
everything related to [foreign function interfaces](/reference/ffi.md)
(FFI), so you don't have to worry about things like `unsafe`, `repr(C)`,
padding, alignment, and others.

The `iroha_wasm` crate contains all of the bindings, macros, and trait
implementations that you'd need to write the program, most notably the
Expand Down
3 changes: 1 addition & 2 deletions src/blockchain/world.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
consists of:

- Iroha [configuration parameters](/guide/configure/client-configuration.md)
- the list of
[trusted peers](/guide/configure/peer-configuration#trusted-peers)
- TODO: peers
- registered domains
- registered [triggers](/blockchain/triggers.md)
- registered
Expand Down
6 changes: 0 additions & 6 deletions src/guide/advanced/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ This topic will be updated as part of the new configuration reference.
The progress on the configuration reference can be tracked in the following GitHub issue:\
[iroha-2-docs > Issue #392: Tracking issue for Configuration Reference as per RFC](https://github.com/hyperledger-iroha/iroha-2-docs/issues/392).

::: note

For examples, see [Sample Configuration Files](../configure/sample-configuration.md).

:::

After the above is configured, you can use the IP address set in the `"TORII_TELEMETRY_URL"` variable to access the metrics data from within a running Iroha instance.

**Example**:
Expand Down
17 changes: 4 additions & 13 deletions src/guide/advanced/running-iroha-on-bare-metal.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@ error-prone, particularly for exotic systems (Windows).
::: info

For this chapter, we assume you have learned about
[configuration](/guide/configure/sample-configuration.md) and
[management](/guide/configure/peer-management.md) in Iroha 2. Here we offer
you instructions to run Iroha on bare metal without going into details
about various configuration options available.

You can always check
[sample configuration files](/guide/configure/sample-configuration.md) for
`configs/peer/genesis.json` and `configs/peer/config.json`, or refer to
[peer configuration options](/guide/configure/peer-configuration.md) for
more details.
TODO extend with a relevant config guide

<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger-iroha/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger-iroha/iroha/blob/iroha2-dev/docs/source/references/config.md). -->

:::

Expand Down Expand Up @@ -448,13 +441,11 @@ Iroha in the real world.
```

3. Register your peer to a network, and make sure to add at least four of
the peers on that network to the
[`TRUSTED_PEERS`](/guide/configure/peer-configuration.md#trusted-peers)
the peers on that network to the trusted peers
array in your configuration file.

4. Determine the web socket that the other peers will use to connect to
you. Make sure that the port is open and use that address
([`P2P_ADDR`](/guide/configure/peer-configuration.md#p2p-addr)) in your
4. Determine the socket address that the other peers will use to connect to
you. Make sure that the port is open and use that address in your
`configs/peer/config.json` file.

5. After you have finished editing the configuration file, deploy Iroha by
Expand Down
76 changes: 26 additions & 50 deletions src/guide/configure/client-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Let's look at the client configuration options.

::: details Client configuration template

<<< @/snippets/client-cli-config-template.toml
<<< @/snippets/client.template.toml

:::

Expand All @@ -24,26 +24,26 @@ For details on cryptographic keys, see [Public Key Cryptography](../security/pub

## User account

The `ACCOUNT_ID` should be self-explanatory. The only thing you need to
worry about is that the account must already exist in the blockchain. In
other words, the account you provide here should already be
The `ACCOUNT_ID` should be self-explanatory. The only thing you need to worry about is that the account must already
exist in the blockchain. In other words, the account you provide here should already be
[registered](/blockchain/instructions.md#un-register).

::: info Note

Iroha is **case-sensitive**, meaning that _Alice_@wonderland is different
from _alice_@wonderland. It should go without saying that
_alice@wonderland_ is not the same as _alice@looking_glass_ either, since
these accounts belong to different domains, `wonderland` and
`looking_glass`.
Iroha is **case-sensitive**, meaning that _Alice_@wonderland is different from _alice_@wonderland. It should go without
saying that _alice@wonderland_ is not the same as _alice@looking_glass_ either, since these accounts belong to different
domains, `wonderland` and `looking_glass`.

:::

## Basic Authentication Credentials

The idea of basic authentication credentials is to provide the access control using a web server with a reverse proxy like [Nginx](https://www.nginx.com/) while these credentials are ignored by the Iroha peers.
The idea of basic authentication credentials is to provide the access control using a web server with a reverse proxy
like [Nginx](https://www.nginx.com/) while these credentials are ignored by the Iroha peers.

The login and password will be filled by the client and used for the [`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) HTTP [header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers).
The login and password will be filled by the client and used for the
[`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) HTTP
[header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers).

Use this style of configuration to provide the basic authentication credentials (login and password):

Expand All @@ -56,49 +56,26 @@ Use this style of configuration to provide the basic authentication credentials

## Iroha Public Addresses

`TORII` is the module in charge of handling incoming and outgoing
connections. For client configuration, you can set up two addresses:
`TORII_API_URL` and `TORII_TELEMETRY_URL`.
`TORII` is the module in charge of handling incoming and outgoing connections. For client configuration, you can set up
two addresses: `TORII_API_URL` and `TORII_TELEMETRY_URL`.

### `TORII_API_URL`

First, the `TORII_API_URL` is the same as `TORII` `API_URL` in the
[peer configuration](peer-configuration.md#api-url). This is the module
responsible for handling incoming and outgoing connections. You should also
add the prefix `http://` or (_preferably_) `https://` to the address. For
example:
First, the `TORII_API_URL` is the same as
[`torii.address` in the peer configuration](/reference/peer-config/params#param-torii-address). This is the module
responsible for handling incoming and outgoing connections. You should also add the prefix `http://` or (_preferably_)
`https://` to the address. For example:

```json
"TORII_API_URL": "http://127.0.0.1:8080"
```

### `TORII_TELEMETRY_URL`

The `TORII_TELEMETRY_URL` is used to specify the prometheus endpoint
address. You can set `TORII_TELEMETRY_URL` like this:

```json
"TORII_TELEMETRY_URL": "http://127.0.0.1:8180"
{
"TORII_API_URL": "http://127.0.0.1:8080"
}
```

A `GET` request to the `127.0.0.1:8180/status` will give you a JSON-encoded
representation of the top-level metrics, while a `GET` request to
`127.0.0.1:8180/metrics` will give you a (somewhat verbose) list of all
available metrics gathered in Iroha. You might want to change this if
you're having trouble gathering metrics using `prometheus`.

::: info

Learn how to [monitor Iroha performance](/guide/advanced/metrics.md) using
prometheus.

:::

## Transaction Limits

You can specify the transaction limits that each transaction must adhere
to: the maximum number of instructions and the maximum size of a WASM blob
(in bytes). For example:
You can specify the transaction limits that each transaction must adhere to: the maximum number of instructions and the
maximum size of a WASM blob (in bytes). For example:

```json
{
Expand All @@ -109,9 +86,8 @@ to: the maximum number of instructions and the maximum size of a WASM blob

## Transaction TTL and Timeout

Configure the time-to-live (TTL) for transactions and the timeout to wait
for the status. Both values have to be provided in milliseconds. For
example:
Configure the time-to-live (TTL) for transactions and the timeout to wait for the status. Both values have to be
provided in milliseconds. For example:

```json
"TRANSACTION_TIME_TO_LIVE_MS": 100000,
Expand All @@ -120,5 +96,5 @@ example:

## Transaction Nonce

If you set `ADD_TRANSACTION_NONCE` to `true`, Iroha will create different
hashes for transactions that occur repeatedly and simultaneously.
If you set `ADD_TRANSACTION_NONCE` to `true`, Iroha will create different hashes for transactions that occur repeatedly
and simultaneously.
Loading
Loading