Skip to content

Commit

Permalink
provide wasm compatibility for gossipsub protocol
Browse files Browse the repository at this point in the history
Signed-off-by: ozkanonur <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed May 22, 2023
1 parent 9867fce commit 1ab42f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[features]
wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"]

[dependencies]
either = "1.5"
libp2p-swarm = { workspace = true }
Expand All @@ -32,10 +35,11 @@ hex_fmt = "0.3.0"
regex = "1.8.1"
serde = { version = "1", optional = true, features = ["derive"] }
wasm-timer = "0.2.5"
instant = "0.1.11"
void = "1.0.2"
# Metrics dependencies
prometheus-client = "0.21.0"
instant = "0.1.11"
getrandom = "0.2.9"

[dev-dependencies]
async-std = { version = "1.6.3", features = ["unstable"] }
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/peer_score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
use crate::metrics::{Metrics, Penalty};
use crate::time_cache::TimeCache;
use crate::{MessageId, TopicHash};
use instant::Instant;
use libp2p_identity::PeerId;
use log::{debug, trace, warn};
use std::collections::{hash_map, HashMap, HashSet};
use std::net::IpAddr;
use std::time::Duration;
use wasm_timer::Instant;

mod params;
use crate::ValidationError;
Expand Down

0 comments on commit 1ab42f6

Please sign in to comment.