diff --git a/Cargo.lock b/Cargo.lock index 9b8edc3b32..5d64dde49b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8050,6 +8050,37 @@ dependencies = [ [[package]] name = "nyx-chain-watcher" version = "0.1.14" +dependencies = [ + "anyhow", + "async-trait", + "axum 0.7.9", + "chrono", + "clap", + "nym-bin-common 0.6.0", + "nym-config 0.1.0", + "nym-network-defaults 0.1.0", + "nym-task 0.1.0", + "nym-validator-client 0.1.0", + "nyxd-scraper-sqlite", + "reqwest 0.12.15", + "schemars", + "serde", + "sqlx", + "thiserror 2.0.12", + "time", + "tokio", + "tokio-util", + "tower-http", + "tracing", + "tracing-subscriber", + "utoipa", + "utoipa-swagger-ui", + "utoipauto", +] + +[[package]] +name = "nyx-chain-watcher-pgsql" +version = "0.1.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 6ac171fd9e..abcf521438 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -163,7 +163,8 @@ default-members = [ "nym-node-status-api/nym-node-status-api", "nym-statistics-api", "nym-validator-rewarder", - "nyx-chain-watcher", + "nyx-chain-watcher/sqlite", + "nyx-chain-watcher/pgsql", "service-providers/authenticator", "service-providers/ip-packet-router", "service-providers/network-requester", diff --git a/nyx-chain-watcher/pgsql/Cargo.toml b/nyx-chain-watcher/pgsql/Cargo.toml index b036688b5e..926ccf70eb 100644 --- a/nyx-chain-watcher/pgsql/Cargo.toml +++ b/nyx-chain-watcher/pgsql/Cargo.toml @@ -19,12 +19,12 @@ async-trait.workspace = true axum = { workspace = true, features = ["tokio"] } chrono = { workspace = true } clap = { workspace = true, features = ["cargo", "derive", "env"] } -nym-config = { path = "../common/config" } -nym-bin-common = { path = "../common/bin-common", features = ["output_format"] } -nym-network-defaults = { path = "../common/network-defaults" } -nym-task = { path = "../common/task" } -nym-validator-client = { path = "../common/client-libs/validator-client" } -nyxd-scraper-psql = { path = "../common/nyxd-scraper-psql" } +nym-config = { path = "../../common/config" } +nym-bin-common = { path = "../../common/bin-common", features = ["output_format"] } +nym-network-defaults = { path = "../../common/network-defaults" } +nym-task = { path = "../../common/task" } +nym-validator-client = { path = "../../common/client-libs/validator-client" } +nyxd-scraper-psql = { path = "../../common/nyxd-scraper-psql" } reqwest = { workspace = true, features = ["rustls-tls"] } schemars = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/nyx-chain-watcher/pgsql/src/http/api_docs.rs b/nyx-chain-watcher/pgsql/src/http/api_docs.rs index 097bd3c4ba..32cf38fc78 100644 --- a/nyx-chain-watcher/pgsql/src/http/api_docs.rs +++ b/nyx-chain-watcher/pgsql/src/http/api_docs.rs @@ -4,7 +4,7 @@ use utoipauto::utoipauto; // manually import external structs which are behind feature flags because they // can't be automatically discovered // https://github.com/ProbablyClem/utoipauto/issues/13#issuecomment-1974911829 -#[utoipauto(paths = "./nyx-chain-watcher/src")] +#[utoipauto(paths = "./nyx-chain-watcher/pgsql/src")] #[derive(OpenApi)] #[openapi(info(title = "Nyx Chain Watcher API"), tags(), components(schemas()))] pub(super) struct ApiDoc; diff --git a/nyx-chain-watcher/sqlite/Cargo.toml b/nyx-chain-watcher/sqlite/Cargo.toml index 3a2f09149b..ec7fa85fca 100644 --- a/nyx-chain-watcher/sqlite/Cargo.toml +++ b/nyx-chain-watcher/sqlite/Cargo.toml @@ -19,12 +19,12 @@ async-trait.workspace = true axum = { workspace = true, features = ["tokio"] } chrono = { workspace = true } clap = { workspace = true, features = ["cargo", "derive", "env"] } -nym-config = { path = "../common/config" } -nym-bin-common = { path = "../common/bin-common", features = ["output_format"] } -nym-network-defaults = { path = "../common/network-defaults" } -nym-task = { path = "../common/task" } -nym-validator-client = { path = "../common/client-libs/validator-client" } -nyxd-scraper-sqlite = { path = "../common/nyxd-scraper-sqlite" } +nym-config = { path = "../../common/config" } +nym-bin-common = { path = "../../common/bin-common", features = ["output_format"] } +nym-network-defaults = { path = "../../common/network-defaults" } +nym-task = { path = "../../common/task" } +nym-validator-client = { path = "../../common/client-libs/validator-client" } +nyxd-scraper-sqlite = { path = "../../common/nyxd-scraper-sqlite" } reqwest = { workspace = true, features = ["rustls-tls"] } schemars = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/nyx-chain-watcher/sqlite/src/http/api_docs.rs b/nyx-chain-watcher/sqlite/src/http/api_docs.rs index 097bd3c4ba..842a5dd237 100644 --- a/nyx-chain-watcher/sqlite/src/http/api_docs.rs +++ b/nyx-chain-watcher/sqlite/src/http/api_docs.rs @@ -4,7 +4,7 @@ use utoipauto::utoipauto; // manually import external structs which are behind feature flags because they // can't be automatically discovered // https://github.com/ProbablyClem/utoipauto/issues/13#issuecomment-1974911829 -#[utoipauto(paths = "./nyx-chain-watcher/src")] +#[utoipauto(paths = "./nyx-chain-watcher/sqlite/src")] #[derive(OpenApi)] #[openapi(info(title = "Nyx Chain Watcher API"), tags(), components(schemas()))] pub(super) struct ApiDoc;