[package]
name         = "tsoracle-server"
version      = "0.2.7"
edition.workspace      = true
rust-version.workspace = true
license.workspace      = true
repository.workspace   = true
homepage.workspace     = true
readme                 = "README.md"
description  = "Embeddable gRPC server for the timestamp oracle."
documentation = "https://docs.rs/tsoracle-server"
keywords      = ["tsoracle", "grpc", "server", "timestamp", "oracle"]
categories    = ["network-programming", "database"]

[features]
default    = ["tls-rustls", "tracing"]
failpoints = ["tsoracle-failpoint/failpoints"]
yieldpoints = ["tsoracle-yieldpoint/yieldpoints"]
metrics    = ["dep:metrics"]
tls-rustls = ["tonic/tls-aws-lc"]
tls-native = ["tonic/tls-native-roots"]
tracing    = ["dep:tracing"]
test-fakes = []
test-support = ["test-fakes"]
reflection = ["dep:tonic-reflection", "tsoracle-proto/reflection"]
bt         = ["tsoracle-core/bt", "tsoracle-consensus/bt"]

[package.metadata.docs.rs]
features       = ["tls-rustls", "tracing", "reflection", "metrics"]
rustdoc-args   = ["--cfg", "docsrs"]

[dependencies]
async-trait        = { workspace = true }
futures            = { workspace = true }
metrics            = { workspace = true, optional = true }
parking_lot        = { workspace = true }
prost              = { workspace = true }
thiserror          = { workspace = true }
tokio              = { workspace = true, features = ["signal"] }
tokio-stream       = { workspace = true }
tonic              = { workspace = true }
tonic-prost        = { workspace = true }
tonic-reflection   = { workspace = true, optional = true }
tracing            = { workspace = true, optional = true }
tsoracle-core      = { path = "../tsoracle-core", version = "0.2.4" }
tsoracle-consensus = { path = "../tsoracle-consensus", version = "0.1.9" }
tsoracle-proto     = { path = "../tsoracle-proto", version = "0.2.3" }
tsoracle-yieldpoint = { workspace = true }
tsoracle-failpoint = { workspace = true }

[dev-dependencies]
tokio        = { workspace = true, features = ["test-util"] }
metrics-util = { workspace = true }
tsoracle-core = { path = "../tsoracle-core", version = "0.2.4", features = ["test-clock"] }
tracing-subscriber = { workspace = true }

[target.'cfg(unix)'.dev-dependencies]
nix = { workspace = true }

[[test]]
name = "e2e"
required-features = ["test-support"]

[[test]]
name = "leader_watch"
required-features = ["test-fakes"]

[[test]]
name = "embedded_router"
required-features = ["test-support"]

[[test]]
name = "leadership_churn"
required-features = ["test-support"]

[[test]]
name = "serve_shutdown"
required-features = ["test-fakes"]

[[test]]
name = "metrics"
required-features = ["test-support", "metrics"]

[[test]]
name = "fence_yieldpoint"
required-features = ["yieldpoints", "test-fakes"]
