From 44ad6804ae2823baeaa1d1ec8930afe01c9466da Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 28 Oct 2024 15:32:50 -0400 Subject: [PATCH] fix: call waku_setup when instantiating waku_new --- waku-bindings/src/node/management.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/waku-bindings/src/node/management.rs b/waku-bindings/src/node/management.rs index 3e4cd59..56e3ee1 100644 --- a/waku-bindings/src/node/management.rs +++ b/waku-bindings/src/node/management.rs @@ -15,8 +15,12 @@ use crate::utils::{get_trampoline, handle_json_response, handle_no_response, han /// Instantiates a Waku node /// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_newchar-jsonconfig) pub fn waku_new(config: Option) -> Result { - let config = config.unwrap_or_default(); + unsafe { + waku_sys::waku_setup(); + } + + let config = config.unwrap_or_default(); let config_ptr = CString::new( serde_json::to_string(&config) .expect("Serialization from properly built NodeConfig should never fail"),