diff --git a/waku-bindings/src/node/discv5.rs b/waku-bindings/src/node/discv5.rs deleted file mode 100644 index 3b2a3f6..0000000 --- a/waku-bindings/src/node/discv5.rs +++ /dev/null @@ -1,30 +0,0 @@ -// std -use std::ffi::CStr; - -// crates -use crate::general::JsonResponse; -use crate::Result; - -/// Starts the DiscoveryV5 service to discover and connect to new peers -pub fn waku_discv5_start() -> Result { - let result = unsafe { CStr::from_ptr(waku_sys::waku_discv5_start()) } - .to_str() - .expect("Response should always succeed to load to a &str"); - - let response: JsonResponse = - serde_json::from_str(result).expect("JsonResponse should always succeed to deserialize"); - - response.into() -} - -/// Stops the DiscoveryV5 service -pub fn waku_discv5_stop() -> Result { - let result = unsafe { CStr::from_ptr(waku_sys::waku_discv5_stop()) } - .to_str() - .expect("Response should always succeed to load to a &str"); - - let response: JsonResponse = - serde_json::from_str(result).expect("JsonResponse should always succeed to deserialize"); - - response.into() -} diff --git a/waku-bindings/src/node/mod.rs b/waku-bindings/src/node/mod.rs index 47a39a3..4f247df 100644 --- a/waku-bindings/src/node/mod.rs +++ b/waku-bindings/src/node/mod.rs @@ -2,7 +2,6 @@ mod config; mod discovery; -mod discv5; mod filter; mod lightpush; mod management; @@ -89,16 +88,6 @@ fn stop_node() -> Result<()> { } impl WakuNodeHandle { - /// Starts the DiscoveryV5 service to discover and connect to new peers - pub fn discv5_start(&self) -> Result { - discv5::waku_discv5_start() - } - - /// Stops the DiscoveryV5 service - pub fn discv5_stop(&self) -> Result { - discv5::waku_discv5_stop() - } - /// Start a Waku node mounting all the protocols that were enabled during the Waku node instantiation. /// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_start) pub fn start(self) -> Result> { @@ -119,16 +108,6 @@ impl WakuNodeHandle { stop_node() } - /// Starts the DiscoveryV5 service to discover and connect to new peers - pub fn discv5_start(&self) -> Result { - discv5::waku_discv5_start() - } - - /// Stops the DiscoveryV5 service - pub fn discv5_stop(&self) -> Result { - discv5::waku_discv5_stop() - } - /// Dial peer using a multiaddress /// If `timeout` as milliseconds doesn't fit into a `i32` it is clamped to [`i32::MAX`] /// If the function execution takes longer than `timeout` value, the execution will be canceled and an error returned. diff --git a/waku-bindings/tests/node.rs b/waku-bindings/tests/node.rs index c62a32a..5850ae4 100644 --- a/waku-bindings/tests/node.rs +++ b/waku-bindings/tests/node.rs @@ -37,9 +37,6 @@ pub fn main() -> Result<(), String> { let node = node.start()?; println!("Node peer id: {}", node.peer_id()?); - let result = node.discv5_start()?; - println!("Discv5 started: {}", result); - for node_address in NODES { let address: Multiaddr = node_address.parse().unwrap(); let peer_id = node.add_peer(&address, ProtocolId::Relay)?; diff --git a/waku-sys/vendor b/waku-sys/vendor index 183d782..2c9c763 160000 --- a/waku-sys/vendor +++ b/waku-sys/vendor @@ -1 +1 @@ -Subproject commit 183d7822bfb5d7149a10823a782b007cc2476b1b +Subproject commit 2c9c763c306dfa10dc371134d830702d4e0fbf0f