mirror of
https://github.com/logos-messaging/logos-delivery-rust-bindings.git
synced 2026-02-28 06:03:34 +00:00
chore: align with logos-delivery
This commit is contained in:
parent
14fcc24d37
commit
8abc430b01
1726
Cargo.lock
generated
1726
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
1603
examples/Cargo.lock
generated
1603
examples/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,7 @@ impl App<Initialized> {
|
||||
tcp_port: Some(60010),
|
||||
cluster_id: Some(16),
|
||||
shards: vec![1, 32, 64, 128, 256],
|
||||
num_shards_in_network: Some(0), // static sharding for explicit RS shard indices
|
||||
// node_key: Some(SecretKey::from_str("2fc0515879e52b7b73297cfd6ab3abf7c344ef84b7a90ff6f4cc19e05a198027").unwrap()),
|
||||
max_message_size: Some("1024KiB".to_string()),
|
||||
relay_topics: vec![String::from(&pubsub_topic)],
|
||||
@ -117,6 +118,9 @@ impl App<Initialized> {
|
||||
WakuEvent::ConnectionChange(_evt) => {
|
||||
// dbg!("Conn change evt", evt);
|
||||
},
|
||||
WakuEvent::NodeHealthChange(_evt) => {
|
||||
// dbg!("Node health change evt", evt);
|
||||
},
|
||||
WakuEvent::Unrecognized(err) => eprintln!("Unrecognized waku event: {:?}", err),
|
||||
_ => eprintln!("event case not expected"),
|
||||
};
|
||||
|
||||
@ -31,7 +31,6 @@ url = "2.3"
|
||||
waku-sys = { version = "1.0.0", path = "../waku-sys" }
|
||||
libc = "0.2"
|
||||
serde-aux = "4.3.1"
|
||||
rln = "0.3.4"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
regex = "1"
|
||||
chrono = "0.4"
|
||||
|
||||
@ -8,12 +8,6 @@ pub mod node;
|
||||
// Re-export the LibwakuResponse type to make it accessible outside this module
|
||||
pub use general::libwaku_response::LibwakuResponse;
|
||||
|
||||
// Required so functions inside libwaku can call RLN functions even if we
|
||||
// use it within the bindings functions
|
||||
#[allow(clippy::single_component_path_imports)]
|
||||
#[allow(unused)]
|
||||
use rln;
|
||||
|
||||
pub use node::{
|
||||
waku_create_content_topic, waku_new, Initialized, Key, Multiaddr, PublicKey, RLNConfig,
|
||||
Running, SecretKey, WakuEvent, WakuMessageEvent, WakuNodeConfig, WakuNodeHandle,
|
||||
|
||||
@ -30,6 +30,12 @@ pub struct WakuNodeConfig {
|
||||
pub relay_topics: Vec<String>,
|
||||
#[default(vec![0])]
|
||||
pub shards: Vec<usize>,
|
||||
/// Number of shards in the cluster for auto-sharding. Set to `0` to use
|
||||
/// static sharding (required when subscribing to explicit RS shard indices
|
||||
/// such as those used by the Status.im production network).
|
||||
/// Defaults to `None` (Nim will use its own default of 1).
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub num_shards_in_network: Option<u16>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub max_message_size: Option<String>,
|
||||
|
||||
|
||||
@ -120,6 +120,22 @@ fn generate_bindgen_code(project_dir: &Path) {
|
||||
.compile("cmditems"); // Compile it as a library
|
||||
println!("cargo:rustc-link-lib=static=cmditems");
|
||||
|
||||
// Link librln.a (built from vendored zerokit by the Nim Makefile).
|
||||
// The Rust `rln` crate is not used as a dependency because its older
|
||||
// versions (0.3.x) pulled in wasmer 2.x which references __rust_probestack,
|
||||
// a symbol removed in Rust 1.86. Instead, we link the prebuilt librln_*.a
|
||||
// directly, which is the same artifact that libwaku.a was compiled against.
|
||||
if let Ok(entries) = std::fs::read_dir(&nwaku_path) {
|
||||
for entry in entries.flatten() {
|
||||
let name = entry.file_name();
|
||||
let name = name.to_string_lossy();
|
||||
if name.starts_with("librln_") && name.ends_with(".a") {
|
||||
println!("cargo:rustc-link-arg={}", entry.path().display());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate waku bindings with bindgen
|
||||
let bindings = bindgen::Builder::default()
|
||||
// The input header we would like to generate
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user