mirror of
https://github.com/waku-org/waku-rust-bindings.git
synced 2025-02-16 08:37:32 +00:00
fix: call waku_setup when instantiating waku_new
This commit is contained in:
parent
0cf27d112c
commit
44ad6804ae
@ -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<WakuNodeConfig>) -> Result<WakuNodeContext> {
|
||||
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"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user