mirror of
https://github.com/logos-messaging/logos-delivery-rust-bindings.git
synced 2026-03-06 17:13:28 +00:00
chore: align with logos-delivery
This commit is contained in:
parent
517782e0df
commit
ef5252b817
@ -46,6 +46,9 @@ async fn main() -> Result<(), Error> {
|
||||
WakuEvent::ConnectionChange(_evt) => {
|
||||
// dbg!("Conn change evt", evt);
|
||||
}
|
||||
WakuEvent::NodeHealthChange(_evt) => {
|
||||
// dbg!("Node health change evt", evt);
|
||||
}
|
||||
WakuEvent::Unrecognized(err) => panic!("Unrecognized waku event: {:?}", err),
|
||||
_ => panic!("event case not expected"),
|
||||
};
|
||||
@ -75,6 +78,9 @@ async fn main() -> Result<(), Error> {
|
||||
WakuEvent::ConnectionChange(_evt) => {
|
||||
// dbg!("Conn change evt", evt);
|
||||
}
|
||||
WakuEvent::NodeHealthChange(_evt) => {
|
||||
// dbg!("Node health change evt", evt);
|
||||
}
|
||||
WakuEvent::Unrecognized(err) => panic!("Unrecognized waku event: {:?}", err),
|
||||
_ => panic!("event case not expected"),
|
||||
};
|
||||
|
||||
@ -28,7 +28,7 @@ pub struct WakuNodeConfig {
|
||||
#[default(Some(true))]
|
||||
pub relay: Option<bool>,
|
||||
pub relay_topics: Vec<String>,
|
||||
#[default(vec![1])]
|
||||
#[default(vec![0])]
|
||||
pub shards: Vec<usize>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub max_message_size: Option<String>,
|
||||
|
||||
@ -27,6 +27,9 @@ pub enum WakuEvent {
|
||||
#[serde(rename = "connection_change")]
|
||||
ConnectionChange(ConnectionChangeEvent),
|
||||
|
||||
#[serde(rename = "node_health_change")]
|
||||
NodeHealthChange(NodeHealthChangeEvent),
|
||||
|
||||
Unrecognized(serde_json::Value),
|
||||
}
|
||||
|
||||
@ -62,6 +65,14 @@ pub struct ConnectionChangeEvent {
|
||||
pub peer_event: String,
|
||||
}
|
||||
|
||||
/// Type of `event` field for a `node health change` event
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct NodeHealthChangeEvent {
|
||||
/// The node connection status: Disconnected, PartiallyConnected, or Connected
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::WakuEvent;
|
||||
|
||||
@ -100,6 +100,13 @@ fn generate_bindgen_code(project_dir: &Path) {
|
||||
println!("cargo:rustc-link-lib=dl");
|
||||
println!("cargo:rustc-link-lib=m");
|
||||
|
||||
// libwaku.a bundles C++ objects (nim-lsquic / BoringSSL); link the C++ runtime.
|
||||
if cfg!(target_os = "macos") {
|
||||
println!("cargo:rustc-link-lib=c++");
|
||||
} else {
|
||||
println!("cargo:rustc-link-lib=stdc++");
|
||||
}
|
||||
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
nwaku_path
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user