diff --git a/Cargo.toml b/Cargo.toml index a2432290..000890c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,15 @@ version = "0.2.0" edition = "2021" authors = ["Chris Smith "] build = "build.rs" +default-run = "server" + +[[bin]] +name = "server" +path = "src/bin/server.rs" + +[[bin]] +name = "publisher_service" +path = "src/bin/publisher.rs" [dependencies] wc = { git = "https://github.com/WalletConnect/utils-rs.git", tag = "v0.5.1", features = ["full"] } diff --git a/src/bin/publisher.rs b/src/bin/publisher.rs new file mode 100644 index 00000000..43ade483 --- /dev/null +++ b/src/bin/publisher.rs @@ -0,0 +1,19 @@ +use { + dotenv::dotenv, + notify_server::{config::Configuration, Result}, + tracing_subscriber::fmt::format::FmtSpan, +}; + +/// Service for processing queued messages for publish +#[tokio::main] +async fn main() -> Result<()> { + dotenv().ok(); + let config = Configuration::new().expect("Failed to load config!"); + tracing_subscriber::fmt() + .with_env_filter(config.log_level) + .with_span_events(FmtSpan::CLOSE) + .with_ansi(std::env::var("ANSI_LOGS").is_ok()) + .init(); + Ok(()) + // TODO: Implement publisher service runner +} diff --git a/src/main.rs b/src/bin/server.rs similarity index 96% rename from src/main.rs rename to src/bin/server.rs index eb160fe3..53cd1644 100644 --- a/src/main.rs +++ b/src/bin/server.rs @@ -5,6 +5,7 @@ use { tracing_subscriber::fmt::format::FmtSpan, }; +/// Notify API server #[tokio::main] async fn main() -> Result<()> { let (_signal, shutdown) = broadcast::channel(1);