diff --git a/Cargo.toml b/Cargo.toml index 3311577..c847e99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } @@ -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" diff --git a/Dockerfile b/Dockerfile index e6282f7..72e7f8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/docs/app/_meta.tsx b/docs/app/_meta.tsx index 0d60e44..a846291 100644 --- a/docs/app/_meta.tsx +++ b/docs/app/_meta.tsx @@ -1,4 +1,6 @@ export default { - index: '', - design: '', + "index": "Introduction", + "installation": "Installation", + "configuration": "Configuration", + "design": "Design", }; diff --git a/docs/app/configuration/page.mdx b/docs/app/configuration/page.mdx new file mode 100644 index 0000000..e667ace --- /dev/null +++ b/docs/app/configuration/page.mdx @@ -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). diff --git a/docs/app/design/adrs/003-db/page.md b/docs/app/design/adrs/003-db/page.md deleted file mode 100644 index 0dc0e4b..0000000 --- a/docs/app/design/adrs/003-db/page.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: DB - Boros Docs -sidebarTitle: DB ---- - -# Decision to choose an entry point server - -**status**: draft - -## Context - - - - -## Decision - - diff --git a/docs/app/design/page.mdx b/docs/app/design/page.mdx index 0adae9c..18df4dd 100644 --- a/docs/app/design/page.mdx +++ b/docs/app/design/page.mdx @@ -1,5 +1,5 @@ --- -title: Design - Boros Docs +title: Design - Boros sidebarTitle: Design asIndexPage: true --- @@ -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 @@ -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 @@ -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" ``` diff --git a/docs/app/installation/_meta.tsx b/docs/app/installation/_meta.tsx new file mode 100644 index 0000000..f0b9efd --- /dev/null +++ b/docs/app/installation/_meta.tsx @@ -0,0 +1,5 @@ + +export default { + "from_source": "From Source", + "docker": "Docker", +}; diff --git a/docs/app/installation/docker/page.mdx b/docs/app/installation/docker/page.mdx new file mode 100644 index 0000000..c72df5d --- /dev/null +++ b/docs/app/installation/docker/page.mdx @@ -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 +``` diff --git a/docs/app/installation/from_source/page.mdx b/docs/app/installation/from_source/page.mdx new file mode 100644 index 0000000..af29f43 --- /dev/null +++ b/docs/app/installation/from_source/page.mdx @@ -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 +``` diff --git a/docs/app/page.mdx b/docs/app/page.mdx index 68c41f0..9754ba7 100644 --- a/docs/app/page.mdx +++ b/docs/app/page.mdx @@ -1,5 +1,5 @@ --- -title: Docs home - Boros Docs +title: Docs home - Boros sidebarTitle: Introduction --- diff --git a/examples/config.toml b/examples/config.toml index c135486..6b8e086 100644 --- a/examples/config.toml +++ b/examples/config.toml @@ -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 = [ diff --git a/examples/tx-gen b/examples/tx-gen index e87c2d2..916cde5 100755 --- a/examples/tx-gen +++ b/examples/tx-gen @@ -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" diff --git a/src/main.rs b/src/main.rs index 5700dfe..1324fd9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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()?;