Skip to content

Commit

Permalink
docs: improve running instructions (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored May 28, 2024
1 parent ce69556 commit 1939137
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 36 deletions.
4 changes: 4 additions & 0 deletions docs/pages/running/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"modes": "Operation Modes",
"logging": "Logging"
}
9 changes: 0 additions & 9 deletions docs/pages/running/daemon.mdx

This file was deleted.

18 changes: 0 additions & 18 deletions docs/pages/running/eval.mdx

This file was deleted.

57 changes: 57 additions & 0 deletions docs/pages/running/logging.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Logging

Dolos outputs a LOT of logs through stdout. Internally, it uses a tracing mechanism that groups logs into hierarchical blocks called _spans_ that holds data describing the context where the event (aka: log) ocurred.

Depending on your use-case, the amount and detail of this logs might be overwhelming. _Dolos_ provides a set of configuration values that allows you to opt-in into different levels of detail.

## Log Levels

Dolos follow a very common convention around log levels. These levels describe discrete categories of decreasing severity (broadly speaking).

The following table describes the available options and what they are used within our context:

| level | description |
| ------- | ---------------------------------------------------------------------------- |
| `error` | unexpected errors, stuff that shouldn't occur |
| `warn` | warning about things that are expected but require attention |
| `info` | normal operation events that are relevant for day-to-day operations |
| `debug` | normal operation events with a level of detail useful for debugging problems |
| `trace` | extreme level of detail, usually including data being processed |

## Sub-components

There are some sub-components within _Dolos_ that are more verbose than others. Depending on your use-case or debugging needs, you might one to mute some components and not others.

We have identified a few components that make sense to isolate from the rest of the logs to provide extra flexibility. These components are:

| component | description |
| --------- | ----------------------------------------------------------------------------------------------------- |
| Pallas | The library that deals with low-level Ouroboros interactions (eg: mini-protocols, cbor decoding, etc) |
| Tonic | The library that deals with gRPC communication |

## Configuration

Now that we understand the different dimensions involved in the logging process, we can describe the relevant configuration.

The configuration section within the `dolos.toml` file that controls the logging options is called `logging` (I know, impossible to guess). The schema for the configuration values is the following:

| property | type | example |
| -------------- | ------ | --------------------------------------------- |
| max_level | option | `error` / `warn` / `info` / `debug` / `trace` |
| include_pallas | option | `true` / `false` |
| include_tonic | option | `true` / `false` |

- `max_level`: the maximum severity level of events to include in the output. By selecting a specific level, you're effectively including that level and every other levels of higher severity.
- `include_pallas`: a flag that indicate if the output should include logs from the Pallas sub-component.
- `include_tonic`: a flag that indicate if the output should include logs from the Tonic sub-component.

The following is an example of a logging configuration:

```toml
[logging]
max_level = "INFO"
include_pallas = true
include_tonic = true
```

You can find more detailed info about configuration in the [configuration schema section](../configuration/schema)
42 changes: 42 additions & 0 deletions docs/pages/running/modes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Operation Modes

_Dolos_ has many operation modes dependending on your requirements. Choose the one that fits your need.

## `daemon` mode

This is the normal operation mode. When running in this mode, Dolos will perform all operations as specified in the configuration file.

To start _Dolos_ in `daemon` mode, use the following command:

```sh
dolos daemon
```

## `sync` mode

When running in this mode, Dolos will focus on a single task: synchronizing its state from the upstream node.

To start _Dolos_ in `sync` mode, use the following command:

```sh
dolos sync
```

## `serve` mode

When running in this mode, Dolos will focus on a single task: serving data through the configured API endpoints.

To start _Dolos_ in `serve` mode, use the following command:

```sh
dolos serve
```

## Sumary of Modes

| feature | daemon | sync | serve |
| ------------------------------ | ------ | ---- | ----- |
| sync from upstream peer ||||
| relay ouroboros node-to-node ||||
| serve ouroboros node-to-client ||||
| serve gRPC ||||
9 changes: 0 additions & 9 deletions docs/pages/running/sync.mdx

This file was deleted.

0 comments on commit 1939137

Please sign in to comment.