diff --git a/Cargo.lock b/Cargo.lock index 1f7a482..7dbbffb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3048,6 +3048,9 @@ name = "uuid" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +dependencies = [ + "getrandom", +] [[package]] name = "valuable" @@ -3086,6 +3089,7 @@ dependencies = [ "sscanf", "tokio", "url", + "uuid", "waku-sys", ] diff --git a/examples/Cargo.lock b/examples/Cargo.lock index 002efc7..6ccf393 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -4915,6 +4915,9 @@ name = "uuid" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +dependencies = [ + "getrandom", +] [[package]] name = "valuable" @@ -4963,6 +4966,7 @@ dependencies = [ "sscanf", "tokio", "url", + "uuid", "waku-sys", ] diff --git a/waku-bindings/Cargo.toml b/waku-bindings/Cargo.toml index 19c0262..57e6364 100644 --- a/waku-bindings/Cargo.toml +++ b/waku-bindings/Cargo.toml @@ -34,6 +34,7 @@ rln = "0.3.4" tokio = { version = "1", features = ["full"] } regex = "1" chrono = "0.4" +uuid = { version = "1.3", features = ["v4"] } [dev-dependencies] futures = "0.3.25" diff --git a/waku-bindings/src/node/mod.rs b/waku-bindings/src/node/mod.rs index 5ab9238..34fb9a1 100644 --- a/waku-bindings/src/node/mod.rs +++ b/waku-bindings/src/node/mod.rs @@ -18,6 +18,7 @@ pub use secp256k1::{PublicKey, SecretKey}; use std::marker::PhantomData; use std::time::Duration; use store::StoreWakuMessageResponse; +use uuid::Uuid; // internal use crate::general::contenttopic::{Encoding, WakuContentTopic}; use crate::general::libwaku_response::LibwakuResponse; @@ -202,10 +203,11 @@ impl WakuNodeHandle { let mut messages: Vec = Vec::new(); loop { + let request_id = Uuid::new_v4(); let response = store::waku_store_query( &self.ctx, - "hard-coded-req-id".to_string(), true, // include_data + request_id.to_string(), pubsub_topic.clone(), content_topics.clone(), Some(time_start), // time_start