Skip to content

Commit 0554dbb

Browse files
committed
chore: scaffold internal/mithril-aggregator-client crate
1 parent cdc4548 commit 0554dbb

File tree

9 files changed

+92
-3
lines changed

9 files changed

+92
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ jobs:
844844
# the same name (we only want to document those anyway)
845845
cargo doc --no-deps --lib -p mithril-stm -p mithril-common \
846846
-p mithril-cardano-node-chain -p mithril-cardano-node-internal-database \
847-
-p mithril-dmq \
848-
-p mithril-build-script -p mithril-cli-helper -p mithril-doc -p mithril-doc-derive \
847+
-p mithril-aggregator-client -p mithril-build-script -p mithril-cli-helper \
848+
-p mithril-dmq -p mithril-doc -p mithril-doc-derive \
849849
-p mithril-era -p mithril-metric -p mithril-persistence -p mithril-resource-pool \
850850
-p mithril-ticker -p mithril-signed-entity-lock -p mithril-signed-entity-preloader \
851851
-p mithril-aggregator -p mithril-signer -p mithril-client -p mithril-client-cli \

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ members = [
1111
"examples/client-mithril-stake-distribution",
1212
"internal/cardano-node/mithril-cardano-node-chain",
1313
"internal/cardano-node/mithril-cardano-node-internal-database",
14+
"internal/mithril-aggregator-client",
1415
"internal/mithril-build-script",
1516
"internal/mithril-cli-helper",
1617
"internal/mithril-dmq",

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ This repository consists of the following parts:
8080
- [**Mithril signer**](./mithril-signer): the node of the **Mithril network** responsible for producing individual signatures that are collected and aggregated by the **Mithril aggregator**.
8181

8282
- [**Internal**](./internal): the shared tools and API used by **Mithril** crates.
83+
- [**Mithril aggregator client**](./internal/mithril-aggregator-client): a client to request data from a Mithril Aggregator, used by **Mithril network** nodes and client library.
84+
8385
- [**Mithril build script**](./internal/mithril-build-script): a toolbox for Mithril crates that uses a build script phase.
8486

8587
- [**Mithril cardano-node-chain**](./internal/cardano-node/mithril-cardano-node-chain): mechanisms to read and interact with the **Cardano chain** through a Cardano node, used by **Mithril network** nodes.
8688

87-
- [**Mithril cardano-node-internal-database**](./internal/cardano-node/mithril-cardano-node-internal-database): mechanisms to read the files of a **Cardano node** internal database and compute digests from them, used by **Mithril network** nodes.
89+
- [**Mithril cardano-node-internal-database**](./internal/cardano-node/mithril-cardano-node-internal-database): mechanisms to read the files of a **Cardano node** internal database and compute digests from them, used by **Mithril network** nodes and client library.
8890

8991
- [**Mithril cli helper**](./internal/mithril-cli-helper): **CLI** tools for **Mithril** binaries.
9092

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[package]
2+
name = "mithril-aggregator-client"
3+
version = "0.1.0"
4+
description = "Client to request data from a Mithril Aggregator"
5+
authors.workspace = true
6+
documentation.workspace = true
7+
edition.workspace = true
8+
homepage.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
include = ["**/*.rs", "Cargo.toml", "README.md"]
12+
13+
[lib]
14+
crate-type = ["lib", "cdylib", "staticlib"]
15+
16+
[dependencies]
17+
anyhow = { workspace = true }
18+
async-trait = { workspace = true }
19+
mithril-common = { path = "../../mithril-common", version = ">=0.5" }
20+
reqwest = { workspace = true }
21+
semver = { workspace = true }
22+
serde = { workspace = true }
23+
serde_json = { workspace = true }
24+
slog = { workspace = true }
25+
thiserror = { workspace = true }
26+
tokio = { workspace = true }
27+
28+
[dev-dependencies]
29+
http = "1.3.1"
30+
httpmock = "0.7.0"
31+
mithril-common = { path = "../../mithril-common", version = ">=0.5", features = ["test_tools"] }
32+
mockall = { workspace = true }
33+
slog-async = { workspace = true }
34+
slog-term = { workspace = true }
35+
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: all build test check doc
2+
3+
CARGO = cargo
4+
5+
all: test build
6+
7+
build:
8+
${CARGO} build --release
9+
10+
test:
11+
${CARGO} test
12+
13+
check:
14+
${CARGO} check --release --all-features --all-targets
15+
${CARGO} clippy --release --all-features --all-targets
16+
${CARGO} fmt --check
17+
18+
doc:
19+
${CARGO} doc --no-deps --open
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Mithril-aggregator-client [![CI workflow](https://github.com/input-output-hk/mithril/actions/workflows/ci.yml/badge.svg)](https://github.com/input-output-hk/mithril/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/input-output-hk/mithril/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=flat-square)](https://discord.gg/5kaErDKDRq)
2+
3+
This crate provides a client to request data from a Mithril Aggregator.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![warn(missing_docs)]
2+
//! This crate provides a client to request data from a Mithril Aggregator.
3+
//!
4+
5+
#[cfg(test)]
6+
mod test;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[cfg(test)]
2+
mithril_common::define_test_logger!();

0 commit comments

Comments
 (0)