From cc683854b7cb06018896c31b099dc2c7448efbe5 Mon Sep 17 00:00:00 2001 From: William Katsak Date: Mon, 13 Nov 2023 11:20:01 -0500 Subject: [PATCH] WIP: Break out features Signed-off-by: William Katsak --- Cargo.toml | 26 ++++++++++++++++++++------ src/lib.rs | 4 ++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7ba30cf8b..d60a43b7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,13 @@ repository = "https://github.com/hyperledger/sawtooth-sdk-rust" edition = "2018" [features] -default = ["pem"] +default = [ + "consensus", + "messaging", + "processor", + "signing", + "pem", +] stable = [ "default", @@ -35,20 +41,28 @@ stable = [ experimental = [] +consensus = ["zmq"] + +messaging = ["zmq"] + +processor = ["messaging", "zmq", "ctrlc"] + +signing = ["secp256k1"] + # Add support for loading PEM encoded private keys -pem = ["openssl"] +pem = ["signing", "openssl"] [dependencies] hex = "0.4" -protobuf="2" -secp256k1 = "0.27" +protobuf = "2" +secp256k1 = { version = "0.27", optional = true } rand = { version = "0.8", features = ["getrandom"]} sha2 = "0.10" -zmq = "0.9" +zmq = { version = "0.9", optional = true } uuid = { version = "0.8", features = ["v4"] } log = "0.4" libc = "0.2" -ctrlc = { version = "3.0", features = ["termination"] } +ctrlc = { version = "3.0", features = ["termination"], optional = true} openssl = { version = "0.10", optional = true } [dev-dependencies] diff --git a/src/lib.rs b/src/lib.rs index 8c5d1d44c..6ee492d19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,8 +18,12 @@ #[macro_use] extern crate log; +#[cfg(feature = "consensus")] pub mod consensus; pub mod messages; +#[cfg(feature = "messaging")] pub mod messaging; +#[cfg(feature = "processor")] pub mod processor; +#[cfg(feature = "signing")] pub mod signing;