Skip to content

Commit

Permalink
Add more details on each module category in the server's README.
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jun 19, 2022
1 parent 9ca54ca commit aa2e394
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ See [projects 🎯](https://github.com/CardanoSolutions/ogmios/projects).
|
<a href="CHANGELOG.md">:floppy_disk: Changelog</a>
|
<a href=""><img src=".github/discord.svg" alt="Discord">Discord (#ogmios)</a>
<a href="https://discord.gg/ZeyDn65t5v"><img src=".github/discord.svg" alt="Discord">Discord (#ogmios)</a>
|
<a href="https://twitter.com/_KtorZ_"><img src=".github/twitter.svg" alt="Twitter"> Twitter (@_KtorZ_)</a>
</p>
Expand Down
28 changes: 23 additions & 5 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ entire application is stitched together in a very thin layer.

### Modules Overview

##### Top-Level

Where top-level code lies, stitching together the various parts of the applications and exposing a high-level interface for building an executable.

<details>
<summary>Application</summary>
<summary>Modules</summary>

```tree
^ ─── Ogmios.hs
Expand All @@ -33,11 +37,16 @@ Application | ├── Prelude.hs
```
</details>

##### Data

Contains data-structures and non-effectful code. Since Ogmios is mainly a codec translation layer, this is where most of the code (75%) lies. In particular, all the JSON encoders and decoders are defined here, as well as the JSON-WSP machinery behind all requests and responses.

<details>
<summary>Data</summary>
<summary>Modules</summary>

```tree
^ ─── Data
|    ├── EraTranslation.hs
|    ├── Health.hs
|    ├── Json.hs
|    ├── Json
Expand All @@ -48,7 +57,8 @@ Application | ├── Prelude.hs
|    │   ├── Shelley.hs
|    │   ├── Allegra.hs
|    │   ├── Mary.hs
Data |    │   └── Alonzo.hs
|    │   ├── Alonzo.hs
Data |    │   └── Babbage.hs
|    ├── Metrics.hs
|    ├── Protocol.hs
|    └── Protocol
Expand All @@ -59,8 +69,12 @@ Application | ├── Prelude.hs
```
</details>

##### App

Effectful code written leveraging Haskell's type-class as an effect system. This is where the client-side (where cardano-node acts as a server) implementation of ouroboros mini-protocols resides. This is also where we define the HTTP server and WebSocket server handlers.

<details>
<summary>Logic</summary>
<summary>Modules</summary>

```tree
^  ─── App
Expand All @@ -81,8 +95,12 @@ Application | ├── Prelude.hs
```
</details>

##### Control

A thin abstraction layer for I/O effects. This is based off [io-sim](https://github.com/input-output-hk/io-sim) with a few additions custom to Ogmios. The goal of these modules isn't to be a generic all-purpose I/O abstraction, but rather, something tailored to the project, that defines a clear interface for effects and that encapsulate their actual interpretation in one place. This allows for the rest of the code to remains mostly IO-free.

<details>
<summary>Effects</summary>
<summary>Modules</summary>

```tree
^  ─── Control
Expand Down

0 comments on commit aa2e394

Please sign in to comment.