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

Update Mithril Client documentation #974

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mithril-doc",
"version": "0.1.10",
"version": "0.1.11",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
57 changes: 47 additions & 10 deletions docs/root/manual/developer-docs/nodes/mithril-client.md
jpraynaud marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ This program shows, downloads and verifies certified blockchain artifacts.
Usage: mithril-client [OPTIONS] <COMMAND>

Commands:
snapshot Snapshot commands
help Print this message or the help of the given subcommand(s)
snapshot Snapshot commands
mithril-stake-distribution Mithril Stake Distribution management (alias: msd)
help Print this message or the help of the given subcommand(s)

Options:
--run-mode <RUN_MODE>
Expand Down Expand Up @@ -167,7 +168,7 @@ GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) NETWO
You can use the `--json` (or `-j`) option in order to display results in `JSON` format for the `list` and `show` commands:

```bash
./mithril-client list --json
./mithril-client snapshot list --json
```

:::
Expand Down Expand Up @@ -219,20 +220,26 @@ mithril_client () {
}
```

Now you can use the `mithril_client` function:
Now you can use the `mithril_client` functions:

```bash
# 1- Help
mithril_client help

# 2- List snapshots
mithril_client list
mithril_client snapshot list

# 3- Download latest snapshot
mithril_client download $SNAPSHOT_DIGEST
# 3- Show detailed informations about a snapshot
mithril_client snapshot show $SNAPSHOT_DIGEST

# 4- Restore latest snapshot
mithril_client restore $SNAPSHOT_DIGEST
# 4- Download the given snapshot and verify the certificate
mithril_client snapshot download $SNAPSHOT_DIGEST

# 5- List Mithril Stake Distributions
mithril_client mithril-stake-distribution list

# 6- Download and verify the given Mithril Stake Distribution
mithril_client mithril-stake-distribution download $MITHRIL_STAKE_DISTRIBUTION_ARTIFACT_HASH
```

### Local Image
Expand All @@ -253,7 +260,7 @@ make docker-run

Here are the subcommands available:

### snapshot
### Snapshot

| Subcommand | Performed action |
|------------|------------------|
Expand All @@ -262,6 +269,14 @@ Here are the subcommands available:
| **list** | List available snapshots|
| **show** | Informations about a snapshot|

### Mithril Stake Distribution

| Subcommand | Performed action |
|------------|------------------|
| **download** | Download and verify a Mithril Stake Distribution|
| **help** | Print this message or the help of the given subcommand(s)|
| **list** | List available Mithril Stake Distributions|

## Configuration parameters

The configuration parameters are set either:
Expand All @@ -271,6 +286,8 @@ The configuration parameters are set either:

Here is a list of the available parameters:

General parameters:

| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
| `verbose` | `--verbose` | `-v` | `VERBOSE` | Verbosity level | - | Parsed from number of occurrences: `-v` for `Warning`, `-vv` for `Info`, `-vvv` for `Debug` and `-vvvv` for `Trace` | :heavy_check_mark: |
Expand All @@ -279,3 +296,23 @@ Here is a list of the available parameters:
| `aggregator_endpoint` | `--aggregator-endpoint` | - | `AGGREGATOR_ENDPOINT` | Aggregator node endpoint | - | `https://aggregator.pre-release-preview.api.mithril.network/aggregator` | :heavy_check_mark: |
| `genesis_verification_key` | - | - | `GENESIS_VERIFICATION_KEY` | Genesis verification key | - | - | :heavy_check_mark: |
| `json_output` | `--json` | `-j` | - | Enable JSON output | no | - | - |

`snapshot show` command:

| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
| `digest` | `--digest` | - | `DIGEST` | Snapshot digest | - | - | :heavy_check_mark: |

`snapshot download` command:

| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
| `digest` | `--digest` | - | `DIGEST` | Snapshot digest | - | - | :heavy_check_mark: |
| `download_dir` | `--download-dir` | - | - | Directory where the snapshot will be downloaded | . | - | - |

`mithril-stake-distribution download` command:

| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
| `artifact_hash` | `--artifact-hash` | - | - | Hash of the Mithril Stake Distribution artifact | - | - | :heavy_check_mark: |
| `download_dir` | `--download-dir` | - | - | Directory where the Mithril Stake Distribution will be downloaded | . | - | - |
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct MithrilStakeDistributionDownloadCommand {
/// Hash of the Mithril Stake Distribution artifact
artifact_hash: String,

/// Directory where the snapshot will be downloaded. By default, a
/// Directory where the Mithril Stake Distribution will be downloaded. By default, a
/// subdirectory will be created in this directory to extract and verify the
/// certificate.
#[clap(long, default_value = ".")]
Expand Down