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: improve docs #16

Merged
merged 5 commits into from
Feb 6, 2025
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: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ hex = "0.4.3"
itertools = "0.14.0"
pallas = "0.32.0"
protoc-wkt = "1.0.0"
rocket = "0.5.1"
serde = { version = "1.0.217", features = ["derive"] }
thiserror = "2.0.11"
sqlx = { version = "0.8.3", features = ["runtime-tokio-rustls", "sqlite", "chrono"] }
Expand All @@ -35,4 +34,3 @@ tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
futures = "0.3.31"
serde_json = "1.0.138"
async-stream = "0.3.6"
tokio-stream = "0.1.17"
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ RUN apt install -y build-essential pkg-config libssl-dev libsasl2-dev cmake
COPY ./Cargo.toml ./Cargo.toml
COPY . .

RUN cargo build --release --bin=boros
RUN cargo build --release

FROM alpine:3.21.2
COPY --from=build /app/target/release/boros .
CMD ["./boros"]
LABEL service=boros
FROM debian:stable-slim

COPY --from=build /app/target/release/boros /usr/local/bin/boros

ENTRYPOINT [ "boros" ]
6 changes: 4 additions & 2 deletions docs/app/_meta.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export default {
index: '',
design: '',
"index": "Introduction",
"installation": "Installation",
"configuration": "Configuration",
"design": "Design",
};
17 changes: 17 additions & 0 deletions docs/app/configuration/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Configuration - Boros
sidebarTitle: Configuration
asIndexPage: true
---

# Configuration

Boros uses a `config.toml` file to define some configuration parameters. At least one Cardano Node Peer is required and a U5C server.

Use this [config.toml](https://github.com/txpipe/boros/blob/main/examples/config.toml) to create yours.

## Tips

For U5C, the UTxO RPC from [Demeter](https://demeter.run/ports/cardano-utxorpc) can be used.

The Cardano Relays can be found in the Pool details in the Cardano Explorer, example [cexplorer](https://cexplorer.io).
17 changes: 0 additions & 17 deletions docs/app/design/adrs/003-db/page.md

This file was deleted.

10 changes: 5 additions & 5 deletions docs/app/design/page.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Design - Boros Docs
title: Design - Boros
sidebarTitle: Design
asIndexPage: true
---
Expand All @@ -12,7 +12,7 @@ Take a look at the [architectural decision record](./design/adrs)

## Sequence Flow

Sequence diagram to describe how Boros process the requests and the state of the transactions.
Sequence diagram to describe how Boros process the requests and the state of the transactions.

```mermaid
sequenceDiagram
Expand All @@ -27,7 +27,7 @@ sequenceDiagram
participant dolos as Dolos

client->>+grpc: send raw tx
par Persist in flight
par Persist in flight
grpc->>+db: persist tx in flight db
db-->>-grpc: ok
grpc-->>client: accepted
Expand Down Expand Up @@ -81,11 +81,11 @@ erDiagram
DATETIME created_at
DATETIME updated_at
}

tx_dependence {
TEXT dependent_id PK
TEXT required_id PK
}

tx ||--o{ tx_dependence : "One tx can have N other dependencies"
```
5 changes: 5 additions & 0 deletions docs/app/installation/_meta.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

export default {
"from_source": "From Source",
"docker": "Docker",
};
23 changes: 23 additions & 0 deletions docs/app/installation/docker/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Docker - Boros
sidebarTitle: Docker
asIndexPage: true
---

# Docker

Boros provides already built public Docker image through Github Package. To execute Boros via Docker, use the following command:

```sh
docker run ghcr.io/txpipe/boros:latest
```

## Configuration

The default configuration file for Boros is located in `/etc/boros/config.toml` or the env `BOROS_CONFIG` can be used to set the path of the config file. The following example runs a docker container using a configuration file named `config.toml` located in the current folder.

Create a file `config.toml` following the [configuration](../configuration)

```sh
docker run -v $(pwd)/config.toml:/etc/boros/config.toml -p 50052:50052 ghcr.io/txpipe/boros:latest
```
29 changes: 29 additions & 0 deletions docs/app/installation/from_source/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: From Source - Boros
sidebarTitle: From Source
asIndexPage: true
---

# From Source

The following instructions show how to build and install Boros from source code.

## Pre-requisites

- Rust toolchain

## Installation

```sh
git clone git@github.com:txpipe/boros.git
cd boros
cargo install --path=.
```

## Configuration

Create a file `config.toml` following the [configuration](../configuration), set `BOROS_CONFIG` env with the file path or create the config file in `/etc/boros/config.toml`.

```sh
BOROS_CONFIG=./config.toml boros
```
2 changes: 1 addition & 1 deletion docs/app/page.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Docs home - Boros Docs
title: Docs home - Boros
sidebarTitle: Introduction
---

Expand Down
4 changes: 2 additions & 2 deletions examples/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[storage]
db_path = "dev.db"
db_path = "boros.db"

[server]
listen_address="[::1]:50052"
listen_address="0.0.0.0:50052"

[peer_manager]
peers = [
Expand Down
2 changes: 1 addition & 1 deletion examples/tx-gen
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Preview network
NETWORK_MAGIC=2
BOROS_RPC="localhost:50052"
BOROS_RPC="0.0.0.0:50052"

if [ ! -e "./cardano-cli" ]; then
echo "make sure to have cardano-cli in the tx-gen path"
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl Config {
config::File::with_name(&env::var("BOROS_CONFIG").unwrap_or("boros.toml".into()))
.required(false),
)
.add_source(config::File::with_name("/etc/boros/config.toml").required(false))
.add_source(config::Environment::with_prefix("boros").separator("_"))
.build()?
.try_deserialize()?;
Expand Down