-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
Signed-off-by: Dmitry Balashov <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue' | ||
import { computedEager } from '@vueuse/core' | ||
import { withBase } from 'vitepress' | ||
import { match, P } from 'ts-pattern' | ||
const props = defineProps<{ | ||
type: 'string' | 'number' | 'socket-addr' | 'duration' | 'bytes' | 'private-key' | 'multihash' | 'file-path' | ||
defaultValue?: string | ||
env?: boolean | string | ||
}>() | ||
function glossaryLink(text: string, id: string) { | ||
return { text, url: withBase(`/reference/config/glossary#${id}`) } | ||
} | ||
const typeModel = computed(() => { | ||
type Result = (string | { url: string; text: string })[] | ||
return match(props.type) | ||
.returnType<Result>() | ||
.with('string', () => ['String']) | ||
.with('number', () => ['Number']) | ||
.with('socket-addr', () => ['String, ', glossaryLink('Socket Address', 'type-socket-address')]) | ||
.with('duration', () => ['String, ', glossaryLink('Duration', 'type-duration')]) | ||
.with('bytes', () => ['String, ', glossaryLink('Bytes', 'type-bytes')]) | ||
.with('private-key', () => ['Table, ', glossaryLink('Private Key', 'type-private-key')]) | ||
.with('multihash', () => ['String, ', glossaryLink('Multihash', 'type-multihash')]) | ||
.with('file-path', () => ['String, file path']) | ||
.exhaustive() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Type</th> | ||
<th v-if="env">Environment Alias</th> | ||
Check warning on line 39 in .vitepress/theme/components/ConfigParameterSpecs.vue GitHub Actions / check
|
||
<th v-if="defaultValue">Default</th> | ||
Check warning on line 40 in .vitepress/theme/components/ConfigParameterSpecs.vue GitHub Actions / check
|
||
<th v-else></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td> | ||
<template v-for="item in typeModel"> | ||
<template v-if="typeof item === 'string'">{{ item }}</template> | ||
Check warning on line 48 in .vitepress/theme/components/ConfigParameterSpecs.vue GitHub Actions / check
|
||
<a v-else :href="item.url">{{ item.text }}</a> | ||
Check failure on line 49 in .vitepress/theme/components/ConfigParameterSpecs.vue GitHub Actions / check
|
||
</template> | ||
</td> | ||
<td v-if="env"> | ||
<code v-if="typeof env === 'string'">{{ env }}</code> | ||
<slot name="env" v-else /> | ||
Check warning on line 54 in .vitepress/theme/components/ConfigParameterSpecs.vue GitHub Actions / check
|
||
</td> | ||
<td v-if="defaultValue"> | ||
{{ defaultValue }} | ||
</td> | ||
<td v-else> | ||
<b>Required</b> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,58 @@ | ||
# Base Parameters | ||
|
||
## `address` | ||
## `chain_id` | ||
|
||
- **Type:** String, [Socket-Address](glossary#type-socket-address) | ||
- **Required** | ||
<ConfigParameterSpecs type="string" env="CHAIN_ID" /> | ||
|
||
Address for p2p communication for consensus (sumeragi) and block synchronization (block_sync) purposes. | ||
::: code-group | ||
|
||
```toml | ||
address = "localhost:1337" | ||
```toml [Config File] | ||
chain_id = "00000000-0000-0000-0000-000000000000" | ||
``` | ||
|
||
```shell [ENV] | ||
CHAIN_ID=00000000-0000-0000-0000-000000000000 | ||
``` | ||
|
||
::: | ||
|
||
## `private_key` | ||
|
||
- **Type:** Table, [Private Key](glossary#type-private-key) | ||
- **Required** | ||
<ConfigParameterSpecs type="private-key" env> | ||
<template #env> | ||
<code>PRIVATE_KEY_ALGORITHM</code> + <code>PRIVATE_KEY_PAYLOAD</code> | ||
</template> | ||
</ConfigParameterSpecs> | ||
|
||
Private key of this peer | ||
Private key of the peer | ||
|
||
::: code-group | ||
|
||
```toml [Config File] | ||
private_key = { algorithm = "ed25519", payload = "8f4c15e5d664da3f13778801d23d4e89b76e94c1b94b389544168b6cb894f84f8ba62848cf767d72e7f7f4b9d2d7ba07fee33760f79abe5597a51520e292a0cb" } | ||
``` | ||
|
||
```toml | ||
private_key.digest = "ed25519" | ||
private_key.payload = "82886B5A2BB3785F3CA8F8A78F60EA9DB62F939937B1CFA8407316EF07909A8D236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B" | ||
```shell [ENV] | ||
PRIVATE_KEY_ALGORITHM=ed25519 | ||
PRIVATE_KEY_PAYLOAD=8f4c15e5d664da3f13778801d23d4e89b76e94c1b94b389544168b6cb894f84f8ba62848cf767d72e7f7f4b9d2d7ba07fee33760f79abe5597a51520e292a0cb | ||
``` | ||
|
||
::: | ||
|
||
## `public_key` | ||
|
||
- **Type:** String, [Multi-hash](glossary#type-multi-hash) | ||
- **Required** | ||
<ConfigParameterSpecs type="multihash" env="PUBLIC_KEY" /> | ||
|
||
Public key of the peer | ||
|
||
Public key of this peer | ||
::: code-group | ||
|
||
```toml | ||
```toml [Config File] | ||
public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9" | ||
``` | ||
|
||
```shell [ENV] | ||
PUBLIC_KEY=ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9 | ||
``` | ||
|
||
::: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# On-Chain Parameters | ||
|
||
- These parameters are chain-wide, and each peer should have the same | ||
- It should not be specified in the config file: https://github.com/hyperledger/iroha/issues/4028 | ||
- We don't document it for now |
This file was deleted.